Skip to content

fix(validation): flag hyphenated URL version segments#369

Merged
hdamker merged 1 commit into
camaraproject:mainfrom
hdamker:fix/p025-version-segment-hyphen
Jul 8, 2026
Merged

fix(validation): flag hyphenated URL version segments#369
hdamker merged 1 commit into
camaraproject:mainfrom
hdamker:fix/p025-version-segment-hyphen

Conversation

@hdamker

@hdamker hdamker commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

bug

What this PR does / why we need it:

The feature-file scenario-step version check (P-025) and the server-URL version check (P-004) captured the URL version segment with a v[a-z0-9.]+ charset. A hyphenated segment like v0.1-eri matched only v0.1; the trailing - then failed the match, so P-025 silently skipped the line and P-004 reported a misleading no recognisable version segment. A valid CAMARA version segment never contains a hyphen (build_version_segment strips them), so such a segment is always malformed and should error.

The effect was a divergence: a malformed segment passed PR-time validation but was caught by the pre-snapshot wip check, blocking snapshot creation with errors that never appeared on the PR.

Both checks now share one helper that captures the whole path segment after the api-name and compares it to the expected segment, so any deviation — hyphen, typo, bare wip, or a wrong version — is flagged, and the two version checks cannot drift.

Which issue(s) this PR fixes:

Fixes #367

Special notes for reviewers:

  • Anchoring on the api-name means a misspelled api-name in a URL is not located (a recorded residual, backstopped by the wip check). This keeps a false positive off correct PRs, which matters more for an always-error gate than closing the compound-typo case.
  • Verified against the real DedicatedNetworks dedicated-network-areas.feature: the three v0.1-eri lines now flag, matching what the snapshot gate reported (fixed content-side in Correcting URL in API test definition file DedicatedNetworks#127).
  • Existing P-025 tests were using an api-name (qod) that did not match their URL path (/quality-on-demand/…); the URLs are corrected so the test data reflects the real shape where the URL api-name matches the API.

Changelog input

 release-note
P-025 and P-004 now flag hyphenated (malformed) URL version segments instead of silently skipping them.

Additional documentation

This section can be blank.

docs

The feature-file (P-025) and server-URL (P-004) version checks captured the
segment with a `v[a-z0-9.]+` charset, so a hyphenated segment like `v0.1-eri`
matched only `v0.1`, the trailing `-` failed the match, and the line was
silently skipped — a false negative that let the pre-snapshot wip check block a
snapshot the PR check had passed. Both checks now share one helper that captures
the whole path segment after the api-name and compares it to the expected
segment, so any deviation is flagged.

@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

@Kevsy Kevsy 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 hdamker merged commit 1ae58c4 into camaraproject:main Jul 8, 2026
8 checks passed
@hdamker hdamker deleted the fix/p025-version-segment-hyphen branch July 8, 2026 11:38
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.

Validation: P-025 silently skips hyphenated URL version segments in feature-file steps

3 participants