Skip to content

Report free-suite results to Trunk Flaky Tests for detection only (GST-1859) - #4187

Merged
capy-ai[bot] merged 4 commits into
mainfrom
capy/report-free-suite-results-to-trunk-flaky-tests
Nov 9, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
capy/report-free-suite-results-to-trunk-flaky-tests

Conversation

@garrytan

@garrytan garrytan commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Free Tests now sends every free-suite shard's test results to Trunk Flaky Tests, so Trunk can flag tests that fail and then pass on the same code. It is detection only: nothing is quarantined or skipped, and no check depends on it.

What changed

  • scripts/test-free-shards.ts takes --junit-dir <dir> (only with --ci-run). The runner already asked bun for a JUnit report in each child's sandbox to count tests; with the flag it also keeps a copy of each child's report, the flaky retry included, one uniquely named file per child. A failed copy is logged and changes no verdict. Shard selection, tiers, retries, timeouts and counts are unchanged.
  • free-suite passes the flag and uploads the XML as free-junit-<shard> (if: always(), 7-day retention). It still sees no secrets.
  • A new trunk-flaky-tests job downloads those artifacts and runs trunk-io/analytics-uploader pinned to a86313c7029d22e6ea2d5c346060a224d90053dc (tag v2.1.6), CLI pinned to 0.16.2, into Trunk collection 7yDVXXE3 for org garry-tan.
  • Contract tests pin the new job's shape and the secret list; docs/TESTING_INTERNALS.md gets a short section.

Why

Garry chose B1 on GST-1859: try Trunk Flaky Tests (free up to 5 committers) instead of building our own flaky-test tool (GST-82). Trunk Dynamic CI stays in learning mode, unchanged.

Blast radius

  • Secrets and workflows. The uploader job is the only job that sees the new TRUNK_ORG_API_TOKEN secret (Trunk's v1 organization token; the existing TRUNK_API_TOKEN is a v2 API key, which the uploader can't use). It checks out nothing and runs no pull-request code, has permissions: {}, and runs only on same-repository pull requests and main pushes. use-cache is off, so the CLI always comes from Trunk's checksummed release, never from an Actions cache a pull-request job could write. No pull_request_target.
  • Gating. No job needs trunk-flaky-tests, the step and the job continue on error, and a missing token skips both steps. The required free-tests aggregate is unchanged. Quarantine is off in the uploader and in the collection.
  • Third-party action. It receives the token, the XML paths and repo metadata (URL, head sha, branch). It sends telemetry to Trunk with the token.

Approvals

Garry, 2026-11-09: "do it" to FOUN-32's status, taking B1 on GST-1859 (detection only).
Plan: exempt: no autoplan round per brief (Garry "do it" B1 on GST-1859, detection only; plan reports/GSTA-427-plan.md)

Agent notes

Review-loop exception: accepted by GStack Minder (Captain) 2026-11-09 via Captain grant a-e1534b10e90a: one scoped fix-check after the review-loop stop at 9ccadc4; review_loop_grant 9ccadc4 (fix-check at 919a508, 0 findings)

Documentation

Documentation: current. Scope: AGENTS.md, CLAUDE.md, CONTRIBUTING.md, README.md and docs/ (read-only release audit, base e077053..ecd0f51); changelog fragment and docs/TESTING_INTERNALS.md rechecked at stage 2.2 against plan items 1, 3 and 4.

GSTA-427. Credentials: the org token was read in Garry's signed-in Trunk session and set with gh secret set without being printed. No key was rotated. The test collection was created through Trunk's v2 API.

Refs p1/red-team#2
Refs p11/outside-voice#1
Refs p1fc/fix-check#1
Refs p1fc/fix-check#2

Agent notes
{
  "schema_version": 1,
  "pr": 4187,
  "head": "ecd0f511f7579caf15a9e6a1b1abb4c47e5cd61e",
  "version": "1.98.0.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1648,
      "fail": 0,
      "skip": 6
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 42567724493,
      "attempt": 1,
      "tree": "20153a1993efffe94b94c5e94aedeba74e724e15"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "20153a1993efffe94b94c5e94aedeba74e724e15",
  "product_patch_id": "a889fe0cc36a30e8e181f41602a92b3059d2bf39",
  "gstack_version": "1.98.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 107,
    "rules": "66e5174161eecc2c",
    "base": "e077053c3cbb9b3539d0e7801b7f5f904e88fed5",
    "registry": "e077053c3cbb9b3539d0e7801b7f5f904e88fed5",
    "gate_scan": {
      "tagged": 4,
      "head": "ecd0f511f7579caf15a9e6a1b1abb4c47e5cd61e"
    },
    "reasons": [
      "gate-class",
      "runtime=107"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @20153a1993ef (8 checks, current for ecd0f511f757)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/42567724493/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42567724493/attempts/1",
    "free-tests.yml/cso-windows-launcher: https://github.com/garrytan/gstack/actions/runs/42567724493/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=20153a1993ef tests=36643 skipped=68 runs=42567724493/1 profiles=ci-reuse/free-tests heads=ecd0f511f757 verified=2026-11-09T05:38:09.612Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "AGENTS.md, CLAUDE.md, CONTRIBUTING.md, README.md and docs/ (read-only release audit, base e077053..ecd0f51)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 4,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 3,
    "rounds": 4
  },
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "8811fd300bf305f0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "a889fe0cc36a30e8e181f41602a92b3059d2bf39",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

Open in Capy

…T-1859)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 9, 2026 04:53
Review-Finding: p1/red-team#2 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ct what the docs say about timed-out children

Review-Finding: p11/outside-voice#1 reader=outside-voice
Review-Finding: p1fc/fix-check#1 reader=fix-check
Review-Finding: p1fc/fix-check#2 reader=fix-check
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit b5c690c into main Nov 9, 2026
90 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant