Repository navigation
Harden input and output restrictions for test-quarantine workflow - #68074
Conversation
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR tightens the test-quarantine agentic workflow’s trust boundaries by replacing comment-text-based “do not (un)quarantine” signaling with mechanically privileged signals (bot-PR closure by a non-bot human, or application of a maintainer-only label) and by hardening safe-outputs restrictions.
Changes:
- Switches prior-attempt cutoff logic to rely on (1) privileged closure of bot-authored PRs and (2)
no-quarantine-for-30-dayslabel presence + timestamp, avoiding comment body ingestion. - Adds a Safe Outputs allowlist restricting PR patches to
src/**/*.cs, and makes threat-detection fail closed. - Updates generated workflow lock artifacts and the gh-aw action pin.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/test-quarantine.md | Updates the skill/workflow logic and instructions to use privileged signals + label-based suppression, and tightens safe-outputs policies. |
| .github/workflows/test-quarantine.lock.yml | Regenerates the compiled workflow lock to reflect the updated skill/policy and newer gh-aw runtime/tooling. |
| .github/aw/actions-lock.json | Updates pinned gh-aw setup action version used by agentic workflows. |
Comments suppressed due to low confidence (2)
.github/workflows/test-quarantine.md:273
- The labeled-PR search query is missing
is:unmerged, so merged PRs that still have theno-quarantine-for-30-dayslabel could be included. That can incorrectly settrusted_closed/cutoffs based on successful merged PRs (not prior rejections) and suppress future automation unexpectedly.
labeled_prs = search_prs(
f'repo:dotnet/aspnetcore is:pr author:{BOT_AUTHOR} '
f'"test-quarantine" in:title label:{NO_QUARANTINE_LABEL}'
)
.github/workflows/test-quarantine.lock.yml:3191
- The labeled-PR search query does not include
is:unmerged, so merged PRs with the label could be pulled into the injected data and incorrectly influence cutoffs/suppression decisions. Addis:unmergedto keep this scoped to still-open or closed-but-unmerged workflow PRs.
labeled_prs = search_prs(
f'repo:dotnet/aspnetcore is:pr author:{BOT_AUTHOR} '
f'"test-quarantine" in:title label:{NO_QUARANTINE_LABEL}'
)
Merged PRs represent a successful outcome, not a rejected attempt, so their close event must not seed trusted_closed/closed_at. label_added_at still applies regardless of merge state. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (4)
.github/workflows/test-quarantine.lock.yml:3132
- Same issue as the source workflow: the Python step builds an Authorization header value of "******" instead of sending the actual GH_TOKEN. This will break the API calls used to compute cutoffs/suppression windows.
token = os.environ["GH_TOKEN"]
headers = {"Authorization": f"******", "Accept": "application/vnd.github+json"}
since = (datetime.now(timezone.utc) - timedelta(days=30)).strftime("%Y-%m-%d")
.github/workflows/test-quarantine.md:205
- The GitHub REST calls in this step will be unauthenticated because the Authorization header is set to a literal "******". That will cause /search/issues and /issues/{n}/events requests to fail (401/403 or severe rate limiting), preventing the workflow from fetching the cutoff/suppression signals.
token = os.environ["GH_TOKEN"]
headers = {"Authorization": f"******", "Accept": "application/vnd.github+json"}
since = (datetime.now(timezone.utc) - timedelta(days=30)).strftime("%Y-%m-%d")
.github/workflows/test-quarantine.md:273
- The labeled-PR search query has no time bounding, so it can pull in very old PRs that still carry the label, then call /issues/{n}/events for each one. Since the suppression window is only 30 days, adding an
updated:>=<since>qualifier should preserve correctness (labeling updates the PR) while reducing API calls and output size.
labeled_prs = search_prs(
f'repo:dotnet/aspnetcore is:pr author:{BOT_AUTHOR} '
f'"test-quarantine" in:title label:{NO_QUARANTINE_LABEL}'
)
.github/aw/actions-lock.json:12
- This lock file now only contains entries for gh-aw-actions/[email protected], but other generated workflows in the repo still reference gh-aw-actions/[email protected] and gh-aw-actions/[email protected] (e.g., .github/workflows/agentics-maintenance.yml). If this file is used as the authoritative lock source for gh-aw workflows, removing those entries will make the lock inconsistent with existing workflows. Either regenerate/update those workflows to v0.83.4 as part of the same change, or keep the older entries until everything is upgraded.
"github/gh-aw-actions/[email protected]": {
"repo": "github/gh-aw-actions/setup",
"version": "v0.83.4",
"sha": "e89c65e17eb281bbd5ff2ff9e9199a03e96654c7"
}
no-quarantine-for-30-dayslabel.allowed-files: ["src/**/*.cs"]to create-pull-request. Explicitly restricts workflow from touching sensitive files like .yml workflows/pipelines