Skip to content

Fix remaining gplint findings in the feature templates - #683

Merged
rartych merged 4 commits into
camaraproject:mainfrom
hdamker:fix/682-template-gplint-findings
Aug 3, 2026
Merged

Fix remaining gplint findings in the feature templates#683
rartych merged 4 commits into
camaraproject:mainfrom
hdamker:fix/682-template-gplint-findings

Conversation

@hdamker

@hdamker hdamker commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • correction

What this PR does / why we need it:

gplint over artifacts/testing/*.feature reported 16 warnings. This PR clears all 16 without adding or removing a single scenario, step, Examples table or tag.

1. Placeholder syntax (6 warnings, plus consistency)

Angle brackets are Gherkin's Scenario Outline variable syntax. In sample-service-template.feature they were also used for hand-substituted placeholders, in scenarios that do have an Examples table — so gplint reported them as variables missing from that table, and a Gherkin runner would try to substitute them. The two conventions sat side by side in the same file — When the request "<createResource>" is sent in the happy-path scenarios against When the request "{operationId}" is sent in the error scenarios. That is the change this PR needs to make.

The same mixed usage sits in sample-implicit-events-template.feature and event-subscription-template.feature. It reports nothing today only because those placeholders are in plain scenarios with no Examples table to collide with — the trap springs the moment anyone adds one. Leaving them would also mean two conventions across the templates an API repository copies together, so the same normalisation is applied there for consistency.

The result is a rule that is now checkable: every remaining angle-bracket token in artifacts/testing/ is a declared Examples column, so angle brackets carry exactly one meaning. The genuine Examples variables keep them — <property>, <condition>, <required_property>, <device_identifier>, <oas_spec_schema>, <unsupported_credential_type>.

2. Duplicate scenario names (10 warnings)

In event-subscription-template.feature, scenarios 12 to 16 carried the names of scenarios 01 and 06. These are additive, not alternatives — a subscription API keeps all of them, so the duplicates propagate into every *-subscriptions.feature copied from the template. They now carry the distinction their tags already make (sinkCredential type, provisioning mode).

In sample-service-template.feature, "Common validations for any success scenario" appeared six times: three mutually exclusive variants of one scenario, of which an author keeps one, and three different operations. Each now carries a suffix — the variant condition, or the operation. The name is extended rather than replaced, matching how API repositories already distinguish it (for example "… with 3-legs authentication"), so it stays recognisable across the 39 feature files that use it.

Verification: gplint with the tooling-pinned config reports 0 problems. Every commit is line-for-line — the counts of Scenario, Scenario Outline, Examples:, tag lines and table rows are identical before and after.

Which issue(s) this PR fixes:

Fixes #682

Does this PR introduce a breaking change?

  • Yes
  • No

Special notes for reviewers:

Built on top of #678, which normalises line endings in the same files — please merge that one first. Developing from main instead would have conflicted with it across all 550 lines of the event subscription template.

Draft while #678 is pending: because this branch is based on #678's head, the diff below currently also contains its commit 05d7158. Once #678 merges I will rebase onto main, and the diff reduces to the three commits described here — already verified by replaying them onto a simulated post-merge main.

The three commits are separate on purpose: the required fix, then each consistency file, so they can be reviewed independently.

event-subscription-template.feature is the largest diff but the smallest change: one placeholder, <xxx>, appears 146 times. Its header already described these as substitution placeholders and now reads "We use {xxx} as the subscription resource prefix".

Changelog input

 release-note
Feature file templates: placeholders use the {…} convention consistently, and duplicate scenario names are made distinct. No scenario, step, Examples table or tag is added or removed.

Additional documentation

This section can be blank.

docs

hdamker added 3 commits July 29, 2026 17:09
…nario names (camaraproject#682)

Angle brackets are Gherkin Scenario Outline syntax, so template placeholders
written that way are reported as variables missing from the Examples table and
would be substituted by a runner; only the genuine Examples variables keep them.
The duplicated scenario names are made distinct per variant and per operation so
they no longer propagate into every API repository that copies these templates.
…camaraproject#682)

Same defect as the previous commit, in a plain Scenario rather than a Scenario
Outline, so gplint never reported it: no-unused-variables only compares against
an Examples table. The genuine Examples variable is left in angle brackets, and
the scenario tag is renamed to 2xx to match the status code the scenario asserts.
…amaraproject#682)

Completes the convention across artifacts/testing: every angle-bracket token
that remains in these feature files is now a declared Examples column, so angle
brackets carry exactly one meaning again. Only the bracket style changes here -
the header already described these as substitution placeholders.
PedroDiez
PedroDiez previously approved these changes Jul 30, 2026

@PedroDiez PedroDiez 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 dismissed PedroDiez’s stale review July 30, 2026 11:35

The merge-base changed after approval.

@hdamker
hdamker requested a review from PedroDiez July 30, 2026 11:37
@hdamker
hdamker marked this pull request as ready for review July 30, 2026 11:37

@PedroDiez PedroDiez 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

@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

@bigludo7 bigludo7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@rartych
rartych merged commit c2dde70 into camaraproject:main Aug 3, 2026
2 checks passed
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.

Feature file templates: fix the remaining gplint findings (placeholder syntax, scenario names)

5 participants