Skip to content

fix(ci): compare repository checks against the tested merge's target - #2591

Merged
Quick104 merged 1 commit into
mainfrom
fix/ci-repo-checks-tested-base
Oct 16, 2026
Merged

Quick104 merged 1 commit into
mainfrom
fix/ci-repo-checks-tested-base

Conversation

@Quick104

@Quick104 Quick104 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #2404
Related issue: N/A
Validation tasks: none

Pull requests fail the size-ratchet check on files they never touched. On a pull request, the size-ratchet and migration checks run on the merge with the target's current tip, but they compare it with github.event.pull_request.base.sha. That SHA can be older than the tip, so every file the target grew since then counts as the PR's change. #1661 changes two internal/blobstore files, and its latest run failed on eight others, among them internal/recommendations/worker.go (572 → 1,546 lines), which grew on main.

This is the bug #2404 reported for Go lint. #2521 fixed it there by comparing with the merge commit's first parent; the two checks #2522 added still used the payload SHA.

Approach

Both steps now set BASE_REF to origin/<target branch>. Their make targets already take git merge-base "$BASE_REF" HEAD, which for a tested merge is the commit the PR was merged onto, even if the target moved again after the merge was built. The contract checks already compare this way. Push runs keep comparing with the default branch, as before.

Validation

  • Replayed fix(blobstore): honour cancellation while DeletePrefix removes files #1661 locally: merged its head into current main and ran make verify-size-ratchet. With the payload base it fails on files from main; with origin/main it passes.
  • Positive control: a branch that adds a 1,006-line Go file, merged onto a newer main, still fails with 0 -> 1006 lines crosses limit 1000.
  • actionlint 1.7.12 passes on the workflow.
  • This PR's own checks run trusted-linux-ci.yml from main, so they do not exercise this change. It takes effect for pull requests after merge.

Evidence

Evidence: none, no user-visible change

Risks

None identified. The checkout in this job already fetches full history and every branch, so origin/<target branch> is always present.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code, run inside T3 Code
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: n/a

🤖 Generated with Claude Code

Note

Fix trusted CI merge-base to compare against the target branch ref

Changes BASE_REF in the file line limits / bidi controls and migration verification steps from the pull request payload's base SHA to origin/<target branch> via github.base_ref, falling back to the default branch for non-PR runs. This avoids computing the merge base against an outdated payload SHA in trusted-linux-ci.yml. Behavioral Change: PR runs now fetch the target branch ref before the merge-base calculation instead of trusting the payload's base commit SHA.

Macroscope summarized 3a08c3a.

A pull request's size-ratchet and migration checks compared its merge
commit with the payload's base.sha. That SHA can be older than the
target tip the merge was built on, so a PR opened before main moved
was charged with every file main grew since. #1661 failed the size
ratchet on eight files it never touched.

Both steps now pass origin/<target branch>, and the make targets take
its merge base with HEAD, which is the commit the PR was merged onto.
The contract checks already compare this way, and Go lint uses the
merge commit's first parent since #2521.

Closes #2404

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Oct 16, 2026
@silo-kody

silo-kody Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 1 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers

@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 15 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 27c12988-c56b-49b6-8ba3-25f76df052b8
📥 Commits

Reviewing files that changed from the base of the PR and between c414af7 and 3a08c3a.

📒 Files selected for processing: 1
  • .github/workflows/trusted-linux-ci.yml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@silo-triage silo-triage Bot added bug Something isn't working priority: P2 Limited scope, workaround exists, or polish triaged High-confidence review completed; does not mean fixed, validated, or accepted for release. labels Oct 16, 2026
@Quick104
Quick104 merged commit 4372e1e into main Oct 16, 2026
20 checks passed
@Quick104
Quick104 deleted the fix/ci-repo-checks-tested-base branch October 16, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: P2 Limited scope, workaround exists, or polish size/S 0–49 added + deleted lines (all files); change volume, not priority. triaged High-confidence review completed; does not mean fixed, validated, or accepted for release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI lint includes newer main changes in old PR diffs

1 participant