Skip to content

OLM: calcluate commit ranges to ensure proper commitchecker bounding#77808

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
grokspawn:commit-checker-range-bounding
Apr 15, 2026
Merged

OLM: calcluate commit ranges to ensure proper commitchecker bounding#77808
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
grokspawn:commit-checker-range-bounding

Conversation

@grokspawn
Copy link
Copy Markdown
Contributor

@grokspawn grokspawn commented Apr 14, 2026

We have had a problem with the default commit calculations of commitchecker, when a commit was merged to our downstream main branch after a sync PR was created from an ancestor commit. This PR duplicates the solution here to address the issue.

The problem could yield cases where the range calculation would be erroneously calculated due to the diverged ancestry.
When this presented with a false positive (no errors) case that allowed a non-compliant PR to merge, a subsequent merge PR would fail due to our branching strategy where our downstream branch is really our upstream branch with carry|drop|pr conventions re-applied as necessary. A non-compliant merged PR would fail future checks as we attempted to determine what to do with it, requiring manual intervention/correction.

Given stale branch:

  main:   A --- B --- C --- D  (PULL_BASE_SHA)
           \
  PR:      E --- F --- G       (PULL_PULL_SHA)

After CI merge:

           A --- B --- C --- D
           \                  \
            E --- F --- G --- M  (HEAD = merge commit)

OLD computation for the merge commit range:

  • evaluates merge-base(M, D) = D (since D is parent of M)
  • git log --ancestry-path D..M
  • E, F, G are not descendants of D → excluded
  • Result: 0 commits evaluated = false positive

NEW computation (#67720):

  • merge-base(D, G) = A (common ancestor)
  • git log --ancestry-path A..G
  • E, F, G are descendants of A → included
  • Result: 3 commits validated = correct evaluation

This change should make openshift/build-machinery-go#114 unnecessary.

Summary by CodeRabbit

  • Chores
    • CI commit validation improved to explicitly compute the common merge-base and bound the checked commit range up to the pull request head.
    • Applied consistently across multiple release CI configurations to make PR commit checks more accurate and deterministic.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2843ff7a-a7b4-4b8b-8231-bdf8a023aeb5

📥 Commits

Reviewing files that changed from the base of the PR and between 0b57e5b and d5d23cb.

📒 Files selected for processing (4)
  • ci-operator/config/openshift/operator-framework-operator-controller/openshift-operator-framework-operator-controller-main.yaml
  • ci-operator/config/openshift/operator-framework-operator-controller/openshift-operator-framework-operator-controller-release-4.22.yaml
  • ci-operator/config/openshift/operator-framework-operator-controller/openshift-operator-framework-operator-controller-release-4.23.yaml
  • ci-operator/config/openshift/operator-framework-operator-controller/openshift-operator-framework-operator-controller-release-5.0.yaml
✅ Files skipped from review due to trivial changes (2)
  • ci-operator/config/openshift/operator-framework-operator-controller/openshift-operator-framework-operator-controller-release-4.22.yaml
  • ci-operator/config/openshift/operator-framework-operator-controller/openshift-operator-framework-operator-controller-release-4.23.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • ci-operator/config/openshift/operator-framework-operator-controller/openshift-operator-framework-operator-controller-main.yaml
  • ci-operator/config/openshift/operator-framework-operator-controller/openshift-operator-framework-operator-controller-release-5.0.yaml

Walkthrough

Four CI operator configuration YAMLs were changed to modify the verify-commits test step: the commitchecker invocation now computes the merge-base between the base and pull head refs and provides explicit --start (merge-base) and --end (pull head) arguments instead of a single --start value.

Changes

Cohort / File(s) Summary
CI Configuration Updates
ci-operator/config/openshift/operator-framework-operator-controller/...-main.yaml, ci-operator/config/openshift/operator-framework-operator-controller/...-release-4.22.yaml, ci-operator/config/openshift/operator-framework-operator-controller/...-release-4.23.yaml, ci-operator/config/openshift/operator-framework-operator-controller/...-release-5.0.yaml
Updated the verify-commits step command to compute --start as git merge-base ${PULL_BASE_SHA:-main} ${PULL_PULL_SHA:-HEAD} and explicitly pass --end "${PULL_PULL_SHA:-HEAD}", replacing the prior single --start ${PULL_BASE_SHA:-main} usage. Some files switch to a multiline shell block for the command.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 9 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions 'calcluate' (typo for 'calculate') and refers to commit range/commitchecker bounding, which aligns with the main objective, but the typo detracts from clarity. Correct the typo: change 'calcluate' to 'calculate' in the title for proper spelling and professionalism.
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed This PR modifies only CI/CD configuration YAML files without Ginkgo test definitions, making the check inapplicable.
Test Structure And Quality ✅ Passed The custom check for Ginkgo test structure and quality is not applicable to this pull request. The PR exclusively modifies YAML CI operator configuration files with no Go test files or Ginkgo test code changes.
Microshift Test Compatibility ✅ Passed This PR exclusively modifies CI operator YAML configuration files that define CI/CD pipeline steps, adjusting commitchecker command invocation parameters. No new Ginkgo e2e test code is introduced.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR modifies only CI operator configuration YAML files that adjust commitchecker command parameters using git merge-base. No Ginkgo e2e test code (It(), Describe(), Context(), When()) is added or modified, so the SNO compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only CI configuration test parameters for commitchecker utility; does not introduce topology-aware scheduling constraints or affect deployment manifests.
Ote Binary Stdout Contract ✅ Passed PR modifies only CI operator configuration YAML files with test step commands; no OTE binary code or test suite code is involved.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This pull request does not add any new Ginkgo e2e tests; changes are exclusively CI/CD configuration modifications to verify-commits test step commands.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 14, 2026
@grokspawn
Copy link
Copy Markdown
Contributor Author

/pj-rehearse auto-ack

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

@grokspawn: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

Signed-off-by: grokspawn <jordan@nimblewidget.com>
@grokspawn grokspawn force-pushed the commit-checker-range-bounding branch from 0b57e5b to d5d23cb Compare April 15, 2026 02:52
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@grokspawn: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
pull-ci-openshift-operator-framework-operator-controller-release-4.23-verify-commits openshift/operator-framework-operator-controller presubmit Ci-operator config changed
pull-ci-openshift-operator-framework-operator-controller-release-5.0-verify-commits openshift/operator-framework-operator-controller presubmit Ci-operator config changed
pull-ci-openshift-operator-framework-operator-controller-main-verify-commits openshift/operator-framework-operator-controller presubmit Ci-operator config changed
pull-ci-openshift-operator-framework-operator-controller-release-4.22-verify-commits openshift/operator-framework-operator-controller presubmit Ci-operator config changed
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

@grokspawn: The following tests 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/rehearse/openshift/operator-framework-operator-controller/release-4.23/verify-commits 0b57e5b link unknown /pj-rehearse pull-ci-openshift-operator-framework-operator-controller-release-4.23-verify-commits
ci/rehearse/openshift/operator-framework-operator-controller/main/verify-commits 0b57e5b link unknown /pj-rehearse pull-ci-openshift-operator-framework-operator-controller-main-verify-commits
ci/rehearse/openshift/operator-framework-operator-controller/release-5.0/verify-commits 0b57e5b link unknown /pj-rehearse pull-ci-openshift-operator-framework-operator-controller-release-5.0-verify-commits
ci/rehearse/openshift/operator-framework-operator-controller/release-4.22/verify-commits 0b57e5b link unknown /pj-rehearse pull-ci-openshift-operator-framework-operator-controller-release-4.22-verify-commits

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.

@grokspawn
Copy link
Copy Markdown
Contributor Author

rehearse won't work on this PR. It's attempting to compute for openshift/release
/pj-rehearse ack

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

@grokspawn: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot openshift-merge-bot bot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label Apr 15, 2026
@tmshort
Copy link
Copy Markdown
Contributor

tmshort commented Apr 15, 2026

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 15, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grokspawn, tmshort

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

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. lgtm Indicates that a PR is ready to be merged. rehearsals-ack Signifies that rehearsal jobs have been acknowledged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants