Skip to content

bazel/dependency: Add release_date_updater, to set release dates in YAML metadata - #5626

Merged
phlax merged 1 commit into
envoyproxy:mainfrom
phlax:bazel-dependency-release-dates
Nov 18, 2026
Merged

phlax merged 1 commit into
envoyproxy:mainfrom
phlax:bazel-dependency-release-dates

Conversation

@phlax

@phlax phlax commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Sets the release_date of dependencies in YAML metadata files, eg Envoy's bazel/deps.yaml and api/bazel/deps.yaml.

Nothing updates those when module_updater bumps a bazel_dep, so Envoy's dependency bot leaves a stale date on every bump (envoyproxy/envoy#49388 needed six fixed by hand). The WORKSPACE updater did it with a post-update hook in Envoy, which was tied to repository_locations.bzl and went with it.

load("@envoy_toolshed//dependency:macros.bzl", "release_date_updater")

release_date_updater(
    name = "release_dates",
    check = ":check",
    dependencies = ":dependencies",
    metadata = [
        "//bazel:deps.yaml",
        "@envoy_api//bazel:deps.yaml",
    ],
)

It does not work out the dates itself: they are looked up by the dependency checker (envoy.dependency.check). That makes requests to GitHub for every dependency it checks, which for all of them is slow, and fails on a rate limit or on any one request. So the dependencies to fix are named, and the checker is run on only those of the dependencies JSON:

$ bazel run //tools/dependency:release_dates -- fmt rules_cc
Checking the release dates of: fmt rules_cc
bazel/deps.yaml: fmt 2026-06-16 -> 2026-11-07
rules_cc: no release date to fix
Release dates: 1 updated, 0 already set

With no arguments every dependency is checked. The dates can also be given, in which case nothing is looked up and no checker is needed:

$ bazel run //tools/dependency:release_dates -- fmt=2026-11-07 rules_cc=2026-11-05

Only the release_date line of a dependency is changed, so comments, quoting and ordering are left as they are. yq reads the current date, and the line of the dependency's own field (not one in a nested mapping or a block scalar) is checked to hold that date before it is rewritten. A dependency is updated in the first file that has it, and one that is in none of them is an error, after the rest are updated. If the checker fails without reporting a mismatch (eg it could not reach GitHub), that is an error too, and nothing is changed.

How the checker is invoked, and how its output is read, is the tool's business and not the caller's.

Testing: //dependency/test:release_dates_test runs the script with a stand-in for the checker (coloured output, repeated mismatches, a failed exit) that records which dependencies it was run on: for named dependencies, a mix of names and dates, every dependency, an unknown name, and a checker that fails for another reason; and with dates as arguments (quoted, unquoted and commented), unknown dependencies and usage errors. It was run directly with jq and yq binaries, with shellcheck and yamllint. The parsing was also checked against a real coloured log of the checker from Envoy CI. The Bazel targets, the macro and the sh_test, have only been run by this PR's CI, and the macro has not been run against the real checker.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The updater can rewrite description text instead of the actual release date and silently skip mismatches in colored checker output while reporting success.

2 open issues
What changed in this PR

Adds release_date_updater to keep YAML dependency release dates current after module version updates. It consumes supplied dates without making network calls.

Changes:

  • Adds a Bazel macro and shell updater accepting plain date pairs or dependency-checker mismatch output.
  • Updates date lines in place, aiming to preserve comments, quoting, and ordering.
  • Adds usage documentation, YAML fixtures, and shell tests.
File Description
bazel/​dependency/​test/​testdata/​release_dates/​deps.yaml Fixtures covering date formats, comments, and missing dates.
bazel/​dependency/​test/​testdata/​release_dates/​api.yaml Fixtures for multiple files and duplicate dependencies.
bazel/​dependency/​test/​release_dates_test.sh Tests parsing, targeted edits, summaries, and errors.
bazel/​dependency/​test/​BUILD Registers the shell test with yq and fixtures.
bazel/​dependency/​release-dates.sh Implements input parsing and in-place date updates.
bazel/​dependency/​README.md Documents the updater and checker-output pipeline.
bazel/​dependency/​macros.bzl Exposes the runnable release_date_updater macro.
bazel/​dependency/​BUILD Exports the updater script.

Review effort: Balanced

Comment thread bazel/dependency/release-dates.sh Resolved
Comment thread bazel/dependency/release-dates.sh Resolved
@phlax
phlax force-pushed the bazel-dependency-release-dates branch 2 times, most recently from b8ee9cf to e944d07 Compare November 18, 2026 17:12
@phlax
phlax requested a balanced review from Copilot November 18, 2026 17:12
@phlax
phlax force-pushed the bazel-dependency-release-dates branch from e944d07 to 6f06a7f Compare November 18, 2026 17:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the release-date updater change.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@phlax
phlax force-pushed the bazel-dependency-release-dates branch 2 times, most recently from c5b7133 to a20d7ca Compare November 18, 2026 17:34
@phlax
phlax requested a balanced review from Copilot November 18, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the release-date updater.

No open issues 🎉

Review effort: Balanced

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Install deps

Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review.

Note

You can configure setup steps for Copilot code review separately from Copilot cloud agent with a copilot-code-review.yml file. Read the docs for details.

@phlax phlax changed the title [WIP] bazel/dependency: Add release_date_updater, to set release dates in YAML metadata bazel/dependency: Add release_date_updater, to set release dates in YAML metadata Nov 18, 2026
@phlax
phlax marked this pull request as ready for review November 18, 2026 17:42
… YAML metadata

Sets the `release_date` of dependencies in YAML metadata files (eg
Envoy's `bazel/deps.yaml`), which nothing updates when the module
updater bumps a `bazel_dep`: the hook that did it for the WORKSPACE
updater was tied to `repository_locations.bzl`.

It does not work out the dates. They are looked up by the dependency
checker (`envoy.dependency.check`), given to the macro with the
dependency JSON that it checks. That makes requests to GitHub for
every dependency, which is slow and fails easily, so for the
dependencies named on the command line it is run on only those of the
JSON. The dates can also be given, as `<name>=<date>`, with no lookup.

Only the `release_date` line of a dependency is changed, so that the
rest of the file is left as it is: yq reads the current date, and the
line of the dependency's own field is checked to hold it before it is
rewritten.

Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax
phlax force-pushed the bazel-dependency-release-dates branch from a20d7ca to 4a2d2a1 Compare November 18, 2026 17:45
@phlax
phlax merged commit 5fb26c3 into envoyproxy:main Nov 18, 2026
54 checks passed
phlax added a commit to phlax/envoy that referenced this pull request Nov 18, 2026
The dependency bot (`ci/dependency/update.sh`) bumped a `bazel_dep`
and left the `release_date` of the dependency in `deps.yaml` as it
was: the hook that updated it went with WORKSPACE (envoyproxy#47217). Since the
release dates check came back (envoyproxy#48705) that fails the `deps` precheck
of the bump.

`//tools/dependency:release_dates` (envoyproxy/toolshed#5626) fixes
the dates in `bazel/deps.yaml` and `api/bazel/deps.yaml` with the ones
that the checker looks up. `deps.update` and `registry` now run it for
the modules that they update. Only those are looked up, as each is a
request to GitHub, and a module with no metadata is skipped.

Signed-off-by: Ryan Northey <ryan@synca.io>
phlax added a commit to phlax/envoy that referenced this pull request Nov 18, 2026
The dependency bot (`ci/dependency/update.sh`) bumped a `bazel_dep`
and left the `release_date` of the dependency in `deps.yaml` as it
was: the hook that updated it went with WORKSPACE (envoyproxy#47217). Since the
release dates check came back (envoyproxy#48705) that fails the `deps` precheck
of the bump.

`//tools/dependency:release_dates` (envoyproxy/toolshed#5626) fixes
the dates in `bazel/deps.yaml` and `api/bazel/deps.yaml` with the ones
that the checker looks up. `deps.update` and `registry` now run it for
the modules that they update. Only those are looked up, as each is a
request to GitHub, and a module with no metadata is skipped.

Signed-off-by: Ryan Northey <ryan@synca.io>
phlax added a commit to envoyproxy/envoy that referenced this pull request Nov 18, 2026
The dependency bot (`ci/dependency/update.sh`) bumps a `bazel_dep` and
leaves the `release_date` of the dependency in `deps.yaml` as it was.
The hook that updated it for the WORKSPACE updater went with WORKSPACE
(#47217), so every bump since has had a stale date (#49388 needed six
fixed by hand), and now that the release dates check is back (#48705)
the `deps` precheck of a bump fails on it.

This adds `//tools/dependency:release_dates` (`release_date_updater`,
envoyproxy/toolshed#5626 and envoyproxy/toolshed#5630), which fixes the
dates in `bazel/deps.yaml` and `api/bazel/deps.yaml` with the ones that
the checker (`//tools/dependency:check`) looks up:

```console
$ bazel run //tools/dependency:release_dates -- gperftools
Checking the release dates of: gperftools
bazel/deps.yaml: gperftools 2026-03-06 -> 2026-10-21
```

`deps.update` (the bot's `bazel` task) and `registry` with named modules
(its `registry` task) now run it for the modules they update. Only those
are looked up, as each is a request to GitHub, a module can be named as
the module (`msgpack-c`) where its metadata key differs (`msgpack-cxx`),
and a module with no metadata is skipped. It needs the `GITHUB_TOKEN`
that the workflow already gives the update.

Not covered: `registry` with `all`, where the updated modules are not
known at that point; their dates are left to the `deps` check.

A dependency with metadata in both files (`envoy_toolshed`) is fixed in
both: the check reads the API file's date.

Risk Level: Low (dependency tooling only)
Testing: The `bazel` task was run from a branch with these changes
against a pre-release of the toolshed module ([run
44363626118](https://github.com/envoyproxy/envoy/actions/runs/44363626118),
`gperftools msgpack-c`, no PR): the diff it produced has the
`gperftools` date fixed alongside the `MODULE.bazel` and lockfile
changes. There the step was in `do_ci.sh`; it is now in `deps_update`.
The `registry` path, and the fix of a dependency in both files (toolshed
0.5.26.envoy, #49411), have not been run.
Docs Changes: `ci/README.md`
Release Notes: N/A

Signed-off-by: Ryan Northey <ryan@synca.io>
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.

2 participants