Fix paths-only validation in check-prerequisites#2571
Open
prantikmedhi wants to merge 1 commit into
Open
Conversation
Contributor
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
Comment on lines
+21
to
+24
| subprocess.run(["git", "init", "-q"], 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", "checkout", "-b", "main"], cwd=tmp_path, check=True) |
Comment on lines
+37
to
+43
| result = subprocess.run( | ||
| ["bash", str(BASH_SCRIPT), "--json", "--paths-only"], | ||
| cwd=git_repo, | ||
| text=True, | ||
| capture_output=True, | ||
| check=False, | ||
| ) |
Comment on lines
+53
to
+59
| result = subprocess.run( | ||
| ["pwsh", "-NoLogo", "-NoProfile", "-File", str(PS_SCRIPT), "-Json", "-PathsOnly"], | ||
| cwd=git_repo, | ||
| text=True, | ||
| capture_output=True, | ||
| check=False, | ||
| ) |
Comment on lines
+21
to
+24
| subprocess.run(["git", "init", "-q"], 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", "checkout", "-b", "main"], cwd=tmp_path, check=True) |
Collaborator
|
Please address Copilot feedback. If not applicable, please explain why |
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.
Fixes #2477.
Validated with: