Skip to content

ci: annotate React Compiler lint failures#8149

Closed
joshblack wants to merge 3 commits into
mainfrom
annotate-react-lint-failures
Closed

ci: annotate React Compiler lint failures#8149
joshblack wants to merge 3 commits into
mainfrom
annotate-react-lint-failures

Conversation

@joshblack

Copy link
Copy Markdown
Member

This PR updates our React Compiler lint task so failures create file annotations in GitHub Actions.

Changelog

New

  • Add GitHub Actions error annotations with the file, line, column, and compiler failure.

Changed

  • Update the React Compiler CI task to remove Turbo log prefixes so GitHub can recognize workflow commands.

Removed

  • None.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; this is a change to our internal CI workflow and has no public-facing impact.

Testing & Reviewing

Reviewers can verify that:

  • A React Compiler failure creates an annotation on the affected source file.
  • The existing readable failure summary is still included in the job log.
  • The lint task continues to pass without annotations when all migrated files compile.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 018b5deb-5a44-48cd-9c8c-7bde56c04c0b
@joshblack joshblack added the skip changeset This change does not need a changelog label Jul 10, 2026
@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: feda022

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added the staff Author is a staff member label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. If this doesn't work, you can also use the original workflow here. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jul 10, 2026

@joshblack joshblack left a comment

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.

@copilot could we make it so that it runs on all files but that it will only error if a file that's not in the exclusion list fails? In addition, files that are not migrated should only emit an info or warning level event. Make sure that the info includes the detail and suggestion for how to fix it, when possible

…d failures

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@copilot could we make it so that it runs on all files but that it will only error if a file that's not in the exclusion list fails? In addition, files that are not migrated should only emit an info o...

Done in the latest commit. The script now:

  • Runs on all source files
  • Only sets process.exitCode = 1 (error) if a file that is not in the exclusion list fails
  • For files in the exclusion list (not yet migrated), emits ::notice annotations in GitHub Actions with the compiler error detail and a migration suggestion: "To migrate <file> to React Compiler, remove it from the exclusion list in script/react-compiler.mjs and fix the compiler errors above."
  • Also prints the same detail + suggestion to console for local runs
  • Handles parse errors (e.g. files with syntax issues like Overlay.figma.tsx) gracefully via try-catch so the script never crashes

@github-actions github-actions Bot temporarily deployed to storybook-preview-8149 July 10, 2026 16:46 Inactive

@joshblack joshblack left a comment

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.

@copilot actually instead of all files could it:

  • Find the list of changed files in the PR
  • Pass it along to the lint script
  • If there is no overlap, do nothing with the changed files
  • For files that intersect with the package, annotate them
  • If they are in the not migrated section, use a notice
  • If they are not in the not migrated section, use error

… non-migrated, errors for migrated

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@copilot actually instead of all files could it:

  • Find the list of changed files in the PR...

Done in the latest commit. Here's how it works now:

ci.yml — A new "Get changed files" step runs on PRs and merge queue events (github.base_ref != ''). It fetches the base branch and diffs against HEAD, storing the changed file paths in a step output. Those paths are passed to the lint task via CHANGED_FILES.

turbo.json — Added CHANGED_FILES to the lint:react-compiler env array so the turbo cache is invalidated when the file list changes between runs.

lint-react-compiler.ts — When CHANGED_FILES is set:

  • Resolves the paths to absolute and intersects them with the package's known TypeScript files
  • If no overlap → logs "No changed files overlap with @primer/react package. Skipping React Compiler check." and exits 0
  • For overlapping files in the exclusion list (not yet migrated) → ::notice annotation with the error detail and migration suggestion
  • For overlapping files not in the exclusion list (migrated) → ::error annotation + exits 1

When CHANGED_FILES is not set (local runs, push to main) → original behavior: checks all migrated files for errors.

@joshblack joshblack closed this Jul 10, 2026
@joshblack joshblack deleted the annotate-react-lint-failures branch July 10, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm skip changeset This change does not need a changelog staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants