Skip to content

refactor(phpunit): move ConsoleOutput's warning prefix to [Gesso] with the console_report rename #524

Description

@wadakatu

背景

#504 (PR for the GESSO_* env rename) found the inconsistency it names in its
"Current behavior" section: the two env-driven resolvers write the same kind of
invalid-value fallback under different prefixes.

// src/ValidationOutput.php:50
fwrite(STDERR, "[Gesso] WARNING: Invalid GESSO_VALIDATION_FORMAT value ...");

// src/PHPUnit/ConsoleOutput.php:37
fwrite(STDERR, "[OpenAPI Coverage] WARNING: Invalid GESSO_CONSOLE_OUTPUT value ...");

#504 planned to fix it in the same change and its acceptance criteria say
ConsoleOutput.php should emit [Gesso] WARNING:. That was dropped from the
#504 PR
and moved here.

問題

tests/Unit/Compatibility/DiagnosticPrefixesBaselineTest::identity_neutral_prefixes_retain_v1_9_parity
asserts that every prefix outside $brandedPrefixes ([openapi-contract-testing],
[Gesso], [Gesso deprecation]) is byte-identical between
tests/fixtures/compatibility/v1.9-diagnostic-prefixes.json and
v2-diagnostic-prefixes.json. Moving ConsoleOutput.php's two emissions out of
[OpenAPI Coverage] breaks it.

Keeping the test passing would require adding [OpenAPI Coverage] to
$brandedPrefixes — the largest neutral prefix, 35 emissions across 6 files —
which guts the guard for a cosmetic change. #504 checked docs/versioning.md:99
(where [OpenAPI Coverage] is indeed absent, so no documented contract is
touched) but not this test, which is stricter than the policy.

Doing it in a v2 minor is therefore the wrong release. In v3 the parity guard's
premise ends anyway: #502 renames the setting itself to console_report, and the
prefix can move with it.

やること

  • Change both fwrite(STDERR, ...) calls in src/PHPUnit/ConsoleOutput.php to
    the [Gesso] WARNING: prefix.
  • Move the src/PHPUnit/ConsoleOutput.php row from [OpenAPI Coverage] to
    [Gesso] in tests/fixtures/compatibility/v2-diagnostic-prefixes.json.
  • Decide what identity_neutral_prefixes_retain_v1_9_parity asserts once v3 is
    allowed to move neutral prefixes — retire it, or re-baseline it against a v3
    fixture. Record the decision in docs/versioning.md.

ゴール

  • rg '\[OpenAPI Coverage\]' src/PHPUnit/ConsoleOutput.php returns nothing.
  • The diagnostic-prefix baseline tests state what they pin for v3 rather than
    being edited around.
  • composer ci passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions