Skip to content

ci: Run ESLint only on changed files in a PR#116660

Merged
ryan953 merged 3 commits into
masterfrom
ryan953/frontend-ci-eslint-named-files
Jun 2, 2026
Merged

ci: Run ESLint only on changed files in a PR#116660
ryan953 merged 3 commits into
masterfrom
ryan953/frontend-ci-eslint-named-files

Conversation

@ryan953
Copy link
Copy Markdown
Member

@ryan953 ryan953 commented Jun 2, 2026

During a PR CI run, only run ESLint against the files that were changed.
The step will, as before, only run if some frontend_all files were detected in the PR. It'll pass all those filenames to eslint to work on.
The matcher for those files is: https://github.com/getsentry/sentry/blob/master/.github/file-filters.yml#L43-L48


The CI run for this PR proves that it works well:

Run pnpm run lint:js .github/workflows/frontend.yml

> sentry@0.0.0 lint:js /home/runner/work/sentry/sentry
> eslint --concurrency=3 .github/workflows/frontend.yml


/home/runner/work/sentry/sentry/.github/workflows/frontend.yml
  0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to disable file ignore settings or use "--no-warn-ignored" to suppress this warning

✖ 1 problem (0 errors, 1 warning)

ESLint got the list of files (just the one file) and tried to run. Nothing to do this time because it's a *.yml, we're happy the triggers and file list are being passed along correctly.

@ryan953 ryan953 requested a review from a team as a code owner June 2, 2026 03:10
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

📊 Type Coverage Diff

✅ no issues found

Comment thread .github/workflows/frontend.yml Outdated
Comment thread .github/workflows/frontend.yml Outdated
Comment thread .github/workflows/frontend.yml
Comment thread .github/workflows/frontend.yml Outdated
@ryan953 ryan953 force-pushed the ryan953/frontend-ci-eslint-named-files branch from 991db6c to 0c94149 Compare June 2, 2026 15:53
Copy link
Copy Markdown
Contributor

@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

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0c94149. Configure here.

Comment thread .github/file-filters.yml
- *sentry_frontend_snapshots_workflow_file
- added|modified: '**/*.{ts,tsx,js,jsx,mjs}'
- added|modified: 'static/**/*.{less,json,yml,md,mdx}'
- added|modified: '{vercel,tsconfig,biome,package}.json'
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.

New lintable_modified filter duplicates frontend_all exactly

Low Severity

The lintable_modified filter (lines 42–47) is byte-for-byte identical to the frontend_all filter (lines 58–63). This means lintable_modified_files and frontend_all_files always produce the same file list. If either filter is updated in the future without updating the other, they'd silently diverge, leading to subtle bugs. Additionally, the frontend_all_files output (line 35) and the lintable_modified boolean output (line 31) are both defined but never consumed by any downstream job. The eslint step could simply use frontend_all_files directly, avoiding the duplicate filter entirely.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0c94149. Configure here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this'll improve/change over time. better to have the name in place now imo

@ryan953 ryan953 requested review from a team June 2, 2026 16:05
@ryan953 ryan953 merged commit 5c59d63 into master Jun 2, 2026
73 checks passed
@ryan953 ryan953 deleted the ryan953/frontend-ci-eslint-named-files branch June 2, 2026 16:28
@ryan953 ryan953 added the Trigger: Revert Add to a merged PR to revert it (skips CI) label Jun 2, 2026
@getsentry-bot
Copy link
Copy Markdown
Contributor

PR reverted: 2d296b1

getsentry-bot added a commit that referenced this pull request Jun 2, 2026
This reverts commit 5c59d63.

Co-authored-by: ryan953 <187460+ryan953@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components Trigger: Revert Add to a merged PR to revert it (skips CI)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants