mirror of
https://github.com/mastra-ai/mastra.git
synced 2026-11-17 08:44:46 +00:00
## Why Test tiers skip test files and jobs on PRs when they haven't failed in 30 days. The full suite still runs on the alpha versioning PR (`changeset-release/main`), so a merge that breaks a skipped test goes green on its PR. The failure then turns up later on the versioning run, with nobody pointed at it. That's what happened with #29370, which broke `goal-step.test.ts`, and #30434, which broke the Playground autosave test. ## What this does When a versioning run fails in a file or job that tiers had skipped, the tier update now passes those escapes to a new `attribute` job. That job: 1. Finds the last green versioning run (up to 72 hours back) and lists the first-parent merges on `main` between it and the red head (at most 60). 2. Bisects those merges, running only the escaped test file at each step. It checks out the commit, installs, builds the package and its dependencies from the read-only Turbo cache, and runs Vitest across the `unit`, `typecheck`, `e2e:packages/*` and `e2e:client-sdks/*` projects, the same ones the PR jobs use. 3. Names a merge only when the file fails there twice and passes at its parent. A file that passes at the red head is reported as not reproduced (a flake). A file that also fails before the range, or can't be run, is unconfirmed. Nobody is tagged in either case. When a file is reported by more than one project, any failure wins. The file passes only if every result passed, and a file with no result is unconfirmed. A separate `notify` job holds the Slack token and sends the messages. If `attribute` fails or times out (45 minutes), `notify` sends the plain fallback alert that `update` prepared. The escaped file goes back into the PR tier for 30 days, as before. ### Who gets tagged The message names the PR, its title and its author, tagged through `.github/slack-users.json`. A login that isn't in the map is printed as a plain `@login`. When the PR was opened by a bot, the bot can't answer for it, so the message tags a person instead and says who they are to the PR: 1. the human who merged it ("merged by"); otherwise 2. every human whose latest review approved it ("approved by"); otherwise 3. the human(s) credited on the most commits, counting commit authors and `Co-authored-by` trailers with GitHub noreply addresses ("co-authored by"); otherwise 4. `@here`. `@here` is for when we can't tell who the person is. It is not for a person we know but who is missing from the Slack map: they still get a plain `@login`. Reviews and commits are read across every page. A lookup that fails, or a commit list at GitHub's 250-commit cap (which may be cut off), counts as unknown, and that rung is skipped rather than guessed from. PR titles are escaped, so a title can't inject `<!here>` or other mentions. ## Testing - `node --test scripts/test-tiers/*.test.mjs`: 96 pass on Node 22 and 24. The new tests fail with the attribution module removed. Each stand-in rung, the title escaping, any-failure-wins aggregation, E2E project selection and pagination fails its own test when that rule is removed. - Replays against real versioning runs, at the real commits: - #29370 (`goal-step.test.ts`, run 43907413456): found merge ` |
History
|
|
|---|---|---|
| .. | ||
| data | ||
| shared-actions/set-pr-status | ||
| affected-graph-seed.yml | ||
| backport-auto.yml | ||
| codeql.yml | ||
| cron-alpha-publish.yml | ||
| discord-release.yml | ||
| e2e-docs.yml | ||
| e2e-experiment-worker.yml | ||
| e2e-experiments.test.ts | ||
| e2e-tests.yml | ||
| flag-spam-comments.yml | ||
| issue-pending-release.yml | ||
| issue-triage.yml | ||
| labeler.yml | ||
| lint-docs.yml | ||
| lint.yml | ||
| major-version-check.yml | ||
| mastracode-e2e.yml | ||
| npm-publish.yml | ||
| prebuild.yml | ||
| README.md | ||
| regenerate-provider-registry.yml | ||
| renovate.yml | ||
| secrets.test-workspaces.yml | ||
| starsling-disks.yml | ||
| sync-templates.yml | ||
| sync_renovate-changesets.yml | ||
| test-combined-stores.yml | ||
| test-durable-streams.yml | ||
| test-suite.yml | ||
| test-tiers.yml | ||
| test-workspaces.yml | ||
| trigger-cloud-tests.yml | ||
| upload-studio-r2.yml | ||
| version-packages.yml | ||
| vitest-all.yml | ||
GitHub Workflows
This directory contains GitHub Actions workflow files for the Mastra project.
Preventing Workflows from Running on Forks
To prevent workflows from running on forked repositories, we've added a condition to each workflow file that checks if the repository is the main Mastra repository:
if: ${{ github.repository == 'mastra-ai/mastra' }}
If a job already has an if condition, we combine them:
if: ${{ github.repository == 'mastra-ai/mastra' && (your existing condition) }}
Benefits
- Prevents unnecessary workflow runs on forks
- Reduces notifications for fork owners
- Saves GitHub Actions minutes