Skip to content

Fix docs safe-output base fallback - #19465

Merged
David Pine (IEvangelist) merged 4 commits into
mainfrom
dapine/fix-docs-base-fallback
Sep 3, 2026
Merged

David Pine (IEvangelist) merged 4 commits into
mainfrom
dapine/fix-docs-base-fallback

Conversation

@IEvangelist

@IEvangelist David Pine (IEvangelist) commented Aug 18, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes the Documentation Check safe-output base resolver exposed by recovery run 32112079288. gh-aw v0.86.2 generated the correct patch against release/13.5, but canonicalization stripped the server-injected base metadata and the apply-time resolver failed closed before safe outputs could create the draft documentation PR.

This change extracts the resolver into a tested helper that:

  • validates current and legacy canonical base fields;
  • falls back to the raw safe-output server metadata when canonicalization removes both fields;
  • validates the raw base commit and target branch;
  • requires agreement with the sole drafted source notification and triggering source PR; and
  • rejects missing, malformed, conflicting, or duplicate values.

The workflow still skips the resolver when no create_pull_request output exists. The generated lock file was compiled idempotently with the repository-pinned gh-aw v0.86.2.

Validation:

  • python -m unittest discover -s .github\workflows\pr-docs-check -p "test_*.py" -v (102 passed)
  • dotnet test --project tests\Infrastructure.Tests\Infrastructure.Tests.csproj --no-launch-profile -- --filter-class "*.PrDocsCheckWorkflowTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true" (6 passed)
  • gh aw compile pr-docs-check --validate --no-check-update

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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 32c349b4-907d-42e9-aad8-2f0edc267779
Copilot AI balanced review requested due to automatic review settings August 18, 2026 08:06
@github-actions

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 -- 19465

Or

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

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

This comment has been minimized.

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

Adds a validated fallback for resolving documentation PR target branches from raw gh-aw safe-output metadata.

Changes:

  • Extracts shared branch-resolution and validation logic.
  • Integrates it into source and compiled workflows.
  • Adds regression fixtures and comprehensive tests.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Infrastructure.Tests/WorkflowScripts/PrDocsCheckWorkflowTests.cs Verifies workflow integration.
.github/workflows/pr-docs-check/validate_outcome.py Uses the shared resolver.
.github/workflows/pr-docs-check/test_validate_outcome.py Tests outcome fallback behavior.
.github/workflows/pr-docs-check/test_resolve_safe_output_target.py Tests resolver validation.
.github/workflows/pr-docs-check/resolve_safe_output_target.py Implements target resolution.
.github/workflows/pr-docs-check/fixtures/run-32112079288-safeoutputs.jsonl Adds raw recovery fixture.
.github/workflows/pr-docs-check/fixtures/run-32112079288-agent_output.json Adds canonical recovery fixture.
.github/workflows/pr-docs-check.md Integrates resolver into workflow.
.github/workflows/pr-docs-check.lock.yml Regenerates compiled workflow.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/pr-docs-check/resolve_safe_output_target.py
Comment thread .github/workflows/pr-docs-check/validate_outcome.py Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Report whether a notification mismatch came from canonical or raw server metadata, and keep drafted-PR validation source-neutral.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 32c349b4-907d-42e9-aad8-2f0edc267779
Copilot AI review requested due to automatic review settings August 18, 2026 08:50
@github-actions

This comment has been minimized.

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

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

This comment has been minimized.

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

* Fix Issue 19708

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7e17da02-39b1-4fa1-ac25-144eb6fcb904

* Eliminate false positive

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Make the restore hermetic instead of dropping the project update

Restores the project-update leg of the test and makes its restore
hermetic via the install sidecar's `packages` field, rather than
removing the step that fails.

Without `packages`, the relaunched CLI derives its Aspire feed from the
identity it just persisted (darc-pub-microsoft-aspire-<commit>). Once
that staging build is promoted to GA the feed stops carrying a matching
Aspire.AppHost.Sdk, which is the reported failure in #19708. Pinning
`packages` at the harness hive removes that dependency, and
InstallSidecarWriter.PrepareForSelfUpdate rewrites only
channel/version/commit, so the field survives the self-update.

This restores two behaviours the test was written to cover: that the
persisted identity channel lands in a project's aspire.config.json, and
the "AppHost predates the self-update" scenario users actually hit.

The second `aspire update --self` is dropped because it cannot coexist
with `packages`: once the sidecar's channel is staging, the synthesized
local-hive channel replaces the same-named built-in channel
(PackagingService.GetChannelsAsync) and a local hive has no
CliDownloadBaseUrl, so self-download fails with "Channel 'staging' does
not support CLI downloads". The project update asserts the same
persistence more strongly, via the resulting config.

Also drops the [QuarantinedTest] attribute added by #19733 while
resolving the merge with main, so the fix actually runs in CI.

Validated: 3 consecutive passing E2E runs against ASPIRE_E2E_ARCHIVE,
with quarantined and outerloop tests excluded. Recording confirms the
relaunched process is the published staging binary
(13.5.3+b5f143315ffb6968ea939a9978797a5b20e4c688), not a local no-op.
UpdateCommandTests theory: 4 passed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f2f02689-8514-4cf8-b38d-f2b62f506754

* Improve package path processing

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Mitch Denny <midenn@microsoft.com>
Copilot-Session: 7e17da02-39b1-4fa1-ac25-144eb6fcb904
Copilot-Session: f2f02689-8514-4cf8-b38d-f2b62f506754
Copilot AI review requested due to automatic review settings September 3, 2026 16:26
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Tests selector

3 / 99 PR test projects · 1 PR job · 0 advisory-only targets, from 11 changed files.

Selected PR test projects (3 / 99)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Infrastructure.Tests

Selected PR jobs (1)

extension-e2e

Advisory workflow impact (0)

none


How these were chosen — grouped by what changed

📄 .github/workflows/pr-docs-check.lock.yml (changed)
→ 1 directly: Infrastructure.Tests

📄 .github/workflows/pr-docs-check.md (changed)
→ 1 directly: Infrastructure.Tests

📄 .github/workflows/pr-docs-check/fixtures/run-32112079288-agent_output.json (changed)
→ 1 directly: Infrastructure.Tests

📄 .github/workflows/pr-docs-check/fixtures/run-32112079288-safeoutputs.jsonl (changed)
→ 1 directly: Infrastructure.Tests

📄 .github/workflows/pr-docs-check/resolve_safe_output_target.py (changed)
→ 1 directly: Infrastructure.Tests

📄 .github/workflows/pr-docs-check/test_resolve_safe_output_target.py (changed)
→ 1 directly: Infrastructure.Tests

📄 .github/workflows/pr-docs-check/test_validate_outcome.py (changed)
→ 1 directly: Infrastructure.Tests

📄 .github/workflows/pr-docs-check/validate_outcome.py (changed)
→ 1 directly: Infrastructure.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/SelfUpdateChannelPersistenceTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/Commands/UpdateCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Infrastructure.Tests/WorkflowScripts/PrDocsCheckWorkflowTests.cs (changed test)
→ 1 directly: Infrastructure.Tests

Job reasons

Job Triggered by
extension-e2e tests/Aspire.Cli.EndToEnd.Tests/SelfUpdateChannelPersistenceTests.cs, tests/Aspire.Cli.Tests/Commands/UpdateCommandTests.cs

Selection computed for commit 1dceefb.

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.

🔵 Needs a closer look

The privileged cross-repository safe-output workflow was validated offline but not demonstrated through a post-change workflow dispatch.

Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@IEvangelist
David Pine (IEvangelist) merged commit 12ffc14 into main Sep 3, 2026
491 of 497 checks passed
@IEvangelist
David Pine (IEvangelist) deleted the dapine/fix-docs-base-fallback branch September 3, 2026 17:08
@github-actions github-actions Bot added this to the 13.6 milestone Sep 3, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

Step 5 branch taken: docs_required → false-positive signal, nothing to document

Triggered signals (1): pr_body_has_cli_flag_mention. Evidence: the matched PR body snippet was sed) - \dotnet test --project tests\Infrastructure.Tests...`— a Windows-style backslash path fragment from a validation command in the PR description, not an actual CLI flag or user-facing option. This PR introduces no real--flag`.

All 11 changed files are internal engineering-systems artifacts: the pr-docs-check gh-aw workflow itself (.github/workflows/pr-docs-check.md, .lock.yml, resolve_safe_output_target.py, validate_outcome.py, their tests/fixtures), plus unrelated test files (tests/Aspire.Cli.EndToEnd.Tests/SelfUpdateChannelPersistenceTests.cs, tests/Aspire.Cli.Tests/Commands/UpdateCommandTests.cs, tests/Infrastructure.Tests/WorkflowScripts/PrDocsCheckWorkflowTests.cs). None touch src/ product code, public API surface, CLI commands, or any user-facing Aspire feature — this PR only fixes an internal CI/automation bug in this docs-check workflow itself. There is no concrete documentation edit to make on microsoft/aspire.dev.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ CI Failure Analysis: Possible Flaky Test(s)

The CI build failed due to test failure(s) that appear unrelated to the PR changes. These may be flaky tests.

Suspected flaky test(s):

  • Aspire.Cli.Tests.DotNet.ProcessExecutionTests.WaitForExitAsync_WithGracefulServices_ProcessIgnoresSignal_ExpireEscalatesToKill(isolateConsole: False) in job Tests / No-package tests (regular, Aspire.Cli.Tests, Cli, Cli, tests/Aspire.Cli.Tests/Aspire.Cli.Tests.cs... / Cli (windows-latest)
    • Error: System.TimeoutException : The operation has timed out.
    • Stack Trace (first frames):
      at Aspire.Cli.Tests.DotNet.ProcessExecutionTests.WaitForExitAsync_WithGracefulServices_ProcessIgnoresSignal_ExpireEscalatesToKill(Boolean isolateConsole) in D:\a\aspire\aspire\tests\Aspire.Cli.Tests\DotNet\ProcessExecutionTests.cs:line 233
      
    • Why likely flaky: Timing-sensitive process signal escalation test unrelated to PR changes (PR only touches docs-check workflow scripts); matches known flaky pattern for similar ProcessExecutionTests timing tests on Windows runners.

Suggested actions:

  • Re-run the failed CI jobs to confirm if the failure is intermittent
  • If the test continues to fail, consider quarantining it using /quarantine-test <test name> <issue URL>
  • Search existing issues to see if this test is already known to be flaky

You can re-run the failed jobs from the workflow run page.

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.

3 participants