Skip to content

ci(frontend): lint changed lines via eslint-plugin-diff#7822

Merged
talissoncosta merged 1 commit into
mainfrom
ci/frontend-lint-diff-only
Jun 19, 2026
Merged

ci(frontend): lint changed lines via eslint-plugin-diff#7822
talissoncosta merged 1 commit into
mainfrom
ci/frontend-lint-diff-only

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Changes

The Lint changed files job lints whole changed files. With the frontend's large pre-existing eslint backlog, touching any debt-laden file fails the PR on errors it never introduced — which nudges contributors toward project-wide npm run lint:fix (see #7733, where that swept ~21 unrelated files into the PR).

This switches the job to eslint-plugin-diff (plugin:diff/ci), which filters lint messages to the lines a PR changed:

  • No-op locally and in editors; active only under CI (the CI env var Actions sets).
  • Pure eslint + git — no GITHUB_TOKEN writes, so it works on fork PRs too.
  • Diff base is the PR base commit (ESLINT_PLUGIN_DIFF_COMMIT).
  • Errors block, warnings don't (unchanged).

The workflow step is now just npm run lint with that env var — no bespoke script, no third-party CI action.

How did you test this code?

Locally: with CI=true ESLINT_PLUGIN_DIFF_COMMIT=<base>, eslint reported only the appended error and ignored the pre-existing ones. This PR's CI run confirms the same in the Actions runner via the temp commit.

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Jun 19, 2026 11:48am
flagsmith-frontend-staging Ready Ready Preview, Comment Jun 19, 2026 11:48am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jun 19, 2026 11:48am

Request Review

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.59%. Comparing base (5266950) to head (2568f5e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7822   +/-   ##
=======================================
  Coverage   98.59%   98.59%           
=======================================
  Files        1467     1467           
  Lines       57332    57332           
=======================================
  Hits        56525    56525           
  Misses        807      807           

☔ 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.

@talissoncosta talissoncosta force-pushed the ci/frontend-lint-diff-only branch from 90139e7 to 96f6ac5 Compare June 18, 2026 12:28
@talissoncosta talissoncosta changed the title ci(frontend): lint changed lines instead of whole changed files ci(frontend): lint changed lines via eslint-plugin-diff Jun 18, 2026
@github-actions github-actions Bot added ci-cd Build, test and deployment related and removed ci-cd Build, test and deployment related labels Jun 18, 2026
@talissoncosta talissoncosta force-pushed the ci/frontend-lint-diff-only branch from 96f6ac5 to da0ab2a Compare June 18, 2026 12:30
@github-actions github-actions Bot added ci-cd Build, test and deployment related and removed ci-cd Build, test and deployment related labels Jun 18, 2026
@talissoncosta talissoncosta force-pushed the ci/frontend-lint-diff-only branch from da0ab2a to 18d625f Compare June 18, 2026 14:58
@github-actions github-actions Bot added ci-cd Build, test and deployment related and removed ci-cd Build, test and deployment related labels Jun 18, 2026
@talissoncosta talissoncosta marked this pull request as ready for review June 18, 2026 16:41
@talissoncosta talissoncosta requested review from a team as code owners June 18, 2026 16:41
@talissoncosta talissoncosta requested review from kyle-ssg and removed request for a team June 18, 2026 16:41
@talissoncosta talissoncosta requested review from Zaimwa9 and removed request for kyle-ssg June 18, 2026 16:42
@talissoncosta talissoncosta assigned Zaimwa9 and unassigned kyle-ssg and Zaimwa9 Jun 18, 2026
@github-actions github-actions Bot added ci-cd Build, test and deployment related and removed ci-cd Build, test and deployment related labels Jun 18, 2026
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-7822 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-7822 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7822 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7822 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-7822 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-e2e:pr-7822 Finished ✅ Skipped

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.5 seconds
commit  18d625f
info  🔄 Run: #17648 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  43.7 seconds
commit  18d625f
info  🔄 Run: #17648 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  40.5 seconds
commit  18d625f
info  🔄 Run: #17648 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  1 minute, 5 seconds
commit  18d625f
info  🔄 Run: #17648 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  33 seconds
commit  2568f5e
info  🔄 Run: #17672 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  43.9 seconds
commit  2568f5e
info  🔄 Run: #17672 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  54.1 seconds
commit  2568f5e
info  🔄 Run: #17672 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 10 seconds
commit  2568f5e
info  🔄 Run: #17672 (attempt 1)

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

The previous job linted whole changed files, so touching a file with the
frontend's pre-existing eslint backlog failed the PR on errors it never
introduced — pushing contributors toward project-wide `lint:fix` (see #7733).

eslint-plugin-diff's `plugin:diff/ci` config filters lint messages to lines
changed vs the PR base. It is a no-op locally and in editors, running only
under CI (the `CI` env var GitHub Actions sets). Pure eslint + git — no token —
so it works on fork PRs too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@talissoncosta talissoncosta merged commit d8727e0 into main Jun 19, 2026
38 of 39 checks passed
@talissoncosta talissoncosta deleted the ci/frontend-lint-diff-only branch June 19, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd Build, test and deployment related front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants