Skip to content

fix(validation): replace gherkin-lint with GPLint - #340

Merged
hdamker merged 6 commits into
camaraproject:mainfrom
hdamker:fix/gplint-gherkin-lint
Jun 17, 2026
Merged

fix(validation): replace gherkin-lint with GPLint#340
hdamker merged 6 commits into
camaraproject:mainfrom
hdamker:fix/gplint-gherkin-lint

Conversation

@hdamker

@hdamker hdamker commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

cleanup

What this PR does / why we need it:

This PR replaces the validation framework Gherkin linter dependency from gherkin-lint to GPLint.

gherkin-lint pulls in stale Cucumber packages and the vulnerable uuid dependency chain behind Dependabot alert #17. GPLint is a maintained fork with current Cucumber packages, while preserving the same rule model closely enough for a narrow migration.

The change keeps CAMARA Validation v1 behavior stable while leaving legacy v0 validation untouched:

  • preserves the validation engine identity as gherkin
  • preserves the existing G-001 through G-025 rule metadata mapping
  • adds a dedicated GPLint config at linting/config/.gplintrc
  • keeps linting/config/.gherkin-lintrc compatible with the v0 MegaLinter / gherkin-lint workflow and marks it deprecated
  • removes the unsupported disabled only-one-when entry from the GPLint config only
  • migrates required-tags.tags to GPLint's required-tags.scenario regex-array shape in .gplintrc
  • updates validation v1 to invoke gplint and parse JSON findings from exit code 0 or 1

Which issue(s) this PR fixes:

Fixes #138

Special notes for reviewers:

The full validation/ audit is still non-zero after this PR because of unrelated Redocly/OpenTelemetry/Redoc/protobufjs advisories. This PR is expected to clear the uuid alert path only.

Local verification for the final config split:

  • python3 -m pytest validation/tests/test_gherkin_adapter.py validation/tests/test_rule_metadata_integrity.py validation/tests/test_orchestrator.py
  • python3 -m pytest validation/tests tooling_lib/tests
  • live gplint --format json --config linting/config/.gplintrc ... smoke test
  • git diff --check
  • npm ci --ignore-scripts in validation/ as the package manifest/lockfile sync gate
  • optional dependency-tree follow-up: npm ls gplint gherkin-lint uuid

Changelog input

 release-note
Replace the validation v1 Gherkin feature-file linter dependency from `gherkin-lint` to GPLint while preserving existing Gherkin validation rule IDs and finding normalization. The legacy v0 `.gherkin-lintrc` remains for the deprecated MegaLinter workflow; GPLint uses `linting/config/.gplintrc`.

Additional documentation

This section can be blank.

docs

hdamker added 2 commits June 17, 2026 11:03
GPLint is a maintained fork of gherkin-lint with current Cucumber dependencies, which removes the stale cucumber-messages/uuid dependency chain behind Dependabot alert camaraproject#17. Keep the validation engine identity and G-001 through G-025 rule mapping stable while migrating the config and adapter to GPLint JSON output.
Regenerate validation/package-lock.json with npm 10.8.2 so GitHub Actions Node 20 npm ci includes GPLint optional peer dependencies.
@hdamker
hdamker marked this pull request as ready for review June 17, 2026 10:09
@hdamker
hdamker requested review from Kevsy and rartych as code owners June 17, 2026 10:09
@hdamker
hdamker marked this pull request as draft June 17, 2026 10:43
@hdamker

hdamker commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Changed back to draft to decouple the new configuration from the validation v0 configuration (Megalinter is still using gherkin-lint and the configuration file).

@hdamker

hdamker commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Done: I split the Gherkin linter configs so validation v1 uses GPLint's standard linting/config/.gplintrc, while the legacy v0 MegaLinter workflow keeps linting/config/.gherkin-lintrc in the old gherkin-lint schema. Back to review.

@hdamker
hdamker marked this pull request as ready for review June 17, 2026 11:31
rartych
rartych previously approved these changes Jun 17, 2026

@rartych rartych left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

hdamker added 2 commits June 17, 2026 16:48
Include the required typescript peer from ts-node, introduced via GPLint optional dependency resolution, so the lock matches CI npm.
@hdamker

hdamker commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Note: CI failed because npm resolver drift around GPLint’s optional ts-node dependency left the required typescript peer out of validation/package-lock.json; the branch now regenerates the lock with CI’s npm and adds validation-local engine/Node guardrails so stale local npm versions fail before producing divergent locks.

@hdamker
hdamker merged commit 6c3b1a1 into camaraproject:main Jun 17, 2026
8 checks passed
@hdamker
hdamker deleted the fix/gplint-gherkin-lint branch June 17, 2026 15:01
@hdamker hdamker mentioned this pull request Jun 19, 2026
12 tasks
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.

Monitor gherkin-lint maintenance status and evaluate alternatives

2 participants