Skip to content

docs: require introduced-in versions and backfill them from release history - #4876

Merged
JakeSCahill merged 12 commits into
mainfrom
docs/required-versions
Oct 8, 2026
Merged

JakeSCahill merged 12 commits into
mainfrom
docs/required-versions

Conversation

@JakeSCahill

@JakeSCahill JakeSCahill commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #4875.

Why

The reference docs say "Introduced in version X" for components and "Requires version X or later" for fields, but only when the spec sets .Version(), and most don't. Readers on older releases can't tell whether a field exists in the version they run. Bloblang functions and methods never showed a version at all, even when one was set.

How it stays complete

TestNewSpecsHaveVersions finds the highest vX.Y.Z tag reachable from HEAD and reads the reference partials generated into it. Because CI keeps those partials in step with the code, they're an exact record of what that release shipped. The test fails when:

  • a component, field, or Bloblang function or method isn't in that release and has no version, and suggests the next minor
  • a new spec's version isn't later than that release
  • any version isn't plain x.y.z (it found 24 written as v4.x.y, now fixed)

A field inside a new component or new object is covered by its parent. Deprecated and hidden specs are skipped.

The test reads the previous release's specs from the redpanda-connect-docs.tar.gz asset attached to that release. Releases from before the asset have none, so until the first release that includes this work it only checks the version numbers themselves, and says so in the test log. I compared the current schema with a v4.111.0 build to cover that one-release gap: nothing has been added since 4.111.0 without a version. The test job now checks out with fetch-depth: 0 so it can read the tag.

Checked both ways: TestVersionProblems covers the rules with synthetic data. Against a temporary local tag with partials, the live test flagged a probe field and reported nothing else as new.

The backfill

Versions come from the docs generated into each of the 158 v4 release tags: the first release whose docs show a spec. Specs present in v4.0.0, the first tag with history, stay blank.

  • 332 were placed automatically, only where a field's own description literal was the definition site and every component using that site agreed.
  • 42 were placed by hand at call sites. Each was checked with git log -S and the first tag containing the commit; all matched.
  • 16 are left blank because they're built inside helpers that return a slice of fields, where any single version would be false for one of the components. Examples are SessionFields() in the iceberg SigV4 block and metadata_max_age in FranzConnectionFields().

The generator now renders Bloblang versions. Specs defined in benthos are backfilled in redpanda-data/benthos, using Connect release numbers.

Build and tests pass. task docs passes with x_benthos_extra. The docs diff only adds "Introduced in" and "Requires version" lines, apart from the six v-prefixed lines it replaces.

Also in this PR (from a full review of the generated docs)

  • Versions corrected against the first release tag whose code contains each one:
    • tigerbeetle_cdc and microsoft_sql_server_cdc (were 0.0.1)
    • cohere_rerank, ffi, nats_kv, a2a_message, schema_registry, aws_cloudwatch_logs, iceberg, and pg_stream/postgres_cdc
    • the Prometheus histogram suffix field (4.111.1)
  • Per-component versions for shared AWS session fields: SessionFieldsWithVersions lets iceberg and kinesis show the release in which they gained tcp, endpoint, and credentials, instead of the shared helper's 4.69.0.
  • The version check now also rejects: major-0 versions, and versions newer than the next release.

Comment thread cmd/tools/docs_gen/versions_test.go Resolved
@JakeSCahill
JakeSCahill force-pushed the docs/required-versions branch from 0f288d9 to a370499 Compare October 7, 2026 09:07
@JakeSCahill
JakeSCahill force-pushed the docs/required-versions branch from a370499 to 018034d Compare October 7, 2026 09:26
Comment thread internal/impl/aws/config/iam_auth.go Resolved
@JakeSCahill
JakeSCahill force-pushed the docs/required-versions branch from 018034d to 5046d5f Compare October 7, 2026 13:05
@JakeSCahill
JakeSCahill force-pushed the docs/required-versions branch from 5046d5f to 08d4fbe Compare October 7, 2026 14:44
@JakeSCahill
JakeSCahill force-pushed the docs/required-versions branch 2 times, most recently from c97ba01 to 57d3ceb Compare October 8, 2026 14:34
@JakeSCahill
JakeSCahill removed this pull request from stack #4883 October 8, 2026 15:14
@Leward
Leward added this pull request to stack #4940 October 8, 2026 17:28
@Leward
Leward self-requested a review October 8, 2026 17:53

@Leward Leward 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.

I checked each .Version() that this PR adds against git history, independently of the docs-based backfill.
Method: find the commit that first adds the field (git log -S), then the first vX.Y.Z tag that contains it (git tag --contains).
Result: all 373 versions match.

Examples:

  • prometheus.histogram_timing_seconds_suffix is 4.111.1. The field is absent in v4.111.0 and present in v4.111.1.
  • sql_raw queries[].when is 4.87.0 (conn_fields.go#L300). It was added in eddec23, which is first in v4.87.0.

Some shared helpers carry a version older than a later component that uses them, for example the OTLP collector fields on the 4.88.0 metrics exporter.
The docs do not show these lines, because renderFieldsSince only prints a field version that is later than its component's version.

Base automatically changed from docs/copies-check to main October 8, 2026 18:11
Generated docs are no longer committed, so the version check downloads
redpanda-connect-docs.tar.gz from the previous release instead of reading
partials at its tag. A release without the asset is treated like one from
before the partials existed.
… component

pulsar tls shipped in 4.2.0. The docs task now runs TestNewSpecsHaveVersions
with x_benthos_extra (its job checks out the tags), so cgo-only specs are
covered, and a missing docs asset fails the check under CI once an older
release has one, instead of quietly turning it off.
…ared IAM fields

A version correction had dropped the Requirements, Snapshot and streaming
modes, and Data types sections from the postgres_cdc description. The
shared IAM credential and role fields claimed 4.72.0 for every caller,
which is wrong for MongoDB and postgres_cdc; each caller's aws object
already carries its own version.
@JakeSCahill
JakeSCahill force-pushed the docs/required-versions branch from 57d3ceb to 763bf69 Compare October 8, 2026 18:11
@JakeSCahill
JakeSCahill merged commit 5eb2b4b into main Oct 8, 2026
8 of 9 checks passed
@JakeSCahill
JakeSCahill deleted the docs/required-versions branch October 8, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants