jerryshao opened a new pull request, #13501:
URL: https://github.com/apache/gravitino/pull/13501

   ### What changes were proposed in this pull request?
   
   Add a `pull_request_target` workflow `label-fix-version.yml` that runs when 
a PR is merged into any branch:
   
   1. Collect linked issues from `[#N]` in the PR title and from the PR's 
closing keywords (e.g. `Fix: #N`). PRs without a linked issue are skipped.
   2. Resolve the fix version from the base branch's `gradle.properties` by 
stripping `-SNAPSHOT`, e.g. main `2.0.0-SNAPSHOT` -> `2.0.0`. Since the release 
script bumps to the next SNAPSHOT right after tagging an RC, if a release on 
the same minor line has an RC tag but no final tag, that release is used 
instead, e.g. branch-1.3 `1.3.2-SNAPSHOT` with only `v1.3.1-rc2` -> `1.3.1`.
   3. Add the version label (following the existing `x.y.z` / `Release vx.y.z` 
convention, created if missing) to each linked issue.
   4. Assign the issue to the PR author if it has no assignee. Bot authors 
(e.g. auto cherry-pick PRs) are skipped.
   
   The workflow never checks out PR code and passes PR-controlled values 
through `env`, so `pull_request_target` is safe here. It only uses `gh`, no 
third-party actions.
   
   ### Why are the changes needed?
   
   Today the fix version of an issue has to be labeled manually, which is easy 
to miss, especially for fixes cherry-picked to release branches. With this, 
each issue carries one label per release it ships in (e.g. `2.0.0` and 
`1.3.1`), which makes release notes and backport tracking easier.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Dry-ran the script locally against real PRs with the write calls stubbed:
   - #13398 (main) -> labels #13397 with `2.0.0`
   - #13494 (cherry-pick to branch-1.3) -> labels #13452 with `1.3.1`
   - #13497 (`[MINOR]`, no issue) -> skipped
   - branch-1.2 -> `1.2.2`
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to