Conversation
3d8fecc to
03da339
Compare
|
The GCP (google cloud project) dashboard is at https://console.cloud.google.com/home/dashboard?project=jcsda-helpdesk. JEDI Infra and Phil should have access. I created a Service Account to use for our issue spreadsheet named "jcsda-helpdesk-sheets" |
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
@gibbsp this is a place holder for our auto assignments based on requesting organization. I know Christian and Nate are going to be owners of some projects too. Can you provide me with a full list of "Requesting Organization (or project)" and a corresponding JCSDA member? I will update this file and the drop down options in Helpdesk.yml.
There was a problem hiding this comment.
We can update this file in this PR or I have another issue open to give the users a drop down option menu for selecting requestor organization (#22)
|
I am going to spend a little time reorganizing the spreadsheet for better readability before this goes in. |
There was a problem hiding this comment.
These steps are already completed. The notes here are so we can do it again if needed.
|
@eap @ytremolet @gibbsp this is a big PR adding the automation for spreadsheet helpdesk tracking. I have a private repo that is a duplicate of this so I can test everything before pushing this to the master branch. Happy to jump on a meeting to show those tests and results. I included screen shots in the description. For now, tracking and sheet updates will only be done in the .github repo. I have a ticket open to scale this across our repositories. |
|
This looks reasonable. I'm not an expert on the tools being used here. Is there something specific you want me to look at? |
|
@ytremolet No worries. I walked Evan through everything so he can do a more detailed code review. Thanks!
|
There was a problem hiding this comment.
If #26 is merged first then I will update this file before we merge.
eap
left a comment
There was a problem hiding this comment.
Looking good. I've added a few comments on issues some that need to be adressed and some that are just questions.
On the basis of this being experimental, I'm inclined to approve it on the basis that we will iterate as we go. Please address the comments before submitting.
|
|
||
| # Column order in the spreadsheet. Must stay in sync with the row list built | ||
| # in main() below. | ||
| COLUMNS = [ |
There was a problem hiding this comment.
Thinking out lout, it would be nice to get columns from the helpdesk.yml... or at least verify that the columns defined in the issue template are also present here as columns.
At present, the names aren't fully 1:1 matching and, unavoidably, the sheet will contain columns not present in the template.
Don't really have to do anything on this right now but definitely food-for-thought. (Also if this is a github action then it means there's a blocking github-api call every time we check, so...)
| m = re.search(pattern, body or "", re.MULTILINE) | ||
| return m.group(1).strip() if m else "" |
There was a problem hiding this comment.
Style nitpick; ternary returns are hard to read.
| m = re.search(pattern, body or "", re.MULTILINE) | |
| return m.group(1).strip() if m else "" | |
| m = re.search(pattern, body or "", re.MULTILINE) | |
| if not m: | |
| return "" | |
| return m.group(1).strip() |
| '###' header or end of body, with leading/trailing whitespace stripped. | ||
| """ | ||
| text = _section_body(body, section_title) | ||
| return text.strip() if text is not None else "" |
There was a problem hiding this comment.
| return text.strip() if text is not None else "" | |
| if not text: | |
| return "" | |
| return text.strip() |
|
|
||
| # ── Org → assignee lookup ───────────────────────────────────────────────────── | ||
|
|
||
| _PLACEHOLDER_ORGS = {"na", "n/a", "none", "unknown", "n.a.", "not applicable", ""} |
There was a problem hiding this comment.
| _PLACEHOLDER_ORGS = {"na", "n/a", "none", "unknown", "n.a.", "not applicable", ""} | |
| _NO_ORG_FIELD_VALUES = {"na", "n/a", "none", "unknown", "n.a.", "not applicable", ""} |
| """ | ||
| default = org_map.get("default_assignee") | ||
| org_lower = requesting_org.lower().strip() | ||
| if org_lower in _PLACEHOLDER_ORGS: |
There was a problem hiding this comment.
| if org_lower in _PLACEHOLDER_ORGS: | |
| if org_lower in _NO_ORG_FIELD_VALUES: |
| if org_lower in _PLACEHOLDER_ORGS: | ||
| return default | ||
| for key, assignee in org_map.items(): | ||
| if key.startswith("_") or key == "default_assignee": |
There was a problem hiding this comment.
Can you add an inline comment here? Whats with the "_" key?
| a = datetime.datetime.fromisoformat(a_iso) | ||
| b = datetime.datetime.fromisoformat(b_iso) |
There was a problem hiding this comment.
Unsantized input here. Not dangerous but it can halt the ingest by throwing a value error (unset field, badly formatted, high-energy cosmic photon, whatever).
Wrap with ValueError catcher and return something sensible that indicates an error in calculating.
| is added as an editor so automation can still reinitialise if needed. | ||
| """ | ||
| sh = ws.spreadsheet | ||
| requests = [] |
There was a problem hiding this comment.
You imported the "requests" library earlier and this overwrites the module as a list in the local namespace of this funciton. Use a different var name here.
| } | ||
| } | ||
| """ | ||
| resp = requests.post( |
There was a problem hiding this comment.
You use the requests library in several places to interact with the GitHub API. I'd recommend using retries here (at least 2x total tries with a small delay) to hedge against api flakiness caused failures.
Alternatively use pygithub which has its own retry system built into the client library... although its not automatic so in either case you have to consider it here.
Description
This PR builds off of Phil's helpdesk issue template to automatically populate a spreadsheet with information on the ticket. It will update upon open, description change, and close.
Issue(s) addressed
Resolves https://github.com/JCSDA-internal/github-admin/issues/137
Dependencies
None
Impact
Expected impact on downstream repositories:
Manual Testing Instructions (optional)
I have tested this with my own repository in order to kick of github actions.

Spreadsheet updating:

Once this get's merged, the sheet it will use is:
https://docs.google.com/spreadsheets/d/1ij5LQwjtjfsdywVfX5YepqeHIs-tufIMW9k8pc_69nc/edit?usp=sharing
Checklist
Further Notes - work for a different PR:
The helpdesk label does not appear to assign the JCSDA AOP label correctly and makes a new one?Fixed in another PRI want to update the template for a "Triage" Or "Upon closure section" for the assignee or manager to fill out - this auto populate columns such as "Triage Category" and "Root Cause"(Tracked in new issue Add Closing Notes to helpdesk template #23)Update template to have a drop down menu for Partner agencies and projects so we have clear assignee (and funding) mapping(Tracked in new issue Update Helpdesk yaml to included partner drop down #22)