Skip to content

Conversation

@graysurf
Copy link
Owner

@graysurf graysurf commented Jan 22, 2026

Resolve api-report-from-cmd report paths

Summary

Ensure api-report-from-cmd resolves --out and --response paths relative to the derived project root, and add a regression test for relative path handling.

Problem

  • Expected: Relative --out/--response paths resolve to the project root derived from --config-dir.
  • Actual: Relative paths are passed through unchanged, so running outside the repo reads/writes in the wrong directory.
  • Impact: Report generation can fail with missing response files or write output to unintended locations.

Reproduction

  1. Initialize a repo with setup/graphql under a sample project.
  2. Run api-report-from-cmd --dry-run --out out/report.md --response out/response.json --stdin with a gql.sh snippet that sets --config-dir to that repo.
  • Expected result: The generated command uses absolute paths under the project root for --out and --response.
  • Actual result: The generated command keeps the relative paths (e.g., out/report.md), resolving relative to the current working directory.

Issues Found

Severity: medium
Confidence: high
Status: fixed

ID Severity Confidence Area Summary Evidence Status
PR-66-BUG-001 medium high commands/api-report-from-cmd Relative --out/--response paths not resolved to project root commands/api-report-from-cmd (resolve_in_project usage) fixed

Fix Approach

  • Resolve --out and --response through resolve_in_project when a project root is available.
  • Add a test covering relative output/response paths.

Testing

  • python3 -m pytest tests/test_api_report_from_cmd.py (fails: No module named pytest)

Risk / Notes

  • Low risk: path resolution only changes when project_root is known; absolute paths are unchanged.

- Resolve --out/--response relative to derived project root
- Cover relative path resolution in api-report-from-cmd tests
@graysurf graysurf merged commit 6f8b19e into main Jan 22, 2026
6 checks passed
@graysurf graysurf deleted the fix/medium-api-report-resolve-paths branch January 22, 2026 15:55
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.

2 participants