fix: create new downstream branches from last minor release instead of next - #955
divyansh42 wants to merge 2 commits into
Conversation
|
Need to test this manually. |
|
/hold |
I have test it and it is working fine. |
…f next When a target branch does not exist in a downstream repo, it was previously created from origin/next. New release branches now source from the immediate predecessor release-vX.(Y-1).x instead. If no release branches exist on the remote at all, the component is treated as newly onboarded and next is used as the source. Any other missing predecessor is a hard failure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a1fb035 to
0e015c5
Compare
|
@pramodbindal I have resolved the comment, can you please check now? |
| // Previous release branch not found. Check whether any release branches | ||
| // exist on the remote. If none do, this is a new component being onboarded | ||
| // and we fall back to next as the source. | ||
| out, err = run(ctx, dir, "git", "ls-remote", "--heads", "origin", "release-v*.x") |
There was a problem hiding this comment.
git ls-remote --heads origin release-v*.x
when i run this command on a repo i get " no matches found: release-v*.x"
There was a problem hiding this comment.
@pramodbindal could you. please try as:
> git ls-remote --heads upstream 'release-v*.x'
0c08df6897356ae4aedfaf2914711fa742378146 refs/heads/release-v0.50.x
486a77680dc9b5b0b7d11e697ac72e51ed80c029 refs/heads/release-v0.51.x
86c7ea53e17200b9ae6fc6ec708aacf96533660b refs/heads/release-v0.52.x
run() uses exec.Command directly, so the argument is passed to git as a literal string
quoting the pattern ('release-v*.x') fixes it in the shell
| minor, _ := strconv.Atoi(m[2]) | ||
|
|
||
| prev := fmt.Sprintf("release-v%d.%d.x", major, minor-1) | ||
| out, err := run(ctx, dir, "git", "ls-remote", "--heads", "origin", prev) |
There was a problem hiding this comment.
This will work until major version does not change.
when major version changes then minor becomes 0 and prev becomes -1
i would suggest to handle that case as well
There was a problem hiding this comment.
@pramodbindal in the case shall I throw the error? as few other changes might also be required? or should i create the branch for last minor release. i.e major-1.Y.x
Y will be the last minor release of the previous version.
|
Please Add the documentation as well. A Readme update should be fine |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
origin/next(fallback:origin/main), causing new release branches to inherit unreleased contentpreviousReleaseBranch()to find the highestrelease-vX.Y.xbranch strictly older than the target and sources the new branch from thereTest plan
generate-konfluxfor a new release version where the downstream branch does not yet existrelease-v1.16.xsources fromrelease-v1.15.x)🤖 Generated with Claude Code