Skip to content

Fix /quarantine-test and sibling test-management commands failing at Setup .NET - #19154

Open
Adam Ratzman (adamint) wants to merge 1 commit into
microsoft:mainfrom
adamint:adamint/fix-quarantine-command-sparse-checkout
Open

Fix /quarantine-test and sibling test-management commands failing at Setup .NET#19154
Adam Ratzman (adamint) wants to merge 1 commit into
microsoft:mainfrom
adamint:adamint/fix-quarantine-command-sparse-checkout

Conversation

@adamint

Copy link
Copy Markdown
Member

Description

The /quarantine-test, /unquarantine-test, /disable-test, and /enable-test comment commands all run in the single quarantine_test job in .github/workflows/apply-test-attributes.yml, so all four are affected. Both invocations on 2026-08-07 failed at Setup .NET:

##[error]The specified global.json file 'global.json' does not exist

global.json is present at the repository root, and the Checkout repo step ran to completion before Setup .NET. The actual cause is that the "full" checkout is not full.

Root cause

The job checks out twice into the same workspace directory:

  1. Checkout workflow helpers performs a sparse, blobless, depth-1 checkout so the comment can be parsed before the commenter is authorized. actions/checkout writes core.sparseCheckout=true into .git/config and the single pattern into .git/info/sparse-checkout.
  2. Checkout repo targets the same directory. actions/checkout runs git sparse-checkout disable, which records core.sparseCheckout=false in the per-worktree config and enables extensions.worktreeConfig. actions/checkout then runs git config --local --unset-all extensions.worktreeConfig to clean up that side effect, at which point git stops reading the worktree config and the core.sparseCheckout=true written in step 1 is in effect again, with the pattern file still on disk.
  3. The git checkout --progress --force -B main refs/remotes/origin/main that follows re-applies the stale sparse pattern and prunes the working tree back to the one helper file.

global.json and tools/QuarantineTools are therefore absent when Setup .NET and Run QuarantineTools execute.

Reproduced on a fork with the same action SHAs and step order, adding instrumentation between the two checkouts (https://github.com/adamint/aspire/actions/runs/31212896051):

--- global.json exists: NO
--- tracked file count: 11234
--- present file count: 1
--- git config (sparse/partial):
core.sparsecheckout=true
remote.origin.partialclonefilter=blob:none
--- sparse-checkout list:
.github/workflows/workflow-command-helpers.js

The run then failed at Setup .NET with the same error, confirming that checkout ordering is correct and that the sparse state surviving into the second checkout is the defect.

Fix

The helper checkout now uses path: .workflow-helpers, so it creates its own git directory and cannot leave sparse state behind in the repository that Checkout repo populates. The require in the comment-parsing step is updated to the new location. Checkout repo clears the workspace, which removes .workflow-helpers; nothing after comment parsing reads it, and the actions/checkout post-step returns early when the directory is gone.

No other workflow in .github/workflows combines a sparse and a non-sparse actions/checkout on the same path within one job. pr-docs-check.lock.yml also uses a sparse checkout, but it targets a separate path and is unaffected.

No issue tracks this break; the two failed runs linked above are the report.

Verification

The fixed step sequence was run on a fork with the same action SHAs (https://github.com/adamint/aspire/actions/runs/31213668553):

["Some.Type.Method","https://github.com/microsoft/aspire/issues/18880"]   <- helper require from .workflow-helpers
--- global.json exists: YES
--- QuarantineTools exists: YES
--- tracked file count: 11234
--- present file count: 11234
--- git config (sparse/partial):
(none)
--- helpers dir still present: NO

Setup .NET succeeded, and dotnet run --project tools/QuarantineTools ... ran end to end and modified tests/Aspire.Cli.Tests/Projects/ProcessGuestLauncherTests.cs. The job, including all post-steps, completed successfully.

actionlint reports the same seven pre-existing shellcheck findings before and after this change.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Check the workflow helpers out into a dedicated path so the sparse-checkout
state does not leak into the full checkout that follows in the same job.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 7, 2026 19:59
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19154

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19154"

@github-actions github-actions Bot added the area-engineering-systems infrastructure helix infra engineering repo stuff label Aug 7, 2026

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

Separates the sparse helper checkout from the main workspace, preventing stale sparse-checkout state from breaking test-management commands.

Changes:

  • Checks out workflow helpers under .workflow-helpers.
  • Updates the helper import path.
  • Documents the checkout-state failure mode.
Show a summary per file
File Description
.github/workflows/apply-test-attributes.yml Isolates the sparse checkout so the later full checkout contains global.json and QuarantineTools.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-engineering-systems infrastructure helix infra engineering repo stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants