Expand impacted targets API recipe and gotchas#51
Conversation
…eue-ahead targets, ALL footgun, trunk-merge filter Adds a Reading testing details section documenting the impactedTargets vs impactedTargetsForTestedPrs distinction in /getMergeQueueTestingDetails responses, a testRunId derivation note (it is the trailing UUID in trunk-merge/pr-N/UUID), and a Recipes and gotchas section covering: skipping uploads on trunk-merge/* branches, ALL not short-circuiting other PRs, last-upload-wins per head SHA, bazel-diff reuse between PR and MQ jobs, and a flagged 10 MB vs 20 MiB discrepancy callout. Sourced from the impacted-targets-api-discovery customer feedback cluster (13 pairs, 6 customers). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Verification status (2026-05-20): Could not determine state from available signals. Manual check needed.
This is a content-accuracy PR, not a feature-rollout PR, so the usual flag/staging signals don't apply. The four "items flagged for review" in the PR body (20 MiB vs 10 MB upload limit, |
…ze limit
- Add ## Uploading impacted targets H2, convert "Handling Forked Pull
Requests" bold-pseudo to a real ###, promote three section H3s to H2
and five gotcha H4s to H3, drop the redundant *** divider.
- Correct upload size limit from "20 MiB / ~10 MB" hedge to 20 MB.
The express.json({ limit: "20mb" }) constant in
trunk-io/trunk/services/public-api/src/constants.ts is parsed by the
bytes npm package as base-10 MB (20,000,000 bytes), not MiB. The
"10 MB" customer-thread figure traces to test-harness mocks in
merge-action/bazel-action, not the prod constant.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Code verification (2026-05-21): 4 confirmed / 0 contradicted / 0 ambiguous / 0 unverifiable
Initial verification surfaced one contradiction: the page said "20 MiB" (with a hedge against a "10 MB" customer-thread figure), but source says Source #1 — Upload body limit (confirmed after fix)File: export const EXPRESS_JSON_LIMIT = "20mb"; // https://expressjs.com/en/api.htmlAdjacent usage in this.app.use(express.json({ limit: EXPRESS_JSON_LIMIT })); // allow payloads of 20mb, or ~400k targetsReasoning: The Source #2 — testRunId field (confirmed)File: testRunId: z.string({
description:
"The ID of the test run. This is the last section of the names of the branches Merge Queue creates for testing (eg, for `trunk-merge/pr-1815/5df78918-4654-40a0-822a-313f540ea0be`, the ID is `5df78918-4654-40a0-822a-313f540ea0be`",
}),Reasoning: The field name is exactly Source #3 — impactedTargetsForTestedPrs field (confirmed)File: impactedTargets: z.array(z.string()).optional()
.describe("..."),
impactedTargetsForTestedPrs: z.array(z.string()).optional()
.describe("The impacted build/test targets for only the PRs being tested in this run (i.e. `testedPullRequests`), excluding any dependent PRs. Only present when impacted targets are being uploaded for the repository.")Reasoning: Both fields exist on Source #4 — trunk-temp/** branch behavior (confirmed)File: const TEMP_BRANCH_NAME_PREFIX = "trunk-temp/";Cross-referenced in docs2 itself at
Reasoning: |
Summary
parallel-queues/api.mdxdocumenting theimpactedTargetsvsimpactedTargetsForTestedPrsdistinction in/getMergeQueueTestingDetailsresponses and thetestRunIdderivation from thetrunk-merge/pr-N/UUIDbranch name.trunk-merge/*branches, the"ALL"keyword does NOT short-circuit other PRs' impact matching, last-upload-wins per head SHA, and thebazel-diffreuse pattern between PR and MQ jobs.Why
Sourced from customer feedback mining (cluster
impacted-targets-api-discovery, verdictpartial, 13 pairs across 6 customers). Recurring API integration questions: testRunId derivation, impactedTargets vs impactedTargetsForTestedPrs, the ALL keyword footgun, the trunk-merge/* CI-filter requirement, bazel-diff reuse, and the upload size limit (which has a documentation discrepancy worth verifying).Items flagged for review
merge-queue/reference/merge.mdx) and the existing Warning in that file cite 20 MiB. Engineering has cited ~10 MB in customer threads (see trunk-appliedintuition thread). I added an<Info>callout flagging both numbers rather than picking one — confirm the actual current limit and replace the callout with a single authoritative number.testRunIdfield name. The cluster source describes the UUID intrunk-merge/pr-X/UUIDas "the testRunId", but I could not findtestRunIdalready mentioned in docs2. Verify that the field is actually namedtestRunIdin/getMergeQueueTestingDetailsresponses (vstestId,runId, etc.) before merging.impactedTargetsForTestedPrsfield name. Same as above — confirm exact field casing/spelling in the live API response. The cluster examples use this exact name, but I have not seen it in an OpenAPI spec inside this repo.trunk-temp/**in thebranches-ignoreexample. I includedtrunk-temp/**alongsidetrunk-merge/**because docs2 elsewhere mentionstrunk-temp/*as a precursor branch (seemerge-queue/reference/common-problems.mdx). The cluster only explicitly called outtrunk-merge/*. Iftrunk-temp/*never reaches the impacted-targets workflow trigger (it gets renamed before push), drop it from the example.Customer signal
impacted-targets-api-discovery(verdict: partial, 13 pairs / 6 customers)findings/clusters/impacted-targets-api-discovery.json):