Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions: Remove merged PRs from the Project Board #2592

Closed
11 tasks done
SAUMILDHANKAR opened this issue Dec 16, 2021 · 50 comments · Fixed by #3867 or #3897
Closed
11 tasks done

GitHub Actions: Remove merged PRs from the Project Board #2592

SAUMILDHANKAR opened this issue Dec 16, 2021 · 50 comments · Fixed by #3867 or #3897
Assignees
Labels
automation for manulal github board maintenance actions that are going to be automated Complexity: Medium Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly role: back end/devOps Tasks for back-end developers size: 2pt Can be done in 7-12 hours Status: Updated No blockers and update is ready for review time sensitive Needs to be worked on by a particular timeframe

Comments

@SAUMILDHANKAR
Copy link
Member

SAUMILDHANKAR commented Dec 16, 2021

Overview

As a developer, we have to ensure that our kanban board is organized for all teams so that productivity is high. For this issue, we want the cards of the merged pull requests to automatically be removed from the Project Board.

Action Items

  • Review the notes below to understand the GitHub actions architecture we are currently moving towards
  • This should be a new job under the "PR Trigger" workflow
    • This job should trigger whenever a PR is merged
    • This job should have an if statement that triggers when the event name is "pull_request" and event action is "merged"
      • if: ${{ github.event_name == 'pull_request' && github.event.action == 'merged'}}
    • This job should run in parallel with other actions that may exist in the trigger file

Pseudo-code

  • When a pull request is merged
    • Remove the pull request from the project board.

Checks

  • Test in your local environment that it works
  • If a reviewer merges a pr and does not remove the pr from the Project Board, the GitHub action should automatically remove the pr from the Project Board
  • If a reviewer merges a pr and moves it to the Project Board, the GitHub action should move it to the correct column in the Project Board and then remove it
  • If the column the pr is going to has automation turned on, the GitHub action should still trigger and remove the issue without causing any weird issues / side effects

Resources/Instructions

Never done GitHub actions? Start here!
GitHub Complex Workflows doc
GitHub Actions Workflow Directory
Events that trigger workflows
Workflow syntax for GitHub Actions
actions/github-script
GitHub RESTAPI

Architecture Notes

Currently, we want our GitHub Actions to be structured like so based on this proposal:

  • Schedules (military time)
    - Schedule Friday 0700
    - Schedule Thursday 1100
    - Schedule Daily 1100
  • Linters
    - Lint SCSS
  • PR Trigger
    - Add Linked Issue Labels to Pull Request
    - Add Pull Request Instructions
  • Issue Trigger
    - Add Missing Labels To Issues
  • WR - PR Trigger
    - WR Add Linked Issue Labels to Pull Request
    - WR Add Pull Request Instructions
  • WR - Issue Trigger

Actions with the same triggers (excluding linters, which will be their own category) will live in the same github action file. Scheduled actions will live in the same file if they trigger on the same schedule (i.e. all files that trigger everyday at 11am will live in one file, while files that trigger on Friday at 7am will be on a separate file).

That said, this structure is not set in stone. If any part of it feels strange, or you have questions, feel free to bring it up with the team so we can evolve this format!

@SAUMILDHANKAR SAUMILDHANKAR added role: back end/devOps Tasks for back-end developers Complexity: Medium Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly automation for manulal github board maintenance actions that are going to be automated labels Dec 16, 2021
@github-actions

This comment was marked as outdated.

@harshitasao

This comment was marked as outdated.

@github-actions github-actions bot added the Status: Updated No blockers and update is ready for review label Apr 8, 2022
@harshitasao

This comment was marked as off-topic.

@github-actions github-actions bot added 2 weeks inactive An issue that has not been updated by an assignee for two weeks and removed Status: Updated No blockers and update is ready for review labels Apr 22, 2022
@github-actions

This comment was marked as outdated.

@SAUMILDHANKAR SAUMILDHANKAR added To Update ! No update has been provided and removed 2 weeks inactive An issue that has not been updated by an assignee for two weeks labels Apr 22, 2022
@harshitasao harshitasao removed the To Update ! No update has been provided label Apr 23, 2022
@harshitasao

This comment was marked as resolved.

@github-actions github-actions bot added Status: Updated No blockers and update is ready for review 2 weeks inactive An issue that has not been updated by an assignee for two weeks and removed Status: Updated No blockers and update is ready for review labels Apr 29, 2022
@github-actions

This comment was marked as outdated.

@SAUMILDHANKAR SAUMILDHANKAR added To Update ! No update has been provided and removed 2 weeks inactive An issue that has not been updated by an assignee for two weeks labels May 7, 2022
@harshitasao

This comment was marked as outdated.

@harshitasao harshitasao added Status: Updated No blockers and update is ready for review and removed To Update ! No update has been provided labels May 8, 2022
@github-actions github-actions bot added 2 weeks inactive An issue that has not been updated by an assignee for two weeks and removed Status: Updated No blockers and update is ready for review labels May 20, 2022
@ExperimentsInHonesty
Copy link
Member

@blulady I didn't write this issue, but I think the idea was to reduce the number of items on the board. However, we want to keep the PRs for the feature branch that won't be merged

So I just went through the test-approved-by-reviewer (Automated Column, do not place items here manually) - with is:closed column with filter on, and moved the 12 issues that should have been in the Feature Branch - don't merge into gh-pages branch yet

That leaves us with 148 issues that we could remove from the board since they are closed. Which would allow us to see the 1 that the merge team actually needs to merge test-approved-by-reviewer (Automated Column, do not place items here manually) - with is:open

I also manually moved a bunch of issues #3667 and #3536, etc from the PR Needs review (Automated Column, do not place items here manually) column where they should not have been because they are already closed without merging and they go into the ignore column.

That still leaves us with 5 of the 6 issues in the PR Needs review (Automated Column, do not place items here manually) column that are merged already and should not be in the column. Theoretically, they should be showing up in the test-approved-by-reviewer (Automated Column, do not place items here manually) with the other merged changes. So that people looking for PRs to review could look and see the 1 issue that does need a review.

Let me know if you need more clarification

@github-actions github-actions bot added 2 weeks inactive An issue that has not been updated by an assignee for two weeks and removed Status: Updated No blockers and update is ready for review labels Dec 9, 2022
@github-actions
Copy link

github-actions bot commented Dec 9, 2022

@t-will-gillis

Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.

You are receiving this comment because your last comment was before Monday, December 5, 2022 at 11:16 PM PST.

@t-will-gillis
Copy link
Member

t-will-gillis commented Dec 13, 2022

Edited: see update below

I have been reviewing some of the other issues on the Project Board related to GitHub Actions, and I would like to ask for some additional clarification on this issue in light of the others. Regarding only ‘merged’ PRs, what exactly do we want to have happen with them? Do we want them all to be removed completely, or all of them to be moved to a specific column (‘Done’, ‘QA’, something else?), or is there a set of rules to be used for which issues to move to which columns and for which reasons?
First, my key takeaways from this issue are:

  1. This issue says that ‘merged’ PRs are to be removed from the board- and not moved to any other column (except possibly one). I make a long argument below about this, but it comes down to: there are no appropriate columns to move a ‘merged’ PR to (except possibly one).
  2. I am belaboring the point, but this issue is specifically for what to do with ‘merged’ PRs. There are at least two other open issues discussing ‘open’/’opened’ PRs- the movements of ‘open’ PRs through the Project Board are not applicable to this issue. (see below)
  3. Regarding the removal of ‘merged’ PRs:
    • There is an old issue , itself ironically closed but not addressed, that was discussing which automations to run to do which actions with closed issues.
    • The comments explain why this issue was initially closed without action, and why this issue is moving to ‘New Issue Approval’- It sounds like the question of what to do with closed issues is not resolved yet
    • Since ‘merged’ == ‘closed’ in GitHub, what exactly do we want to do with ‘merged’/’closed’ PRs, and what bearing does this have on the unresolved-soon-to-be-reopened issue ?
  4. Regarding ‘open’/’opened’ PRs:
    • The action that Justin is working on is for which actions to take on open PRs, references moving them to the ‘correct’ columns for various scenarios when the PR is first ‘opened’.
    • Open issue is also for ‘opened’ PRs, mentions creating new columns, mentions moving the open PRs to ‘correct’ columns, and mentions the merge team moving ‘merged PRs’ out of columns into other columns (but not where or why), and then deleting them.
    • The current issue is talking only about ‘merged PRs’, and moving those ‘merged PRs’ to and from ‘correct’ columns before deleting the issues. But in issue the ‘correct’ columns are all for 'opened' PRs. The columns listed are definitely not for 'merged' PRs:
     PRs that need a reviewer assigned
     PRs that need actions from authors
     Ready for re-review
     Reviewer has approved, waiting for merge team to merge
    • From Bonnie’s response above, this leaves the ‘QA’ column as a possibly appropriate place for (some/all?) ‘merged’ PRs to move to. If all ‘merged’ PRs move here, then we won’t be removing them from the board. If some ‘merged’ PRs move here, we will need rules for which ones move here and which ones are removed completely. Maybe none move here?

@github-actions github-actions bot added Status: Updated No blockers and update is ready for review and removed 2 weeks inactive An issue that has not been updated by an assignee for two weeks labels Dec 16, 2022
@github-actions github-actions bot added 2 weeks inactive An issue that has not been updated by an assignee for two weeks and removed Status: Updated No blockers and update is ready for review labels Dec 23, 2022
@github-actions
Copy link

@t-will-gillis

Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.

You are receiving this comment because your last comment was before Monday, December 19, 2022 at 11:16 PM PST.

@github-actions
Copy link

@t-will-gillis

Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.

You are receiving this comment because your last comment was before Monday, December 26, 2022 at 11:15 PM PST.

@t-will-gillis
Copy link
Member

@blulady @jdingeman @arpitapandya

  1. Progress:

a. I was able to create a model the HfLA ‘Project Board’ incl. matching columns in my repo. The goal was to see if HfLA’s GHAs/ *.yml files would be triggered by appropriate actions on the model using a personal access token where needed. This experiment was partially successful, in that the actions/ *.yml files attempted to run when issues and PRs were created, moved, closed, and merged.

b. I researched how to delete an issue when a PR is merged. In HfLA’s existing move-closed-issues.yaml the marketplace automation alex-page/gihub-project-automation-plus@v0.8.1 should easily allow this therefore I added the required syntax to the pull-request-trigger.yml.

c. Unfortunately, when the automation attempts to run, neither the project (named here ‘Project Board’) nor the column can be found in my repository. This is a known issue that other users have reported. However, this issue has not been occurring in HfLA’s workflows for move-closed-issues.yaml.

d. My working theory is this:

  • HfLA’s uses the ‘Projects (classic)’ for its ‘Project Board’. Since Github discontinued ‘Projects (classic)’, I am using the new Projects and I believe this is leading to some incompatibilities with the alex-page automations.
  • I have looked at the ‘GIT API’ for how to automatically delete an issue. I am not certain what is possible here yet- but if the alex-page automation works with HfLA’s ‘Project Board’ this seems much more straightforward.
  • I have explored the Community comments at Github and it seems that many people are noticing a loss of GHA features changing from the ‘Projects (classic)’ to the new ‘Projects.’
  • Regardless, I feel that it will be difficult to compare whether feature edits that work on the new ‘Projects’ will or won’t work on the ‘Projects (classic)’, and vice versa.

e. My proposed solution:

  • I would like to test edits to the pull-request-trigger.yml file on the actual HfLA ‘Project Board’. I propose to add a new ‘Dummy’ column to the board, place one merged PR in this column, and run the Pull Request Trigger to see whether or not the card is deleted.
  • If this works, then the Pull Request Trigger could be edited to include the same of the three PR columns [ ‘PR Needs review (Automated Column…)’, ‘test-pending-approval (Automated Column…)’, and ‘test-approved-by-reviewer (Automated Column…)’ ]
  • I am very open to other suggestions as well.
  1. Blockers: As I said, I am open to ideas but at this moment I believe I am at an impasse, and that I need access to either the actual ‘Project Board’ or a model ‘Project Board’ created with Github’s ‘Projects (classic)’. See above for my proposed solution for becoming unblocked.
  2. Availability: Weekend of 6-8 January 23.
    
  3. ETA: tbd
  4. Pictures:

@github-actions github-actions bot added Status: Updated No blockers and update is ready for review and removed 2 weeks inactive An issue that has not been updated by an assignee for two weeks labels Jan 6, 2023
@github-actions github-actions bot added 2 weeks inactive An issue that has not been updated by an assignee for two weeks and removed Status: Updated No blockers and update is ready for review labels Jan 13, 2023
@github-actions
Copy link

@t-will-gillis

Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.

You are receiving this comment because your last comment was before Monday, January 9, 2023 at 11:16 PM PST.

@t-will-gillis
Copy link
Member

t-will-gillis commented Jan 14, 2023

  1. Progress: No direct progress from last update: I still plan to explore using the alex-page/gihub-project-automation-plus@v0.8.1 automation for deleting closed + merged issues- the documentation indicates this should be possible. The HfLA GHA move-closed-issue also uses this automation. The logs show that up until a month ago, move-closed-issue was working. Currently the action fails with an error message 'bad credentials'. I am assuming that the HfLA token associated with the automation needs to be updated/reset- A member of the merge team will be updating this token in the last couple of days.

Once the token is updated/reset, and (hopefully) move-closed-issue is running again, THEN this will be a green light to continue exploring whether the alex-page automation can be used to delete closed + merged issues.

  1. Should be able to continue if the existing action begins working again with the revised token.
  2. 5-6 hours available over the next week.
  3. tbd
  4. n/a

@t-will-gillis
Copy link
Member

t-will-gillis commented Jan 20, 2023

  1. Progress: As of an hour ago, the HfLA GHA Move Closed Issues is working again. (yay) Thank you to whomever reset/updated the token/secrets. With the action running successfully this is confirmation that the alex-page/gihub-project-automation-plus@v0.8.1 automation is also working.

Please see the above notes for what I have done so far. What I would like to try now is to add a column "TEST-2592" to the project board, and a test file "TEST Pull Request Trigger 2592", then test on the HfLA website.

@MattPereira MattPereira added Status: Updated No blockers and update is ready for review and removed 2 weeks inactive An issue that has not been updated by an assignee for two weeks labels Jan 20, 2023
@jdingeman jdingeman reopened this Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation for manulal github board maintenance actions that are going to be automated Complexity: Medium Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly role: back end/devOps Tasks for back-end developers size: 2pt Can be done in 7-12 hours Status: Updated No blockers and update is ready for review time sensitive Needs to be worked on by a particular timeframe
Projects