Skip to content

ci: check a pull request against the base it merges into - #79

Merged
M4n0x merged 1 commit into
mainfrom
fix/ci-pr-base
Dec 3, 2026
Merged

M4n0x merged 1 commit into
mainfrom
fix/ci-pr-base

Conversation

@M4n0x

@M4n0x M4n0x commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Package

None, this changes CI only.

Changes

Lint's Check versions and Check one package per pull request steps diffed the checkout against github.event.pull_request.base.sha. The checkout is the pull request merged into the base branch, but base.sha can be an older commit. When a pull request is behind main, main's newer commits then count as part of the pull request.

#72 hit this. Its branch started at f76309e, main had since merged #64, and Lint failed with This pull request changes 2 packages: dev-servers, openvpn-connect although #72 only touches dev-servers.

Both steps now pass HEAD^1, the merge commit's first parent, which is the base the pull request merges into. The version check also reads earlier versions from that base, so it compares against everything main has published, not only what was there when the branch started.

Access

None.

Testing

  • Checked out feat: show Docker container names in Development servers #72's merge commit 0322c4e (parents 9e736a4 and 3fa9d69), the one CI ran on. ./scripts/check-one-package.sh f76309e reproduces the failure. ./scripts/check-one-package.sh HEAD^1 and ./scripts/check-versions.sh HEAD^1 pass.
  • Merged a change to dev-servers that keeps version 1.0.2 into main with --no-ff. ./scripts/check-versions.sh HEAD^1 still fails with packages/dev-servers changed but is still version 1.0.2.
  • actionlint passes on ci.yml.
  • Merges cleanly with ci: follow up on open community pull requests #78, which also changes ci.yml.

Claude Opus 5.5 via Claude Code


Summary by cubic

Fixes the CI version and one-package checks so they diff against the base the pull request actually merges into instead of base.sha, which can be older and caused main's newer commits to count as part of the pull request.

  • Both lint steps now pass HEAD^1, the merge commit's first parent, which is the base branch the pull request merges into.
  • The version check also reads previously published versions from that base, so it compares against everything main has published, not only what existed when the branch started.

Written for commit 0cbea1d. Summary will update on new commits.

View guided diff Turn on auto-fix

Summary by CodeRabbit

  • Chores
    • Pull-request checks for version and package-count changes now compare against the pull request’s base commit, helping ensure their results reflect the correct changes. This update affects automated validation only; it does not change the application’s features or behavior.

The version check and the one-package check diffed the merge checkout
against the event's base.sha, which can be older than the base branch
the pull request is merged into. A pull request behind main then counted
main's newer commits as its own, as #72 did with openvpn-connect. The
merge commit's first parent is the base it merges into.
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner December 3, 2026 15:36
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: CI Checks

Layer / File(s) Summary
Pass the first parent to both checks
.github/workflows/ci.yml
The version check and one-package-per-pull-request check receive HEAD^1 directly. A comment explains that the event base SHA can be stale.

Change: Bug fix

Merge Risk: Minimal · up to 0cbea

This CI-only change makes the version and one-package checks compare a pull request against the base branch it merges into, which avoids counting newer main commits as part of the PR. No merge-blocking risk was found.

Architecture risk: Low · up to 0cbea

For version and package-scope checks, the CI workflow now passes HEAD^1 instead of the event base SHA, so their comparisons use the merged pull request’s first parent rather than a potentially stale event value.

The CI workflow now supplies HEAD^1 to both validation scripts, so they calculate their comparisons from the merged pull request’s first parent rather than the potentially stale event base SHA.

Changed areas: None identified.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c497ba91-76f1-47c9-82fd-d05ac393a627
Commits

Reviewing files that changed from the base of the PR and between 9e736a4 and 0cbea1d.

Files selected for processing: 1

  • .github/workflows/ci.yml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

View guided diff | Turn on auto-fix | Re-trigger cubic

@M4n0x
M4n0x merged commit 45d52fc into main Dec 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant