Skip to content

fix(config-brancher): preserve presubmit tests when using --skip-periodics#4837

Open
petr-muller wants to merge 1 commit intoopenshift:mainfrom
petr-muller:fix-config-brancher-skip-periodics-presubmit
Open

fix(config-brancher): preserve presubmit tests when using --skip-periodics#4837
petr-muller wants to merge 1 commit intoopenshift:mainfrom
petr-muller:fix-config-brancher-skip-periodics-presubmit

Conversation

@petr-muller
Copy link
Copy Markdown
Member

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

Copilot AI review requested due to automatic review settings November 20, 2025 09:33
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repository is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. Review these jobs and use /test <job> to manually trigger optional jobs most likely to be impacted by the proposed changes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 20, 2025

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0c61b618-3f43-406f-ad17-a54815ffc13c

📥 Commits

Reviewing files that changed from the base of the PR and between 33202fd and a6426fb.

📒 Files selected for processing (2)
  • cmd/config-brancher/main.go
  • cmd/config-brancher/main_test.go
✅ Files skipped from review due to trivial changes (1)
  • cmd/config-brancher/main_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • cmd/config-brancher/main.go

Walkthrough

Updated removePeriodics in cmd/config-brancher to keep tests that are both periodic and presubmit by clearing periodic scheduling fields (Cron, Interval, MinimumInterval, ReleaseController) and setting Presubmit to false; purely periodic tests are removed. Added a test verifying skip-periodics behavior and branch/promotion updates.

Changes

Cohort / File(s) Summary
Config-brancher logic & tests
cmd/config-brancher/main.go, cmd/config-brancher/main_test.go
Adjusted removePeriodics to preserve tests that are both periodic and presubmit by stripping periodic fields and unsetting Presubmit; removed purely periodic tests. Added a test case ensuring periodic-only tests are removed, mixed tests keep As but lose periodic fields, promotion target updates, and branch metadata updates when skipPeriodics: true.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a 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
Copy link

Copilot AI Nov 20, 2025

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.

Suggested change
test.Presubmit = false

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

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.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 20, 2025
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test integration-optional-test

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Nov 20, 2025

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 20, 2025
@petr-muller
Copy link
Copy Markdown
Member Author

/hold

I'd like to see what breaking-changes shows. I expect this to add some jobs to o/release that were previously skipped.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 20, 2025
@openshift-bot
Copy link
Copy Markdown
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci Bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 19, 2026
@openshift-bot
Copy link
Copy Markdown
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci Bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 22, 2026
@petr-muller
Copy link
Copy Markdown
Member Author

/remove-lifecycle rotten

@openshift-ci openshift-ci Bot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Apr 9, 2026
…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>
@petr-muller petr-muller force-pushed the fix-config-brancher-skip-periodics-presubmit branch from 33202fd to a6426fb Compare April 9, 2026 18:59
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 9, 2026

New changes are detected. LGTM label has been removed.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification

No second-stage tests were triggered for this PR.

This can happen when:

  • The changed files don't match any pipeline_run_if_changed patterns
  • All files match pipeline_skip_if_only_changed patterns
  • No pipeline-controlled jobs are defined for the main branch

Use /test ? to see all available tests.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 9, 2026

@petr-muller: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/breaking-changes a6426fb link false /test breaking-changes

Full PR test history. Your PR dashboard.

Details

Instructions 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants