Skip to content

Lint the PR's own diff, not the release branch's divergence from master - #3882

Merged
OrangeAndGreen merged 2 commits into
masterfrom
fix-super-linter-diff-base-branch
Aug 27, 2026
Merged

Lint the PR's own diff, not the release branch's divergence from master#3882
OrangeAndGreen merged 2 commits into
masterfrom
fix-super-linter-diff-base-branch

Conversation

@OrangeAndGreen

@OrangeAndGreen OrangeAndGreen commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Point DEFAULT_BRANCH at github.base_ref so the diff base is the branch the PR actually targets.

Super-linter picks its file set with a two-dot diff against DEFAULT_BRANCH,
which was hardcoded to master. For a PR based on a release branch that means
the file set is the whole master-to-release-branch divergence rather than the
files the PR touches: PR #3881 changes 4 Kotlin files but got 144 linted,
including master-only files that don't exist on the branch and are logged as
"exists in commit data, but not found on file system, skipping...".

The result is that every PR based on commcare_2.64 fails the Kotlin lint job
on pre-existing violations it did not introduce and cannot fix in scope. #3880
and #3877 both fail it, with passing Builds.

Pointing DEFAULT_BRANCH at github.base_ref makes the diff base the branch the
PR actually targets. No change for PRs into master, where base_ref is master.
@OrangeAndGreen OrangeAndGreen added automation github_actions Pull requests that update GitHub Actions code labels Aug 25, 2026
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 534c8dc3-6fab-4256-9996-1cebb18677e4

📥 Commits

Reviewing files that changed from the base of the PR and between aef4da2 and 20370a4.

📒 Files selected for processing (1)
  • .github/workflows/linter.yml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The linter workflow now sets DEFAULT_BRANCH from github.base_ref. Super-Linter therefore compares changed files against the pull request’s target branch instead of always comparing against master.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 20370

This localized workflow change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Suggested reviewers: shubham1g5

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description states the implementation change but omits the required technical rationale, safety story, automated test coverage, and Labels and Review information. Add the required sections from the repository template. Include the ticket or design document, explain the rationale and branch-selection behavior, describe validation and safety considerations, identify automated test coverage, and complet…
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly states the main workflow change and the problem it fixes: linting the pull request diff instead of unrelated divergence from master.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Full details: Description check

Resolution

Add the required sections from the repository template. Include the ticket or design document, explain the rationale and branch-selection behavior, describe validation and safety considerations, identify automated test coverage, and complete the Labels and Review checklist.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-super-linter-diff-base-branch

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.

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.95%. Comparing base (bc5cd55) to head (2c46063).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3882      +/-   ##
============================================
- Coverage     33.04%   32.95%   -0.10%     
+ Complexity     5864     5854      -10     
============================================
  Files           999      999              
  Lines         59398    59398              
  Branches       7093     7093              
============================================
- Hits          19628    19573      -55     
- Misses        37528    37586      +58     
+ Partials       2242     2239       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

shubham1g5
shubham1g5 previously approved these changes Aug 26, 2026

@shubham1g5 shubham1g5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great to see this fixed!

Comment on verbosity: we can remove the comment and the complete PR description here as both of them do not provide extra context other than code diff and can be omitted without sacrificing correctness or context.

@OrangeAndGreen
OrangeAndGreen merged commit 2d10198 into master Aug 27, 2026
7 checks passed
@OrangeAndGreen
OrangeAndGreen deleted the fix-super-linter-diff-base-branch branch August 27, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants