refactor(uv): expand templates instead of .format() strings in uv_hub - #1496
xangcastle wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✨ Aspect Workflows Tasks📅 Fri Aug 28 02:43:45 UTC 2026 ✅ 44 successful tasks
⏱ Last updated Fri Aug 28 02:50:44 UTC 2026 · 📊 GitHub API quota 1,152/15,000 (8% used, resets in 40m) |
py_binary startup benchmark
sys.path quality
Bazel analysis benchmark
py_image_layer benchmark
|
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
| package(default_visibility = ["//uv/private:__subpackages__"]) | ||
|
|
||
| exports_files([ | ||
| "defs.tmpl", |
There was a problem hiding this comment.
I think these should be named *.tmpl.{bazel,bzl} so we actually know what type of file they are, and an IDE will render them correctly etc
There was a problem hiding this comment.
if I add .bzl at the end, gazelle will try to generate bzl_libraries
There was a problem hiding this comment.
We could tell gazelle to ignore *.tmpl.* maybe?
The hub repository rule was assembling its BUILD and .bzl files out of .format() strings, which meant doubling every brace in the generated Starlark and burying the skeletons inside the implementation.
This moves the static parts into five .tmpl files under uv/private/uv_hub/templates and expands them with repository_ctx.template, so the rule now only computes the dynamic bits: select arms, the group inversion, label lists.
Net effect is about ninety fewer lines, and the templates read as plain Starlark. Output is byte-for-byte identical, regenerating the snapshots produced an empty diff. Docstrings got a pass while I was in there: _hub_impl now documents the five artifacts and their invariants.
Changes are visible to end-users: no
Test plan