🐛 Don't delete branch twice#55
Merged
openshift-merge-bot[bot] merged 1 commit intoJul 4, 2025
Merged
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cardil The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
2170a3e to
6591ce5
Compare
|
New changes are detected. LGTM label has been removed. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds an option to skip deleting a branch when pushing, and updates related calls, CLI argument handling, and logging output.
- Introduces a
pushOpttype andskipDeleteOnPushinpushBranch. - Propagates the new option through
resync_releasesandmirror_release. - Updates CLI for
synccommand to accept an optional project directory and silences usage messages; fixes buffer logging to usestring(buff).
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/sync/sync_release_next.go | Added pushOpt, skipDeleteOnPush, and updated pushBranch signature |
| pkg/sync/resync_releases.go | Passed skipDeleteOnPush into pushBranch |
| pkg/sync/mirror_release.go | Added skipDelete flag and conditional delete step |
| pkg/sync/create_pr.go | Changed buffer print to string(buff) |
| internal/cmd/sync.go | Made project-dir an optional argument and updated Use/Args |
| internal/cmd/root.go | Set SilenceUsage = true in a persistent pre-run hook |
Comments suppressed due to low confidence (2)
internal/cmd/sync.go:20
- The
ValidArgslist still refers toREPOSITORYbut the command now accepts an optionalproject-dir. Consider updating or removingValidArgsto reflect the new usage.
ValidArgs: []string{"REPOSITORY"},
pkg/sync/mirror_release.go:83
- There isn’t currently a test verifying that
skipDeleteOnPushprevents the delete step. Consider adding a unit test for this new behavior.
if !p.skipDelete {
532729d
into
openshift-knative:main
4 checks passed
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.
/kind bug
Closes #42