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

Tag Boost milestones #41470

Closed
wants to merge 6 commits into from
Closed

Tag Boost milestones #41470

wants to merge 6 commits into from

Conversation

haqadn
Copy link
Contributor

@haqadn haqadn commented Jan 31, 2025

Proposed changes:

  • This is a github workflow specifically for Boost. Tag any PR that doesn't have a milestone with "boost/next" on merge.

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:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

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

@haqadn haqadn marked this pull request as draft January 31, 2025 15:49
@github-actions github-actions bot added the Actions GitHub actions used to automate some of the work around releases and repository management label Jan 31, 2025
Copy link
Contributor

github-actions bot commented Jan 31, 2025

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions bot added the OSS Citizen This Pull Request was opened by an Open Source contributor. label Jan 31, 2025
@haqadn haqadn removed the OSS Citizen This Pull Request was opened by an Open Source contributor. label Jan 31, 2025
@haqadn haqadn self-assigned this Jan 31, 2025
@haqadn haqadn requested a review from a team January 31, 2025 17:15
@haqadn haqadn added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Status] Needs Team Review [Type] Janitorial and removed [Status] In Progress labels Jan 31, 2025
@haqadn haqadn marked this pull request as ready for review January 31, 2025 17:22
@haqadn haqadn requested a review from a team January 31, 2025 19:09
Copy link
Contributor

@anomiex anomiex left a 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
Copy link
Contributor

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
Copy link
Contributor

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

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bash syntax

Suggested change
if [ "$milestone" = "null" ] || [ -z "$milestone" ]; then
if [[ "$milestone" = "null" || -z "$milestone" ]]; then

@anomiex
Copy link
Contributor

anomiex commented Jan 31, 2025

CC @jeherve for expertise on the repo-gardening action.

@jeherve
Copy link
Member

jeherve commented Feb 3, 2025

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?

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.

@jeherve jeherve added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [Pri] Normal and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Status] Needs Team Review labels Feb 3, 2025
@jeherve jeherve added [Plugin] Boost A feature to speed up the site and improve performance. and removed [Type] Janitorial labels Feb 3, 2025
@haqadn
Copy link
Contributor Author

haqadn commented Feb 3, 2025

Thank you for pointing out projects/github-actions/repo-gardening/src/tasks/add-milestone. I am closing this PR and will follow up with one that leverages the existing workflow.

@haqadn haqadn closed this Feb 3, 2025
@github-actions github-actions bot removed the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions GitHub actions used to automate some of the work around releases and repository management [Plugin] Boost A feature to speed up the site and improve performance. [Pri] Normal [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants