[bug-fix] Fix windows-copilot-executable: discover the Windows Copilot executable - #4770
Closed
github-actions[bot] wants to merge 1 commit into
Closed
github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
|
|
||
| def test_copilot_windows_discovers_exe_on_path(monkeypatch): | ||
| """A native Windows executable is selected when it is the only match.""" | ||
| import specify_cli.integrations.copilot as copilot |
|
|
||
| def test_copilot_windows_prefers_exe_over_cmd(monkeypatch): | ||
| """Windows executable discovery uses the documented candidate order.""" | ||
| import specify_cli.integrations.copilot as copilot |
|
|
||
| def test_copilot_windows_keeps_historical_fallback(monkeypatch): | ||
| """Missing Windows candidates retain the historical executable name.""" | ||
| import specify_cli.integrations.copilot as copilot |
|
|
||
| def test_copilot_executable_env_var_precedes_path_discovery(monkeypatch): | ||
| """The explicit executable override remains higher priority than PATH.""" | ||
| import specify_cli.integrations.copilot as copilot |
|
|
||
| def test_copilot_dispatch_command_uses_path_discovery(monkeypatch): | ||
| """Command dispatch uses the executable discovered on Windows PATH.""" | ||
| import specify_cli.integrations.copilot as copilot |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug fix — windows-copilot-executable
Proposed fix for issue #4755, applying the
remediation from the bug assessment.
Verdict: valid · Severity: medium
Summary
Windows Copilot executable selection now discovers available CLI forms on
PATH, preferring nativecopilot.exewhile preserving the existingcopilot.cmdfallback. ExplicitSPECKIT_INTEGRATION_COPILOT_EXECUTABLEoverrides remain highest priority, including for workflow dispatch.Changes
src/specify_cli/integrations/copilot/__init__.pycopilot.exe,copilot.cmd, orcopiloton Windows with a historical fallback.tests/integrations/test_extra_args.pyTests Added or Updated
test_copilot_windows_discovers_exe_on_path— native.exediscovery.test_copilot_windows_prefers_exe_over_cmd— deterministic candidate precedence.test_copilot_windows_keeps_historical_fallback— fallback when no candidate is available.test_copilot_executable_env_var_precedes_path_discovery— explicit override precedence.test_copilot_dispatch_command_uses_path_discovery— workflow dispatch uses the discovered executable.Local Verification
python3 -m compileall -q src/specify_cli/integrations/copilot tests/integrations/test_extra_args.py→ passed.git diff --check→ passed.python3 -m pytest tests/integrations/test_extra_args.py -q→ not run becausepytestis not installed in the environment.Deviations from Assessment
None.
Risks & Review Notes
copilot.exe, thencopilot.cmd, thencopilot.copilot.cmdfallback remains when no candidate is found.Refs #4755 · cc
@nicolehaugencopilot.cmd, breaking installs that shipcopilot.exe#4755