-
Notifications
You must be signed in to change notification settings - Fork 292
fix(config-brancher): preserve presubmit tests when using --skip-periodics #4837
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
base: main
Are you sure you want to change the base?
fix(config-brancher): preserve presubmit tests when using --skip-periodics #4837
Conversation
…odics The --skip-periodics option was incorrectly removing test definitions that were both periodic and presubmit (tests with both a cron/interval stanza and presubmit: true). This fix modifies the removePeriodics function to preserve these tests by removing only the periodic-related fields (Cron, Interval, MinimumInterval, ReleaseController, Presubmit) while keeping the test definition itself, so it continues to run as a presubmit job on the destination branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment |
WalkthroughExtended the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)**⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (2)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Comment |
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 fixes a bug in the config-brancher tool where the --skip-periodics option was incorrectly removing test definitions that served dual purposes (both periodic and presubmit). The fix ensures these tests are preserved as presubmit jobs on the destination branch by removing only their periodic-related fields.
Key Changes:
- Modified
removePeriodics()function to preserve tests that have both periodic and presubmit characteristics - Added comprehensive test coverage for the new branching behavior with dual-purpose tests
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/config-brancher/main.go | Updated removePeriodics() to preserve presubmit tests by clearing only periodic fields instead of removing the entire test definition |
| cmd/config-brancher/main_test.go | Added test case validating that dual-purpose tests are correctly preserved as presubmit-only tests when branching with --skip-periodics |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| test.Interval = nil | ||
| test.MinimumInterval = nil | ||
| test.ReleaseController = false | ||
| test.Presubmit = false |
Copilot
AI
Nov 20, 2025
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.
Setting Presubmit to false defeats the purpose of preserving presubmit tests. According to the PR description, these tests should continue to exist as presubmit jobs on the destination branch. This line should be removed to keep Presubmit: true.
| test.Presubmit = false |
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.
This stanza is only used when the job would otherwise be generated only as a periodic. Without any special stanzas, generating a presubmit job is the default behavior that does not need to be expliitly enabled.
|
Scheduling required tests: Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: petr-muller, Prucek 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 |
|
/hold I'd like to see what |
|
@petr-muller: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
The --skip-periodics option was incorrectly removing test definitions that were both periodic and presubmit (tests with both a cron/interval stanza and presubmit: true). This fix modifies the removePeriodics function to preserve these tests by removing only the periodic-related fields (Cron, Interval, MinimumInterval, ReleaseController, Presubmit)
while keeping the test definition itself, so it continues to exist as a presubmit job on the destination branch, and we do not leave such presubmit behind when we branch.
xref: openshift/release#70913 (comment)
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com