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

ci: Automatically tag project releases #34261

Merged
merged 1 commit into from
Nov 29, 2023
Merged

Conversation

anomiex
Copy link
Contributor

@anomiex anomiex commented Nov 22, 2023

Proposed changes:

This will automatically create tags like "packages/autoloader@3.0.2" or "plugins/jetpack@12.9" as projects are released.

The logic used is similar to the autotagger: on push to trunk or prerelease for projects without a release-branch-prefix and on push to corresponding release branches for projects with a release-branch-prefix, if the /changelog/ directory for the project is empty and the first entry in CHANGELOG.md is a release version number, it'll create the corresponding tag for the project.

Note that when this is first merged, it'll probably create a bunch of tags incorrectly pointing to that commit for things that were recently released and haven't been bumped since. We'll have to fix those manually. We'll also have to manually create tags for all the previous releases if we want them. A list of tags and what I could find for corresponding commits is here: tags.tsv

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

Fixes https://github.com/Automattic/garage-backlog/issues/23

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Merge this into a fork, push various commits, and see what happens.

This will automatically create tags like "packages/autoloader@3.0.2" or
"plugins/jetpack@12.9" as projects are released.

The logic used is similar to the autotagger: on push to trunk or
prerelease for projects without a release-branch-prefix and on push to
corresponding release branches for projects with a
release-branch-prefix, if the `/changelog/` directory for the project is
empty and the first entry in CHANGELOG.md is a release version number,
it'll create the corresponding tag for the project.
@anomiex anomiex added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Type] Feature Request [Pri] Normal labels Nov 22, 2023
@anomiex anomiex self-assigned this Nov 22, 2023
@github-actions github-actions bot added the Actions GitHub actions used to automate some of the work around releases and repository management label Nov 22, 2023
Copy link
Contributor

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 a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ 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.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.

@anomiex
Copy link
Contributor Author

anomiex commented Nov 22, 2023

BTW, in case anyone is interested, I created that tags.tsv like this:

  • The list of possible tags is from checking out all the mirror repos and looking at the tags. 😀
  • Where the tagged commit includes the "Committed via a GitHub action" line and the linked run still exists, I read the corresponding commit from that.
  • Where it included that line but the linked workflow run no longer exists (I guess GH deletes old runs), I looked for an exact match to the commit summary.

@anomiex anomiex requested a review from a team November 29, 2023 16:01
Copy link
Contributor

@sdixon194 sdixon194 left a comment

Choose a reason for hiding this comment

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

Let's give this a go 👍

@sdixon194 sdixon194 added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Nov 29, 2023
@anomiex
Copy link
Contributor Author

anomiex commented Nov 29, 2023

  • Tags created for backlog.

@anomiex anomiex merged commit 73ec238 into trunk Nov 29, 2023
52 checks passed
@anomiex anomiex deleted the add/monorepo-autotagger branch November 29, 2023 17:58
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Nov 29, 2023
@sdixon194
Copy link
Contributor

Screenshot 2023-11-29 at 1 11 30 PM

:D

@anomiex
Copy link
Contributor Author

anomiex commented Nov 29, 2023

😀

I wound up creating 3504 tags total: the ones in the tsv linked above, plus tags for two releases since I created that, plus I matched up old tags like "1.1" and "automattic/jetpack-assets@1.0.0". 750 potential tags I didn't have a commit to match them with.

pdWQjU-D3-p2

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 [Pri] Normal [Type] Feature Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants