Repository navigation
Refactor wins workflow for current project board - #8779
Conversation
- In gh-requests, utilize GraphQL calls for addIssueToProjectV2 function - In wins-form-submissions, replace deprecated Column Keys with GitHub Projects v2 Status Field IDs
|
Want to review this pull request? Take a look at this documentation for a step by step guide! From your project repository, check out a new branch and test the changes. |
daras-cu
left a comment
There was a problem hiding this comment.
@castillios everything looks good with your changes, I tested the Wins workflow in my dev environment and confirmed:
- New Wins form submissions populate the spreadsheet correctly
- A wins review issue is created upon form submission and moved to the proper column on the Project Board
- When running the main function, a PR is opened with the new entries, correctly formatted
- The encoded PAT is no longer output in the console
Thank you for working on this and your patience while I figured out some of the problems!
|
@ExperimentsInHonesty as part of the changes in this PR, the elizabethhonest bot access token will need to have "project" permissions added to its scope. This will allow it to add Wins review issues to the correct column on the project board using the new GraphQL request. Please let me know if it is alright to change the permissions on the elizabethhonest token. |
|
Availability: Weekends |
Tomlu60220244
left a comment
There was a problem hiding this comment.
Hi castillos! Sorry for the delay review. I checked your code and everything is great. You did an excenlent job!
I love that the old project-board function is no longer referenced and that you replaced the deprecated Projects Classic workflow with the new Projects v2 GraphQL flow.
There are just few trailing whitespaces , but they do not affect the functionality of this change.
I will approve this PR. Great work!
|
Thank you @daras-cu and @Tomlu60220244 for the feedback! |
|
@daras-cu yes, please go ahead
|
|
I've updated the elizabethhonest bot token with the "project" permission, and tested the workflow to confirm it is working. |
Fixes #8701
What changes did you make?
addIssueToProjectBoardColumnfunction withaddIssueToProjectV2to post issues to the current project board using a GraphQL API callgraphqlRequest_helper function to build an API call. It mirrors the existingpostRequest_functiongithub-actions/utils/_data/status-field-ids.jsfor accuracyCOLUMN_KEYSwithPROJECT_V2object literal, which connects to current project boardcreateIssuereplaceaddIssueToProjectBoardColumnwith call toaddIssueToProjectV2Why did you make the changes (we will use this info to test)?
Testing Setup/Strategy
elizabethhonestaccount with my fork's project board IDs and my own GitHub handle respectively8. Testingof the guide):update-wins-databranch to receive Wins submissions / data from Google Apps Script.test-winsbranch to act as the base for PRs in place ofgh-pageswins-form-response/Code.jsvia Google Apps Script to create a PR on my fork: (Update wins-data.json via Google Apps Script castillios/website#36).test-winsand viewed the website to ensure that test Wins populate the page as intended (screenshot attached below)CodeQL Alerts
After the PR has been submitted and the resulting GitHub actions/checks have been completed, developers should check the PR for CodeQL alert annotations.
Check the PR's comments. If present on your PR, the CodeQL alert looks similar as shown
Please let us know that you have checked for CodeQL alerts. Please do not dismiss alerts.
Instructions for resolving CodeQL alerts
If CodeQL alert/annotations appear, refer to How to Resolve CodeQL alerts.
In general, CodeQL alerts should be resolved prior to PR reviews and merging
Screenshots of Proposed Changes To The Website (if any, please do not include screenshots of code changes)
Note: These are NOT current changes to the website, rather the screenshots below are examples of what the changes WOULD look like after the refactor using test Wins.
Example of Wins Page
Wins test submissions via Google Sheets
I've highlighted the Wins overview to emphasize these are the same submissions displayed in the example above: