You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Azure CLI executable resolution for Azure DevOps authentication. Resolve only absolute executable candidates from absolute PATH entries outside the current working directory, including checks for symlink aliases. Retain Windows PATHEXT support for the Azure CLI shim and return no token when no eligible executable is found instead of falling back to bare az.
Update authentication documentation and executable-resolution coverage, and give the catalog authentication tests explicit Azure CLI executable fixtures.
Testing
Tested locally with uv run specify --help
Ran existing tests with uv sync && uv run pytest
Tested with a sample project (if applicable)
Validation used this worktree's own virtual environment, as recommended in CONTRIBUTING.md, rather than the bare uv run pytest invocation above:
Sample-project slash-command testing is not applicable to this authentication-only change. Validation ran on macOS; native Windows execution was not performed.
AI Disclosure
I did not use AI assistance for this contribution
I did use AI assistance (fill in the disclosure below)
AI disclosure: GitHub Copilot using GPT-6.1 Sol (model ID: gpt-6.1-sol) in autonomous agent mode under user direction, with no explicit reasoning-effort override, generated the implementation, tests, documentation, commit message, and PR description and ran the automated validation. No human line-by-line review is claimed.
Resolve Azure CLI from absolute PATH entries outside the current working directory without a bare-name fallback. Preserve Windows shim discovery and update authentication documentation and dependent test fixtures.
Assisted-by: GitHub Copilot (model: GPT-6.1 Sol, autonomous)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Azure CLI resolution can still launch project-local executables on case-insensitive macOS volumes and fail to discover Windows shims on supported Python 3.11.
The reason will be displayed to describe this comment to others. Learn more.
The executable-target check follows symlink chains with realpath() and compares the resolved parent to the working directory using samefile(). The existing cases cover direct and case-aliased targets in cwd, rejection with and without a later valid installation, and acceptance of external targets. Commit 4d64989c2330683719ba4cc39ab4c09cc3355825 adds chained executable links back into cwd to the same cases; both are rejected without launching the cwd executable. I have not reproduced a symlink bypass in these paths. Absolute PATH entries for child directories remain intentionally eligible, as documented. This thread is left unresolved for your review. Posted on behalf of @mnriem by GitHub Copilot (model: GPT-6.1 Sol, autonomous agent mode, no explicit reasoning-effort override); the implementation, tests, and this reply were AI-generated.
Use filesystem identity checks to exclude current-directory aliases and executable symlinks. Probe explicit PATHEXT candidates for Python 3.11 compatibility, normalize Windows test assertions, and cover symlink and inspection-failure paths.
Assisted-by: GitHub Copilot (model: GPT-6.1 Sol, autonomous)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Addressed all four findings in 0811744: executable discovery now uses filesystem identity for both directory checks, explicitly probes Windows PATHEXT candidates for Python 3.11 compatibility, normalizes Windows path assertions, and covers executable symlinks into the working directory, fallback installations, external targets, and inspection failures. The full macOS suite passed with 13,696 passed and 130 skipped; native Windows validation is pending CI, and Python 3.11 Windows lookup behavior is covered by simulated regression tests. Threads remain unresolved. Posted on behalf of @mnriem by GitHub Copilot (model: GPT-6.1 Sol, autonomous agent mode, no explicit reasoning-effort override); the implementation, tests, documentation, and this comment were AI-generated.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The authentication documentation overstates PATH protection by claiming project-local executables are excluded even though absolute entries for project subdirectories remain eligible.
Narrow PATH protection scope to current-directory aliases
docs/reference/authentication.md:232
An absolute PATH entry such as <cwd>/.venv/bin is still accepted, so the claim that project-local executables are excluded overstates the authentication protection. Describe the narrower rule—excluding the current directory itself and its aliases—and state that absolute entries for its subdirectories remain eligible.
Describe the current-directory and alias exclusion precisely, and state that absolute PATH entries for working-directory subdirectories remain eligible.
Assisted-by: GitHub Copilot (model: GPT-6.1 Sol, autonomous)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Clarified the authentication documentation in dcafe14: discovery excludes the current directory itself and its symlink/case aliases, while absolute PATH entries for subdirectories such as /.venv/bin remain eligible. This is a documentation-only correction, with no executable behavior changes. The two carried-over findings were addressed in 0811744: authentication and catalog assertions compare Windows paths using normcase, and executable-symlink tests cover rejecting current-directory targets with and without a later valid installation and accepting external targets. Threads remain unresolved. Posted on behalf of @mnriem by GitHub Copilot (model: GPT-6.1 Sol, autonomous agent mode, no explicit reasoning-effort override); the documentation change and this comment were AI-generated.
Exercise real executable discovery from an absolute .venv/bin PATH entry beneath the working directory. Reuse the platform fixture so Windows covers both executable and command shims, and mock only process execution.
Assisted-by: GitHub Copilot (model: GPT-6.1 Sol, autonomous)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Added positive coverage in 5bd403a: test_resolve_token_azure_cli_absolute_path_beneath_cwd verifies successful token acquisition through an absolute /.venv/bin PATH entry using real filesystem discovery, with only subprocess execution mocked. The shared executable fixture also exercises .exe and .cmd installations on Windows. The existing test_resolve_token_azure_cli_executable_symlinks cases cover rejecting executable symlinks into the working directory both with and without a later valid installation, and accepting symlinks to external installations. All 371 authentication tests passed locally. This change adds tests only; runtime behavior and documentation are unchanged, and review threads remain unresolved. Posted on behalf of @mnriem by GitHub Copilot (model: GPT-6.1 Sol, autonomous agent mode, no explicit reasoning-effort override); the test and this comment were AI-generated.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed to evaluate a potential symlink-based bypass of current-directory execution protections and excessive Windows executable-lookup overhead.
Addressed the Windows lookup overhead in 4d64989 by checking each explicit PATHEXT candidate directly rather than invoking another extension-expanding shutil.which lookup. Regression coverage verifies candidate probe counts for found, missing, and inaccessible executables; the current-directory target check is preserved, and chained executable symlinks into cwd are now covered with and without a later valid installation. No symlink bypass was reproduced in these cases. The full macOS suite passed with 13,708 passed and 130 skipped; native Windows validation is pending CI. Replied in the existing symlink thread without resolving it. Posted on behalf of @mnriem by GitHub Copilot (model: GPT-6.1 Sol, autonomous agent mode, no explicit reasoning-effort override); the implementation, tests, and this comment were AI-generated.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human judgment is needed to assess the minor mismatch between the authentication test’s description and the resolved-CLI launch-failure path it now covers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
triage-must-haveVerdict: high-value, important work for Spec Kit — do first
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix Azure CLI executable resolution for Azure DevOps authentication. Resolve only absolute executable candidates from absolute
PATHentries outside the current working directory, including checks for symlink aliases. Retain WindowsPATHEXTsupport for the Azure CLI shim and return no token when no eligible executable is found instead of falling back to bareaz.Update authentication documentation and executable-resolution coverage, and give the catalog authentication tests explicit Azure CLI executable fixtures.
Testing
uv run specify --helpuv sync && uv run pytestValidation used this worktree's own virtual environment, as recommended in
CONTRIBUTING.md, rather than the bareuv run pytestinvocation above:uv run specify --help— passed.LC_ALL=en_US.UTF-8 .venv/bin/python -m pytest tests/specify_cli/authentication tests/specify_cli/workflows/test_mcp.py -q -o addopts='' --disable-warnings— passed: 395 tests.LC_ALL=en_US.UTF-8 .venv/bin/python -m pytest tests -q -n 4 -o addopts='' --disable-warnings— passed: 13,673 passed, 130 skipped, 63 warnings.Sample-project slash-command testing is not applicable to this authentication-only change. Validation ran on macOS; native Windows execution was not performed.
AI Disclosure
AI disclosure: GitHub Copilot using GPT-6.1 Sol (model ID:
gpt-6.1-sol) in autonomous agent mode under user direction, with no explicit reasoning-effort override, generated the implementation, tests, documentation, commit message, and PR description and ran the automated validation. No human line-by-line review is claimed.