feat(dev): Enhance Makefile for faster go-code with scoping#7736
Conversation
d9788ee to
e2464df
Compare
**What changed?** - Updated the `pr` target to allow optional scoping for `go-generate` using the `GEN_DIR` variable. - Modified the `go-generate` command to reflect the new scope in its output message. **Why?** This change provides developers with the ability to specify a directory scope for code generation, improving flexibility and usability when running code generation tasks. We extensively use go-generate, and it is slow on the entire cadence repo, which extends `make pr` up to 5 mins. With GEN_DIR=service/matching `make pr` takes less than a minute. **Testing** No specific tests were added, but existing Makefile targets were verified to ensure they function correctly with the new changes. make pr GEN_DIR=service/matching # works <1min comparing with the original 4 mins **Release notes** N/A Signed-off-by: Jan Kisel <dkrot@uber.com>
e2464df to
a487b7f
Compare
Code Review ✅ Approved 1 resolved / 1 findingsClean, backward-compatible enhancement to scope ✅ 1 resolved✅ Bug: Self-referencing recursive variable breaks
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
What changed?
Addressing #7737:
prtarget to allow optional scoping forgo-generateusing theGEN_DIRvariable.go-generatecommand to reflect the new scope in its output message.Why?
This change provides developers with the ability to specify a directory scope for code generation, improving flexibility and usability when running code generation tasks.
We extensively use go-generate, and it is slow on the entire cadence
repo, which extends
make prup to 5 mins.With GEN_DIR=service/matching
make prtakes less than a minute.How did you test it?
No specific tests were added, but existing Makefile targets were verified to ensure they function correctly with the new changes.
make pr GEN_DIR=service/matching # works <1min comparing with the
original 4 mins
Potential risks
No: it's a new optional flag for dev-only Makefile' goal
Release notes
Documentation Changes
Extended
make help(or justmakew/o goal) to have the example for the "pr" goal.Reviewer Validation
PR Description Quality (check these before reviewing code):
go testinvocation)