Skip to content

Guard quarantine temporary_id against length-limit placeholder leaks - #67683

Merged
wtgodbe merged 2 commits into
dotnet:mainfrom
wtgodbe:wtgodbe/quarantine-temporary-id-length
Jul 8, 2026
Merged

wtgodbe merged 2 commits into
dotnet:mainfrom
wtgodbe:wtgodbe/quarantine-temporary-id-length

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Jul 8, 2026

Copy link
Copy Markdown
Member

Problem

The Daily Test Quarantine Management gh-aw workflow occasionally commits an unresolved #aw_... placeholder directly into a [QuarantinedTest(...)] attribute. Most recently, run 28861383445 left #aw_quickgrid_sort in a quarantine attribute in #67633 (fixed manually afterward). This class of "placeholder leaks into code" bug has recurred for months.

Root cause

The agent picked a descriptive temporary_id (aw_quickgrid_sort) whose slug is 14 chars — over gh-aw's limit of aw_ followed by 3–12 [A-Za-z0-9_] characters. gh-aw silently:

  1. discards the over-length id,
  2. auto-generates a different id (aw_FpOShtbR), and
  3. registers the newly created issue (Quarantine QuickGridInteractiveTest.SortByTypeMismatchVirtualizedShowsClearError #67632) under that auto-generated id.

Because the #{temporary_id} token written into the code (#aw_quickgrid_sort) no longer matches any registered id, the substitution engine treats it as a malformed reference and skips it — so it is committed verbatim as a broken placeholder. The add_comment(item_number: aw_quickgrid_sort) call then fails, turning the job red, but the PR and issue were already pushed with the bad token.

This is a new trigger (over-length descriptive slug), distinct from the previously fixed gh-aw substitution bugs.

Fix

Prompt-guidance change to .github/workflows/test-quarantine.md (runtime-imported by the lock, so no lock recompile needed):

  • Document the aw_ + 3–12 [A-Za-z0-9_] char limit both in the constraint list and at the point where the id is created (Case A step 1).
  • Instruct the agent to choose a short, abbreviated slug (e.g. aw_qgridsort, not aw_quickgrid_sort) and reuse the identical id for create_issue, add_comment, the attribute, and the PR body.
  • Add a pre-submit self-check: verify the token written into the attribute matches ^aw_[A-Za-z0-9_]{3,12}$ and exactly equals the temporary_id passed to create_issue.

Refs run 28861383445, PR #67633, issue #67632.

The Daily Test Quarantine Management workflow occasionally commits an
unresolved `#aw_...` placeholder into a `[QuarantinedTest(...)]` attribute
(e.g. `#aw_quickgrid_sort` in PR dotnet#67633, run 28861383445). Root cause: the
agent chose a descriptive `temporary_id` longer than gh-aw's `aw_` + 3-12
`[A-Za-z0-9_]` limit. gh-aw silently discards the too-long id, auto-generates
a different one, and registers the new issue under it -- so the `#{temporary_id}`
token written into code no longer matches any registered id, is treated as a
malformed reference, and is committed verbatim as a broken placeholder.

Document the `aw_` + 3-12 char limit at the constraint list and at the point
where the id is created (Case A step 1), instruct the agent to pick a short
abbreviated slug and reuse the identical id for create_issue / add_comment /
the attribute / the PR body, and add a pre-submit self-check that the token
written into the attribute matches `^aw_[A-Za-z0-9_]{3,12}$` and equals the
temporary_id passed to create_issue.

The prompt body is runtime-imported from this .md, so no lock recompile is
required.

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Daily Test Quarantine Management (gh-aw) workflow guidance to prevent unresolved #aw_... placeholders from being committed into [QuarantinedTest(...)] attributes when an invalid/over-length temporary_id is used.

Changes:

  • Documented and emphasized the temporary_id format/length constraint (aw_ + 3–12 [A-Za-z0-9_]) and the failure mode when it’s violated (silent replacement → placeholder leak).
  • Added explicit guidance to pick a short, valid slug and reuse the identical temporary_id consistently across create_issue, add_comment, the attribute, and PR body.
  • Added a pre-submit self-check instructing the agent to validate the placeholder token and regex-match the temporary_id.

Comment thread .github/workflows/test-quarantine.md Outdated
- **Always exclude** tests under `Microsoft.AspNetCore.SignalR.Specification.Tests` from all analysis. These are abstract base classes inherited by other test projects — there is no good way to quarantine them, so they must be ignored entirely. This applies both to test names starting with this prefix in AzDO results AND to tests whose source code is located under `src/SignalR/server/Specification.Tests/`. A test may appear in AzDO under a different namespace (e.g., `StackExchangeRedis.Tests`) but still be defined in `Specification.Tests` — check the actual source file before quarantining.
- **`[QuarantinedTest]` attributes must reference a GitHub issue URL that *ultimately resolves* to a numeric issue number** (e.g., `https://github.com/dotnet/aspnetcore/issues/12345`). For a newly created issue (Case A) you write the `#{temporary_id}` token while editing (see below); the framework resolves it to the numeric URL before the PR is opened, so the final committed code is numeric. Never write placeholder strings, descriptive text, or any other non-numeric identifier — the only permitted non-numeric value is the required `#{temporary_id}` token.
- **For a newly created quarantine issue (Case A), you MUST write the `#{temporary_id}` reference — never a literal numeric issue number.** Here `#{temporary_id}` means a literal `#` immediately followed by the **exact** `temporary_id` string you passed to the corresponding `create_issue` call (do **not** add any extra `aw_` prefix — the `temporary_id` already includes it). The issue's real number is assigned by the framework *after* the agent finishes, so it is impossible for you to know it while editing code. For example, if you called `create_issue(temporary_id: "aw_http2ign", ...)`, write `[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/#aw_http2ign")]`. The framework resolves `#aw_http2ign` to the real numeric URL before opening the PR, so the final committed code will contain the numeric URL.
- **The `temporary_id` must be exactly `aw_` followed by 3 to 12 characters from `[A-Za-z0-9_]` (so the whole token is 6–15 characters, e.g. `aw_http2ign`, `aw_qgridsort`).** This limit is enforced by the framework. If you pass a `temporary_id` that is too long or otherwise malformed, the framework **silently discards it, auto-generates a *different* id, and registers your new issue under that auto-generated id** — so the `#{temporary_id}` token you wrote into the code no longer matches any registered id, is treated as a malformed reference, and is **committed verbatim as a broken placeholder** (this is exactly how `#aw_quickgrid_sort` leaked into a `[QuarantinedTest]` attribute). Keep the slug short and abbreviate: e.g. for `SortByTypeMismatchVirtualizedShowsClearError` use `aw_qgridsort` (9 chars), **not** `aw_quickgrid_sort` (14 chars — over the limit). The identical `temporary_id` must be used for the `create_issue` call, the `add_comment` `item_number`, the `#{temporary_id}` in the attribute, and the `Associated issue: #{temporary_id}` in the PR body — pick one short, valid slug up front and reuse it everywhere.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — clarified in 84832c3. The 3–12 limit is on the slug portion after aw_ (gh-aw's exact rule: "'aw_' followed by 3 to 12 alphanumeric or underscore characters"), giving a full token of 6–15 chars. The example counts are now explicitly labeled as slug counts (qgridsort = 9, quickgrid_sort = 14) and the regex ^aw_[A-Za-z0-9_]{3,12}$ is cited directly.

Comment thread .github/workflows/test-quarantine.md Outdated
#### Case A — New quarantine

1. **Create a test-failure issue** via `create_issue` with a `temporary_id` (e.g., `aw_http2ign`). Use this exact structure:
1. **Create a test-failure issue** via `create_issue` with a `temporary_id` (e.g., `aw_http2ign`). The `temporary_id` **must** be `aw_` followed by 3 to 12 characters from `[A-Za-z0-9_]` (whole token 6–15 chars); choose a **short** abbreviated slug — a too-long id (e.g. `aw_quickgrid_sort`, 14 chars) is silently replaced by an auto-generated id, which orphans the `#{temporary_id}` you write into code and leaves a broken placeholder. Use this exact structure:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — clarified in 84832c3. The 3–12 limit is on the slug portion after aw_ (gh-aw's exact rule: "'aw_' followed by 3 to 12 alphanumeric or underscore characters"), giving a full token of 6–15 chars. The example counts are now explicitly labeled as slug counts (qgridsort = 9, quickgrid_sort = 14) and the regex ^aw_[A-Za-z0-9_]{3,12}$ is cited directly.

Address review feedback: the character counts were ambiguous between the
slug portion and the full token. gh-aw enforces "'aw_' followed by 3 to 12
alphanumeric or underscore characters", so the 3-12 limit is on the slug
only (full token 6-15). Label the example counts explicitly as slug counts
(qgridsort = 9, quickgrid_sort = 14) and reference the exact regex
^aw_[A-Za-z0-9_]{3,12}$.

Co-authored-by: Copilot <[email protected]>
@wtgodbe
wtgodbe merged commit a53b5e4 into dotnet:main Jul 8, 2026
10 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 9, 2026
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.

2 participants