chore: teach Make how to vendor#16394
Conversation
Signed-off-by: Alan Clucas <alan@clucas.org>
There was a problem hiding this comment.
Pull request overview
Updates the build workflow to make vendoring deterministic and only run when needed by introducing vendor/modules.txt as the canonical dependency for targets that require a fresh vendor/ tree.
Changes:
- Add a
vendor/modules.txttarget that runsgo mod vendorand use it as a prerequisite across build, codegen, lint, test, and doc generation targets. - Ensure protoc-generated swagger targets depend on a fresh vendor tree (excluding the
_.primary/_.secondaryswagger files). - Adjust
lint-goto ensure the vendor tree is consistent aftergo mod tidy(non-Nix paths).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a ChangesVendor Sentinel Adoption
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Makefile`:
- Line 878: The swagger conditional in the Makefile uses an invalid GNU Make
directive, so the block cannot be parsed correctly. Update the conditional near
the swagger section from the misspelled directive to the proper GNU Make form,
ensuring the matching endif for that block remains valid and the rest of the
Makefile continues to parse.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Alan Clucas <alan@clucas.org>
`make --touch` doesn't run recipes, so without a vendor tree present it creates an empty vendor/modules.txt, which flips Go into vendor mode and breaks every later go build in the job with "inconsistent vendoring". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Alan Clucas <alan@clucas.org>
Motivation
Make blindy runs
go mod vendorbut not in all the right places any more, so you quite often have to do it manually.Modifications
Teach make how to vendor correctly so it only happens when actually needed with a
vendor/modules.txtrule.Add that as a proper pre-req to places that did it manually and quite a few that should need it.
Verification
CI will prove a lot. Ran a bunch of make targets locally too.
Documentation
Not required, dev facing change
AI
Claude did a sweep for extra targets and wrote me the rule for protoc.
Summary by CodeRabbit
vendor/modules.txtas the freshness check for vendored dependencies.make vendor/modules.txtbefore markingdist/*executable and touching build outputs.