Skip to content

fix: unbreak the official test suite in CI, and the bug it was hiding - #16

Open
dunglas wants to merge 6 commits into
mainfrom
fix-ci-submodule-and-multiline-join
Open

dunglas wants to merge 6 commits into
mainfrom
fix-ci-submodule-and-multiline-join

Conversation

@dunglas

@dunglas dunglas commented Sep 15, 2026

Copy link
Copy Markdown
Owner

CI has been running zero official test-suite cases, while reporting success.

The chain

The structured-field-tests submodule was never checked out in CI, because the workflow had no submodules: key. httpwg_test.go:146 then discarded the os.Open error, so Readdir returned zero entries, the loop body never ran, and the test passed. Both suite tests were no-ops on every run.

The bug that hid behind it

Multi-line field values were joined with ",". RFC 9651 section 4.2 joins them with ", ". Inside a string the difference is visible: ["\"foo", "bar\""] parsed to foo,bar instead of foo, bar. This failed string.json/two_lines_string and display-string.json/two_lines_display_string as soon as the suite actually ran. TestUnmarshalItem had the incorrect value written into it as the expectation, so it is corrected here too.

Changes

  • test: suite loading now fails loudly on a missing submodule, an unreadable file, a decode error, or an empty case list, rather than silently running nothing.
  • fix: join field lines with ", ". Submodule refreshed from draft-17-70 to draft-17-94, 24 commits.
  • ci: check out submodules. Bump and pin every action to a full commit SHA. Drop the obsolete GO111MODULE. Stop running the matrix twice per pull-request push. Add permissions: contents: read and a concurrency group.
  • ci: Dependabot with a 7 day cooldown, covering actions and the submodule, plus auto-merge for minor and patch action bumps, modelled on mercure and frankenphp.
  • docs: gofmt on a dictionary.go comment.

Suite cases executed: 0 in CI, 1559 locally on the old pin, 1592 now. gofmt -l empty, go vet clean, golangci-lint v2 reports 0 issues, actionlint clean.

Before merging

The auto-merge workflow needs repository configuration that is not present yet, and will fail on its first Dependabot PR until it is in place:

  1. allow_auto_merge is currently false on this repo; it must be enabled in Settings.
  2. There is no dependabot environment. mercure uses release, frankenphp uses dependabot; I went with the latter.
  3. RELEASE_APP_ID (variable) and RELEASE_APP_PRIVATE_KEY (secret) are not set here. The default GITHUB_TOKEN cannot be substituted, since it lacks the workflows scope and Dependabot action bumps edit .github/workflows/ci.yaml.
  4. main has no required status checks, so --auto has no green to wait for. Worth adding CI as required.

I did not touch any repository setting. Happy to drop the auto-merge commit if you would rather land the fixes first.

The suite files live in a git submodule. Every filesystem and decoding
error was discarded, so an absent submodule produced zero test cases and
a passing run instead of a failure.
RFC 9651 section 4.2 combines field lines with a comma and a space. Only
the comma was used, so a string split across two lines parsed to
"foo,bar" instead of "foo, bar".

Caught by the two_lines cases of the refreshed test suite.
Checkout skipped the test suite submodule, which is what let the silent
test failure reach main. Also drop the obsolete GO111MODULE variable and
stop running the whole matrix twice on pull request branches.

Add Dependabot so the pinned SHAs and the submodule stay current.
Mirrors the setup used in mercure and frankenphp: a seven day cooldown
before an update is proposed, then auto-merge restricted to minor and
patch GitHub Actions bumps. Submodule and major updates stay manual.
RELEASE_APP_ID and RELEASE_APP_PRIVATE_KEY already live in the release
environment of mercure and frankenphp, so reuse it rather than copying
the private key into a second environment.
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