Skip to content

Skip TS CI for PRs without TS-related changes#3991

Open
alco wants to merge 2 commits intomainfrom
alco/ts-ci-on-release-pr
Open

Skip TS CI for PRs without TS-related changes#3991
alco wants to merge 2 commits intomainfrom
alco/ts-ci-on-release-pr

Conversation

@alco
Copy link
Member

@alco alco commented Mar 10, 2026

Summary

  • Adds a lightweight check_ts_changes gate job to ts_tests.yml and ts_check_formatting.yml
  • For PRs, the gate inspects changed files and skips all TS CI jobs if no TS-related paths are affected
  • Always runs TS CI for pushes to main and for the changesets release branch (changeset-release/main)
  • Includes a dummy Elixir change to Electric.Plug.Utils moduledoc

TS-related paths that trigger CI

The check considers files in these paths as TS-related:

  • packages/{typescript-client,react-hooks,y-electric,experimental,start}/
  • examples/
  • website/
  • pnpm-lock.yaml, package.json, pnpm-workspace.yaml, .tool-versions
  • .github/workflows/{ts_*,ensure_sync_service*,pr.*}
  • .github/actions/

Note on this PR

TS CI will still run for this PR because the workflow files themselves (.github/workflows/ts_*) are detected as TS-related changes. For subsequent Elixir-only PRs, TS CI will be skipped.

Branch protection

If any TS CI job names are configured as required status checks, they will appear as "skipped" for Elixir-only PRs. GitHub treats skipped required checks as passing since Nov 2022, but verify your branch protection settings to ensure this works correctly.

Test plan

  • Verify check_ts_changes job runs and outputs should_run=true for this PR (since workflow files changed)
  • Create a follow-up Elixir-only PR to verify TS CI jobs are skipped
  • Verify TS CI still runs for pushes to main

🤖 Generated with Claude Code

Add a lightweight `check_ts_changes` gate job to both `ts_tests.yml` and
`ts_check_formatting.yml` workflows. The gate checks whether TS CI should
run based on:

- Always runs for pushes to main
- Always runs for the changesets release branch (changeset-release/main)
- For other PRs, inspects changed files and only runs if TS-related
  paths are affected (TS packages, examples, website, root configs,
  TS-related workflow files)

This avoids running the full TS CI suite (typechecking, testing, example
builds) for Elixir-only PRs, significantly reducing CI turnaround time.

Also includes a dummy Elixir change to verify the new behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alco alco added the claude label Mar 10, 2026
@claude
Copy link

claude bot commented Mar 10, 2026

Review iteration 2: The previous Important issue about missing root-level config files has been fixed. The regex now includes tsconfig., eslint.config, .prettierrc, .prettierignore, and .npmrc. Script robustness has also been addressed with proper error handling. Two minor suggestions remain open: duplicated logic across workflow files, and packages/start/ being undocumented. This PR looks good to go.

Address review feedback:
- Add missing root-level TS config files to the path check regex
  (tsconfig.*, eslint.config.*, .prettierrc, .prettierignore, .npmrc)
- Add error handling for the GitHub API call (defaults to running
  TS CI if the API call fails)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.74%. Comparing base (35c5ff3) to head (a244cb5).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3991   +/-   ##
=======================================
  Coverage   88.74%   88.74%           
=======================================
  Files          25       25           
  Lines        2425     2425           
  Branches      610      613    +3     
=======================================
  Hits         2152     2152           
  Misses        271      271           
  Partials        2        2           
Flag Coverage Δ
packages/experimental 87.73% <ø> (ø)
packages/react-hooks 86.48% <ø> (ø)
packages/start 82.83% <ø> (ø)
packages/typescript-client 93.93% <ø> (ø)
packages/y-electric 56.05% <ø> (ø)
typescript 88.74% <ø> (ø)
unit-tests 88.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alco alco self-assigned this Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant