Skip to content

Fix paths-only validation in check-prerequisites#2571

Open
prantikmedhi wants to merge 1 commit into
github:mainfrom
prantikmedhi:fix/check-prerequisites-paths-only
Open

Fix paths-only validation in check-prerequisites#2571
prantikmedhi wants to merge 1 commit into
github:mainfrom
prantikmedhi:fix/check-prerequisites-paths-only

Conversation

@prantikmedhi
Copy link
Copy Markdown

Fixes #2477.

  • Move branch validation after the paths-only early exit in bash and PowerShell
  • Add a regression test for paths-only on a non-feature branch

Validated with:

  • bash scripts/bash/check-prerequisites.sh --json --paths-only
  • bash scripts/bash/check-prerequisites.sh --json (still fails on main as expected)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / -PathsOnly on 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)
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented May 18, 2026

Please address Copilot feedback. If not applicable, please explain why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: check-prerequisites.sh --paths-only still runs branch validation, contradicting --help

3 participants