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

Adds workflow to update the status of a PR #1599

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

MarcelKoch
Copy link
Member

This PR adds a GH workflow to automatically update the review status of a PR within a GH project. It is assumed that a PR is only part of either 0 or 1 projects.

The status will be set from the following criteria:

  • >=1 changes-requested -> in-progress
  • >=2 approved -> ready-to-merge
  • >=1 reviews pending -> in-review

Compared to our current GH actions, this uses the graphQL api instead of the rest API. The new projects are not available with rest API so the graphQL API has to be used.

You can see an example of that in a PR in my repo MarcelKoch/gh-projects-playground#1 (maybe ignore the comments in there...) and the project https://github.com/users/MarcelKoch/projects/5. I think you can just add a review there, or add your self as reviewers, and then the project will be automatically updated.
Other than that, I'm not sure if this can be tested, due to our CI setup.

Todo:

  • more robust discovery of project id

@MarcelKoch MarcelKoch self-assigned this Apr 17, 2024
@MarcelKoch MarcelKoch added this to the Ginkgo 1.8.0 milestone Apr 17, 2024
@ginkgo-bot ginkgo-bot added the reg:ci-cd This is related to the continuous integration system. label Apr 17, 2024
@MarcelKoch MarcelKoch requested a review from a team April 17, 2024 15:25
@MarcelKoch MarcelKoch requested review from pratikvn and removed request for a team April 17, 2024 15:31
@MarcelKoch MarcelKoch requested review from pratikvn and removed request for pratikvn April 17, 2024 15:34
@MarcelKoch
Copy link
Member Author

Right now this will not work, because the bot token doesn't have the right permissions: https://github.com/ginkgo-project/ginkgo/actions/runs/8724752050/job/23936060577?pr=1599

@tcojean
Copy link
Member

tcojean commented Apr 17, 2024

Right now this will not work, because the bot token doesn't have the right permissions: https://github.com/ginkgo-project/ginkgo/actions/runs/8724752050/job/23936060577?pr=1599

Works now.

@MarcelKoch MarcelKoch requested review from pratikvn and removed request for pratikvn April 17, 2024 16:00
@MarcelKoch
Copy link
Member Author

yes thanks @tcojean. It already does work within this PR. Any is free to try it out, i.e. add reviewers, remove reviewers, approve, request changes, etc.

@MarcelKoch MarcelKoch modified the milestones: Ginkgo 1.8.0, Ginkgo 1.9.0 May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reg:ci-cd This is related to the continuous integration system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants