Conversation
registry.bazel.build renders Starlark API docs from the sources, so keeping generated markdown in the tree duplicates it and has to be kept in sync by a test. Point the README at https://registry.bazel.build/modules/rules_apko/latest/docs instead and remove docs/ entirely. docs/apko-cache.md was hand-written rather than generated (see the linguist-generated=false entry it had in .gitattributes) and BCR renders only stardoc output, so its content folds into README.md as a "Fetching and Caching Contents" section rather than being lost. The docstrings in translate_lock.bzl and apko_image.bzl linked to it with paths relative to docs/; those docstrings are exactly what BCR renders, so they now use absolute URLs pointing at that section. With the docs tests gone, bazel test //... no longer builds stardoc and its protobuf and Java dependencies, so the matrix no longer needs to special-case Bazel versions whose stardoc output differs: the two conditional Test steps collapse into one. Locally this takes //... from 976 actions to 35. The bzl_library targets in //apko stay: they are what a future starlark_doc_extract would need to publish docs to BCR. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
registry.bazel.buildalready renders the full Starlark API for this module, generated from the sources. Keeping stardoc output checked in duplicates that and needs a test to hold the two in sync — a test that costs about 900 actions per CI run.This removes
docs/, points the README at https://registry.bazel.build/modules/rules_apko/latest/docs, and collapses the CI branch that existed only to work around stardoc.The BCR docs are live today
No opt-in was needed. The page reports:
All five module files are covered —
apko/defs.bzl,extensions.bzl,repositories.bzl,toolchain.bzl,translate_lock.bzl— includingapko_image,apko_config,apko_show_config,apko_lock,apko_toolchain, both providers, theapkomodule extension,translate_apko_lock, and the exported template values. That is a superset of whatdocs/rules.mdanddocs/translate_lock.mdcontained.docs/apko-cache.mdis folded into the README, not deletedIt was hand-written rather than generated — it carried a
linguist-generated=falseentry in.gitattributes— and BCR renders Starlark API docs, not arbitrary markdown. Its content moves into README.md as a## Fetching and Caching Contentssection, unchanged apart from heading levels. The BCR page links View README, so it stays reachable from where users land.translate_lock.bzlandapko_image.bzllinked to it with paths relative todocs/. Those docstrings are exactly what BCR renders, where a relative link has no meaningful base, so they now use absolute URLs pointing at that README section.CI
With the docs tests gone,
bazel test //...no longer builds stardoc, protoc, or the protobuf Java runtime. Locally that takes//...from 976 actions / 322s to 35 actions / 10.9s.That also removes the reason for the version split in the test matrix:
Every matrix cell now runs the same command. The
stardocdev dependency drops out ofMODULE.bazelsince nothing loads it.The
bzl_librarytargets in//apkostay — they are what astarlark_doc_extractwould need if you ever want the guaranteed extraction path (publishing{REPO}-{TAG}.docs.tar.gzand adocs_urlin.bcr/source.template.json) instead of best-effort.Trade-off
BCR documents released versions only. There is no rendered API reference for unreleased
main, whereasdocs/*.mdtracked the working tree. In exchange the docs can never drift from the sources, because they are generated from them at publish time.Test plan
bazel test //...— 4/4 passbazel run //.github/workflows:buildifier.check— cleanactionlint— unchanged (the pre-existing SC2086 findings inci.yamlremain)grepforapko-cache.md,docs/rules.md,docs/translate_lock.mdand./docs/across the tree returns nothing🤖 Generated with Claude Code