Fix paths-only validation in check-prerequisites - #2571
prantikmedhi wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes check-prerequisites paths-only mode so branch validation is skipped before returning path data, matching the documented “no validation” behavior.
Changes:
- Moves branch validation after the paths-only early exit in Bash and PowerShell scripts.
- Adds regression tests for
--paths-only/-PathsOnlyon a non-feature branch.
Show a summary per file
| File | Description |
|---|---|
scripts/bash/check-prerequisites.sh |
Defers feature-branch validation until after paths-only output. |
scripts/powershell/check-prerequisites.ps1 |
Mirrors the Bash validation ordering for PowerShell. |
tests/test_check_prerequisites_paths_only.py |
Adds Bash and PowerShell regression coverage for paths-only branch-validation skipping. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 4
|
Please address Copilot feedback. If not applicable, please explain why |
|
Addressed the Copilot feedback in the regression test fixture:
Validation: |
| env.pop("SPECIFY_FEATURE", None) | ||
| env.pop("SPECIFY_FEATURE_DIRECTORY", None) |
| subprocess.run(["git", "init", "-q", "--initial-branch", "main"], cwd=tmp_path, check=True) | ||
| subprocess.run(["git", "config", "user.email", "test@example.com"], cwd=tmp_path, check=True) | ||
| subprocess.run(["git", "config", "user.name", "Test User"], cwd=tmp_path, check=True) | ||
| subprocess.run(["git", "commit", "--allow-empty", "-m", "init", "-q"], cwd=tmp_path, check=True) | ||
|
|
| payload = json.loads(result.stdout) | ||
| assert payload["BRANCH"] == "main" | ||
| assert payload["FEATURE_DIR"].endswith("specs/001-test") | ||
|
|
| assert result.returncode == 0, result.stderr | ||
| payload = json.loads(result.stdout) | ||
| assert payload["BRANCH"] == "main" | ||
| assert payload["FEATURE_DIR"].endswith("specs/001-test") |
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback and resolve conflicts
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed in 30 days if no further activity occurs. |
Fixes #2477.
Validated with: