-
Notifications
You must be signed in to change notification settings - Fork 808
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
Tag Boost milestones #41470
Tag Boost milestones #41470
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Boost plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have milestone-related logic in projects/github-actions/repo-gardening/src/tasks/add-milestone/
. Can we extend that to handle "next" milestones instead of making a whole separate action for it?
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actions/checkout is up to v4 by now.
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REPO: ${{ github.repository }} | ||
run: | | ||
if ! gh api repos/${REPO}/milestones --jq '.[] | select(.title=="'"$MILESTONE_NAME"'")' | grep -q "$MILESTONE_NAME"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be done a bit more cleanly as something like
if ! gh api repos/${REPO}/milestones --jq '.[] | select(.title=="'"$MILESTONE_NAME"'")' | grep -q "$MILESTONE_NAME"; then | |
if ! gh api "repos/${REPO}/milestones" | jq -e --arg NAME "$MILESTONE_NAME" '.[] | select( .title == $NAME )' &>/dev/null; then |
Using jq
's -e
saves having to grep
, and --arg
saves having to worry about quotes in the variable when trying to embed it in the jq filter string.
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
run: | | ||
milestone=$(gh pr view ${PR_NUMBER} --json milestone --jq '.milestone.title') | ||
if [ "$milestone" = "null" ] || [ -z "$milestone" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bash syntax
if [ "$milestone" = "null" ] || [ -z "$milestone" ]; then | |
if [[ "$milestone" = "null" || -z "$milestone" ]]; then |
CC @jeherve for expertise on the repo-gardening action. |
That would be my suggestion as well. I don't think we need another workflow, we should be able to leverage what we have instead. |
Thank you for pointing out |
Proposed changes:
The intended use for this is to include maintenance PRs in the milestone which may only be included if the PR is merged before a release. While releasing, the milestone is renamed to
boost/x.y.z
.Other information:
Jetpack product discussion
None
Does this pull request change what data or activity we track or use?
None
Testing instructions:
Since it's a github workflow, the only way to test it would be either after this is merged or on a forked repository. I have tested it in a fork: https://github.com/haqadn/jetpack/actions/runs/13077207694/job/36492217161?pr=5