Skip to content

Release automation: wip replacement pattern in feature files only matches vwip, not bare wip #211

@hdamker

Description

@hdamker

Problem description

The test_def_api_version transformation in release_automation/config/transformations.yaml expects vwip (with leading v) in the Feature declaration of code/Test_definitions/*.feature files:

- name: test_def_api_version
  file_pattern: "code/Test_definitions/*.feature"
  pattern: "(Feature: .*?) vwip\\b"

When a feature file uses bare wip instead, the pattern does not match and the literal wip survives into the snapshot. Example observed in Simple Edge Discovery:

Feature: CAMARA Simple Edge Discovery API, wip - Operation readClosestEdgeCloudZone

wip vs vwip in a Feature line is a style variation — comparable to 0.1.0 vs v0.1.0 — and the transformation should normalize both.

Current P-007 behavior

P-007 check-test-file-version reads the first line and requires a v prefix (regex ,\s*(v\S+?)). Bare wip does not match, so P-007 returns "has no version in its Feature line (expected 'vwip')". In pre-snapshot validation for Simple Edge Discovery this was emitted as a hint and did not block snapshot, so bare wip was carried through T1b (no match) and had to be corrected by hand in the Release Review PR.

Expected behavior

Two complementary fixes:

  1. Relax T1b pattern to accept both vwip and bare wip. Backwards compatible — existing vwip content continues to match. P-007's parser regex should also be relaxed so valid bare wip on main/maintenance does not fire false hints.
  2. Escalate P-007 to error when the Feature line has nothing the transformation can replace — after (1), when neither vwip nor wip is present. Today this surfaces as a hint, which is easy to miss and allowed the Simple Edge Discovery bug to slip through even though P-007 flagged it.

Out of scope — scenario URL paths

Transformation T2b handles /vwip in feature-file scenario steps (e.g. POST /quality-on-demand/vwip/sessions). Unlike the Feature-line case, bare /wip in a URL path is not a style variation — it is wrong. That gap is tracked separately in #212.

Additional context

Observed while reviewing the Release Review PR for Simple Edge Discovery API. Pre-snapshot validation output showed the P-007 hint as expected:

Hints
Rule   File                                                    Line  Message
P-007  code/Test_definitions/simple-edge-discovery.feature     1     Test file 'simple-edge-discovery.feature' has no version in its Feature line (expected 'vwip')

Metadata

Metadata

Assignees

No one assigned

    Labels

    correctionrelease automationRelated to the implementation or introduction of new release automation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions