feat(TU-47260): add turbo-cache and per-package coverage PR comment to frontend-pr-workflow - #271
Draft
sh-waqar wants to merge 1 commit into
Conversation
…o frontend-pr-workflow All opt-in; defaults keep today's behaviour. - turbo-cache: Turbo remote cache backed by the GitHub Actions cache (rharkor/caching-for-turbo, pinned by SHA) in the build and unit-test jobs. Unchanged packages replay their outputs (e.g. coverage/) instead of re-running. - coverage-path: configurable coverage upload path (was hardcoded coverage/), newline-separated globs for monorepos, e.g. packages/*/coverage. - coverage-report: off | always | on-failure. unit-tests builds a sticky comment with one row per coverage-summary.json; a separate coverage-comment job posts it, so only that job gets pull-requests: write (the workflow-level permissions narrow every other job's token). on-failure creates the comment only when unit tests fail and keeps an existing one updated, so a fix flips it to passing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019tUHRKTe2YrU4YwTbKzXPH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three opt-in inputs for
frontend-pr-workflow. The defaults keep today's behaviour.turbo-cache: truecoverage/, instead of re-running.coverage-pathcoverage/upload path. Accepts newline-separated globs for monorepos, e.g.packages/*/coverage.coverage-report: off | always | on-failurecoverage-summary.json.on-failurecreates the comment only when unit tests fail, then keeps it updated so a fix shows ✅.Why
admin-homeadds a job of its own that downloads this workflow'scoverage-${run_id}artifact and posts it withMishaKav/jest-coverage-comment@main, on every PR.in-app-notifications(TU-46981) postslcov.infowithromeovs/lcov-reporter-action, only when coverage falls below its threshold.coverage-report: alwaysandon-failurerespectively.coverage/, so per-package coverage in a monorepo was never uploaded.Design notes
coverage-commentjob withpull-requests: write. The workflow-levelpermissions(id-token, contents) narrow every job's token, andunit-testsshouldn't need more. This follows the existingdeep-purplejob.packages/hooks.coverage/and gets a one-row table.Verified on
frontend-packages#32 (pnpm + Turbo, 2 packages and 1 app)pr.ymlFULL TURBO: lint and build 3/3 cached,test:coverage2/2 cached (178 ms, vs about 8 s when it ran)src@typeform/hooksmissed on lint, build and test; every task for the other packages replayedLocal check: the comment logic was run against every combination of mode × passed/failed × existing comment.
One question for reviewers: is it OK to run
rharkor/caching-for-turboinside the shared workflow? It's pinned by SHA and opt-in. The first-party alternative isactions/cacheon.turbo/cache, which is simpler but never prunes old entries.🤖 Generated with Claude Code
https://claude.ai/code/session_019tUHRKTe2YrU4YwTbKzXPH