Repository navigation
Fix cr upload --pr with --packages-with-index - #682
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
Since the upload worktree was moved out of the release loop, package commits in the Pages worktree are published only with --push. With --pr, the commits are discarded with the temporary worktree and no pull request is created. With --push but without --packages-with-index, cr pushes the HEAD of the current directory to the Pages branch. Publish the package commits with either --push or --pr, and only when --packages-with-index created a commit. Signed-off-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Since #314 moved the push out of the release loop,
cr uploadpublishes the package commits in the Pages worktree only with--push. With--packages-with-index --pr, the commits are discarded with the temporary worktree and no pull request is created, while the command reports success. With--pushbut without--packages-with-index,cr uploadpushes theHEADof the current directory to the Pages branch.This PR:
commitPackagereport whether it created a commit. Identical replacements with--replace-existingstill create no commit.pushToPagesBranchwith either--pushor--pr, and only when--packages-with-indexcreated a commit. This avoids pushing the current directory and opening a pull request with no changes when every release is skipped.Fixes #681
Testing
TestReleaser_CreateReleasesPublishesPackagescovers--pushand--pr, with and without--packages-with-index. Before the fix, thepr-packages-with-indexandpush-without-packages-with-indexcases fail. After the fix, all cases pass.TestReplace*now checks that an identical replacement reports no commit.go vet ./...,go test ./...andgolangci-lint run(v2.14) pass.