Repository navigation
THRIFT-6348: Go tests: stop writing ThriftTest.thrift copies into the source tree - #3944
Conversation
|
I'm not sure putting |
|
Hi @fishy, Thanks for the review! The motivation behind THRIFT-6348 is twofold:
Regarding placing it in If you prefer keeping Would you prefer a dedicated |
|
a dedicated directory would be better.
|
35fd4b4 to
33696ef
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Legacy generated files can shadow the new build input or remain after cleanup.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Moves Go test IDL generation out of the source tree.
Changes:
- Compiles the shared Go test IDL directly.
- Generates filtered IDL under
lib/go/test/build/. - Updates cleanup and ignore rules.
| File | Description |
|---|---|
.gitignore |
Replaces obsolete generated-IDL exclusions. |
lib/go/test/Makefile.am |
Generates filtered IDL in build/. |
test/go/Makefile.am |
Compiles the canonical IDL directly. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@fishy Copilot raised two points about checkouts that ran
A possible fix, kept small: --- a/lib/go/test/Makefile.am
+++ b/lib/go/test/Makefile.am
mkdir -p gopath/src build
+ # Older builds generated ThriftTest.thrift here. The compiler resolves an
+ # include next to the including file before the -I paths, so a leftover
+ # copy would shadow build/ThriftTest.thrift.
+ $(RM) ThriftTest.thrift
grep -v 'set<Insanity>' $(THRIFTTEST) > build/ThriftTest.thrift
@@
clean-local:
- $(RM) -r gopath build gen-go
+ $(RM) -r gopath build gen-go ThriftTest.thrift
--- a/test/go/Makefile.am
+++ b/test/go/Makefile.am
clean-local:
- $(RM) -r src/gen src/github.com/golang src/thrift bin pkg gopath
+ $(RM) -r src/gen src/github.com/golang src/thrift bin pkg gopath ThriftTest.thriftWhich direction do you prefer?
Happy to go either way. |
|
the current so I think that's good enough as-is? |
|
Agreed — keeping it as-is, then. Thanks! |
|
This branch has conflicts that must be resolved. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
|
@slachiewicz This branch has conflicts that must be resolved |
… source tree Client: go lib/go/test wrote a filtered copy next to the sources and test/go a plain one; both were gitignored, so a checkout's IDL set depended on whether a build had run. Write the filtered copy under build/ and resolve the include with -I; use test/ThriftTest.thrift directly in test/go. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
33696ef to
f2a00fa
Compare


lib/go/testandtest/gowrote copies oftest/ThriftTest.thriftinto the source tree, hidden by.gitignore. The filtered copy inlib/go/testnow goes to a dedicatedbuild/directory, found with-I buildand removed bymake clean, andtest/gocompilestest/ThriftTest.thriftdirectly. The two.gitignoreentries for the in-tree copies are replaced by one forlib/go/test/build/.Verified: the old and new
IncludesTest.thriftrecipes → identicalgopath/src(20 files).lib-goCI job runs both rules (make -C lib/go check,make -C test/go check).Co-Authored-By:trailer. No new dependency or third-party code.