Skip to content

ci: lint changed files against PR merge base#3265

Merged
nkaradzhov merged 1 commit into
redis:masterfrom
PavelPashov:ci/lint-changed-merge-base
May 11, 2026
Merged

ci: lint changed files against PR merge base#3265
nkaradzhov merged 1 commit into
redis:masterfrom
PavelPashov:ci/lint-changed-merge-base

Conversation

@PavelPashov
Copy link
Copy Markdown
Contributor

@PavelPashov PavelPashov commented May 11, 2026

Description

Describe your pull request here


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

Note

Low Risk
Low risk CI scripting change; main impact is which files get linted on PRs and it could fail if PR SHAs or git history aren’t available as expected.

Overview
Updates the PR lint job to use a full git checkout (fetch-depth: 0) so merge-base comparisons can be computed reliably.

Changes scripts/lint-changed.mjs to determine changed files on PRs using the GitHub event’s base and head SHAs and a merge-base diff (base...head), ensuring only PR-introduced files are linted; it also now ensures both commits are present locally before diffing.

Reviewed by Cursor Bugbot for commit e6fbc01. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit e6fbc01. Configure here.

Comment thread scripts/lint-changed.mjs
}

function changedFilesBetween(base, head) {
// actions/checkout uses a shallow checkout, so the PR base commit often is
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shallow fetch incompatible with three-dot merge-base diff

Low Severity

The ensureCommitAvailable fallback fetch uses --depth=1, which only retrieves the commit object itself. The new three-dot diff syntax (${base}...${head}) requires git to compute the merge-base by traversing commit history from both refs to a common ancestor. If ensureCommitAvailable actually needs to fetch (i.e., a commit isn't already present), the --depth=1 fetch won't provide enough history for git merge-base to succeed, causing the git diff call to fail. CI is unaffected due to fetch-depth: 0, but the --base flag path for local reproduction is broken in this scenario.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e6fbc01. Configure here.

@nkaradzhov nkaradzhov merged commit 3058cac into redis:master May 11, 2026
30 of 31 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.

2 participants