-
-
Notifications
You must be signed in to change notification settings - Fork 108
feat: Add flag to clean git working branches with no changes #6488
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
Conversation
Signed-off-by: Olblak <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the SCM push logic by centralizing it in a new finalizeSCMUpdates function. The push operation is moved from individual target execution to a dedicated finalization step that runs after all pipelines complete.
- Removed target-level push execution and migrated to centralized SCM finalization
- Introduced
PushCommits()method on Target to handle individual target push operations - Removed unused
CommitandCleanfields from the Target struct
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| pkg/core/pipeline/target/main.go | Removed Commit and Clean fields, simplified Run() to defer push operations, added PushCommits() method |
| pkg/core/engine/scm.go | Added finalizeSCMUpdates() function to centralize push operations across all pipelines and SCMs |
| pkg/core/engine/run.go | Integrated finalizeSCMUpdates() call into engine execution flow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix #2801
Fix #6199
This pull request add a new flag on the apply command to delete working git branches with no changes
This pull request changes the moment the git push are done.
Instead of pushing commits after each target execution, we now collect them to push them only once once all target have been processed and just before actions.
This brings multiple benefits
Test
To test this pull request, you can run the following commands:
Additional Information
Checklist
Tradeoff
Even though, I would prefer cleaning working branches by default, I am concerned about edge cases where someone could accidently delete an unexpected branch so I prefer to go extra safe on this
Potential improvement