Skip to content

Record a replayable HAR corpus from the compliance run - #5456

Open
sethboyles wants to merge 1 commit into
mainfrom
openapi-compliance-har
Open

sethboyles wants to merge 1 commit into
mainfrom
openapi-compliance-har

Conversation

@sethboyles

Copy link
Copy Markdown
Member

The compliance suite needs a live foundation and about an hour to answer "does the API match the spec?". Capture the traffic once and later spec changes can be replayed against the recording in seconds.

Adds:

  • bin/har-recorder.js, a dependency-free HAR 1.2 writer that deduplicates on (method, normalised path, sorted query, status). Query values are kept because ?include=space returns an included block that ?include=org does not, and collapsing them would lose that coverage. GUIDs are masked and sensitive headers redacted.

  • bin/summarize-violations.js, which separates schema render failures from real non-compliance. Without that split the headline count is dominated by spec defects that mean nothing was validated at all.

  • bin/render-check.sh, a six-request probe answering "do the schemas render?" in about 30 seconds rather than a full suite run.

test-compliance.js replaces http-proxy with a forwarder that buffers request bodies, which is what makes HAR capture possible and also lets it bypass wiretap for /v2 and multipart uploads and retry wiretap's "cannot rewind body" 500s directly against the API. It gains env-gated HAR capture and a suite profile table, so TEST_SUITE selects capi-bara-tests or cf-acceptance-tests; only the repo and config keys differ between the two. It no longer pins capi-bara-tests to a branch, and no longer writes a protocol config key that the suite never had a field for.

wiretap moves to 0.7.3: 0.4.7 segfaults on --har-validate.

ai-assisted=yes

Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:

  • A short explanation of the proposed change:

  • An explanation of the use cases your change solves

  • Links to any other associated PRs

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

The compliance suite needs a live foundation and about an hour to answer
"does the API match the spec?". Capture the traffic once and later spec
changes can be replayed against the recording in seconds.

Adds:

  - bin/har-recorder.js, a dependency-free HAR 1.2 writer that deduplicates
    on (method, normalised path, sorted query, status). Query values are kept
    because ?include=space returns an `included` block that ?include=org does
    not, and collapsing them would lose that coverage. GUIDs are masked and
    sensitive headers redacted.

  - bin/summarize-violations.js, which separates schema render failures from
    real non-compliance. Without that split the headline count is dominated
    by spec defects that mean nothing was validated at all.

  - bin/render-check.sh, a six-request probe answering "do the schemas
    render?" in about 30 seconds rather than a full suite run.

test-compliance.js replaces http-proxy with a forwarder that buffers request
bodies, which is what makes HAR capture possible and also lets it bypass
wiretap for /v2 and multipart uploads and retry wiretap's "cannot rewind
body" 500s directly against the API. It gains env-gated HAR capture and a
suite profile table, so TEST_SUITE selects capi-bara-tests or
cf-acceptance-tests; only the repo and config keys differ between the two.
It no longer pins capi-bara-tests to a branch, and no longer writes a
`protocol` config key that the suite never had a field for.

wiretap moves to 0.7.3: 0.4.7 segfaults on --har-validate.

ai-assisted=yes
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant