Repository navigation
bazel/dependency: Add release_date_updater, to set release dates in YAML metadata - #5626
Conversation
There was a problem hiding this comment.
🟡 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
b8ee9cf to
e944d07
Compare
e944d07 to
6f06a7f
Compare
c5b7133 to
a20d7ca
Compare
|
One or more custom setup steps configured for this repository failed during this Copilot code review run: 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 |
release_date_updater, to set release dates in YAML metadatarelease_date_updater, to set release dates in YAML metadata
… 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>
a20d7ca to
4a2d2a1
Compare
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>
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>
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>


Sets the
release_dateof dependencies in YAML metadata files, eg Envoy'sbazel/deps.yamlandapi/bazel/deps.yaml.Nothing updates those when
module_updaterbumps abazel_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 torepository_locations.bzland went with it.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 thedependenciesJSON: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-05Only the
release_dateline 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_testruns 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 thesh_test, have only been run by this PR's CI, and the macro has not been run against the real checker.