Repository navigation
Allow slow OpenSSH startup during unattended Git verification - #21686
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21686Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21686" |
Tests selector2 / 100 PR test projects · 4 PR jobs, from 2 changed files. Selected PR test projects (2 / 100)
Selected PR jobs (4)
How these were chosen — grouped by what changed📦 affected project 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the OpenSSH probe timeout changes.
No open issues 🎉
What changed in this PR
This PR makes unattended configuration-source Git acquisition tolerate slow OpenSSH startup while preserving cancellation, executable selection, and authentication safeguards.
Changes:
- Extends OpenSSH version probing from five to 30 seconds, retaining the enclosing cancellation budget.
- Extracts probe verification into a testable method and adds lifecycle-only debug logging.
- Adds regression tests for slow startup, banner validation, nonzero exits, and cancellation, and documents the timeout.
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Git/GitCommandRunnerTests.Authentication.cs | Adds focused OpenSSH verification regression tests. |
| src/Aspire.Cli/Git/GitCommandRunner.cs | Extends the probe timeout and adds verification lifecycle logging. |
| docs/specs/cli-config-sources.md | Documents the 30-second probe limit and cancellation behavior. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
✅ No documentation update needed. docs_required → proven false positive (no user-facing change). Triggered signals: |
Description
Unattended configuration-source Git acquisition can reject a valid OpenSSH client when its version process takes more than five seconds to start. Two Windows cases in the CI run for #21572 failed just beyond that cutoff.
Allow up to 30 seconds for version probing while honoring the enclosing acquisition cancellation budget. Preserve executable selection, successful-exit and OpenSSH-banner validation, and
BatchMode=yes. Add lifecycle-only debug logging and regression coverage for slow startup, invalid banners, nonzero exits, and cancellation. No new dependencies are required.This branch starts from main after #21572 merged and contains only the SSH fix, tests, and directly related documentation. Temporary investigation workflow changes and stress tests are excluded.
User-facing usage
For an app with an SSH-backed configuration source, the existing unattended update command is unchanged:
Slow OpenSSH initialization no longer fails solely because it exceeds five seconds. The overall acquisition deadline still applies. There are no command syntax, help-text, or output-format changes.
Validation
On this branch, based on the latest main:
Passed: 391 tests; four Linux-only tests skipped on Windows.
During the investigation, before changing the timeout:
Failed as expected: the deterministic six-second startup case returned
TimedOutafter 5.099 seconds; the other four cases passed. All five pass with the fix.After building the fix, the following command passed in 20 repetitions on Windows, totaling 200 cases:
Cross-platform CI verification passed all 27 Git runner class iterations: three runners per OS and three iterations per runner across Windows, Linux, and macOS. This ran on the temporary investigation branch, before the latest-main refresh, and included the original failing cases, deterministic regressions, and a temporary concurrent-startup harness.
The original flake did not reproduce naturally: 375 isolated and 144 concurrent Windows CI cases passed before the fix. The controlled regression confirms the five-second cutoff failure mode, not the precise cause of the original runner delay. Investigation #21685 is closed.
git diff --check: passed. This new PR's full CI has not yet run.Security considerations
SSH executable selection, custom-command rejection, OpenSSH-banner and exit-code checks, and
BatchMode=yesare unchanged. The version probe remains bounded and honors caller cancellation. Logs contain only elapsed time, exit code, failure kind, and cancellation state, not commands, paths, or captured output.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?