Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/file-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ mdx_typecheckable: &mdx_typecheckable
- added|deleted|modified: 'static/app/components/core/**/*.{ts,tsx}'
- added|deleted|modified: 'static/**/__stories__/**/*.{ts,tsx}'

lintable_modified: &lintable_modified
- *sentry_frontend_workflow_file
- *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


lintable_rules_changed: &lintable_rules_changed
- *sentry_frontend_workflow_file
- *sentry_frontend_snapshots_workflow_file
- added|modified: 'package.json'
- added|modified: '.github/file-filters.yml'
- added|modified: '*.config.ts'
- added|modified: 'static/eslint/**/*.{ts,tsx,js,jsx,mjs}'

# Trigger to apply the 'Scope: Frontend' label to PRs
frontend_all: &frontend_all
- *sentry_frontend_workflow_file
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ jobs:
testable_rules_changed: ${{ steps.changes.outputs.testable_rules_changed }}
typecheckable_rules_changed: ${{ steps.changes.outputs.typecheckable_rules_changed }}
mdx_typecheckable: ${{ steps.changes.outputs.mdx_typecheckable }}
lintable_modified: ${{ steps.changes.outputs.lintable_modified }}
lintable_modified_files: ${{ steps.changes.outputs.lintable_modified_files }}
Comment thread
sentry-warden[bot] marked this conversation as resolved.
lintable_rules_changed: ${{ steps.changes.outputs.lintable_rules_changed }}
frontend_all: ${{ steps.changes.outputs.frontend_all }}
frontend_all_files: ${{ steps.changes.outputs.frontend_all_files }}
merge_base: ${{ steps.merge_base.outputs.merge_base }}
merge_base_strategy: ${{ steps.merge_base.outputs.merge_base_strategy }}
steps:
Expand Down Expand Up @@ -128,7 +132,15 @@ jobs:

- name: eslint
id: eslint
run: pnpm run lint:js
env:
LINTABLE_RULES_CHANGED: ${{ needs.files-changed.outputs.lintable_rules_changed }}
LINTABLE_MODIFIED_FILES: ${{ needs.files-changed.outputs.lintable_modified_files }}
run: |
if [[ "$GITHUB_EVENT_NAME" == "pull_request" && "$LINTABLE_RULES_CHANGED" == "false" ]]; then
pnpm run lint:js $LINTABLE_MODIFIED_FILES
else
pnpm run lint:js
fi

knip:
if: needs.files-changed.outputs.frontend_all == 'true'
Expand Down
Loading