Skip to content

feat(validation): add a one-command local validation run - #471

Merged
hdamker merged 4 commits into
camaraproject:mainfrom
hdamker:fix/spectral-binary-via-env
Oct 10, 2026
Merged

hdamker merged 4 commits into
camaraproject:mainfrom
hdamker:fix/spectral-binary-via-env

Conversation

@hdamker

@hdamker hdamker commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • enhancement/feature
  • tests

What this PR does / why we need it:

Adds validation/scripts/validate_local.py, which runs the full CAMARA Validation orchestrator against a local clone of an API repository with one command. Until now a local run needed the venv, npm ci, node_modules/.bin on PATH, nine VALIDATION_* variables and a settings override, none of it documented. The Node install can now live outside the checkout: CAMARA_NODE_MODULES (or a spectral on PATH inside a node_modules/.bin) is used by the script, the Spectral and bundling tests and the YAML parser conformance helper (P-037).

  • Contributors and API teams can check the full verdict before opening a PR: python3 validation/scripts/validate_local.py <repo-path> prints the result and the findings per file, and exits 0 / 1 / 2 for pass or advisory / fail / error.
  • The script stops when Spectral, gplint or Redocly is missing from the resolved install instead of using whatever spectral is first on PATH.
  • P-037 no longer picks up a js-yaml from a parent directory when validation/node_modules is absent; it uses the pinned version or fails visibly.

Which issue(s) this PR fixes:

n/a

Special notes for reviewers:

The run is a workflow_dispatch run of the checked-out branch with a shipped settings override (validation/scripts/local-validation-settings.yaml) that enables validation for any repository. The ruleset follows release-plan.yaml, as in CI. Rules that need PR context do not fire locally, so the PR check remains the authoritative result. Against camaraproject/ReleaseTest main the script reports advisory with 6 hints. .gitignore now ignores node_modules without the trailing slash, so a symlinked install is ignored too.

Changelog input

 release-note
Add validation/scripts/validate_local.py for a one-command local CAMARA Validation run; Node tools can be provided via CAMARA_NODE_MODULES

Additional documentation

docs
validation/docs/contributor-guide.md — Running validation locally

Node's walk-up resolution let the parser conformance helper pick up any js-yaml
in a parent directory when validation/node_modules is absent, silently changing
P-037 results. The helper now resolves from CAMARA_NODE_MODULES or
validation/node_modules and fails when js-yaml is not there.
@hdamker
hdamker marked this pull request as ready for review October 10, 2026 11:53
@hdamker
hdamker requested review from Kevsy and rartych as code owners October 10, 2026 11:53
@hdamker
hdamker merged commit 8e0b910 into camaraproject:main Oct 10, 2026
8 checks passed
@hdamker
hdamker deleted the fix/spectral-binary-via-env branch October 10, 2026 11:57
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.

1 participant