Skip to content

Commit c9efb29

Browse files
Generate and commit Go code for zipkincore.thrift (#129)
## Which problem is this PR solving? - jaegertracing/jaeger#6615 ## Description of the changes - Generate zipkincore files ## How was this change tested? - ci ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [ ] I have added unit tests for the new functionality - [ ] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: nabil salah <[email protected]> Signed-off-by: Yuri Shkuro <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]>
1 parent 293b25f commit c9efb29

10 files changed

+1961
-4
lines changed

.codecov.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ codecov:
66
ignore:
77
- "model/v1/model.pb.go"
88
- "proto-gen/*/*"
9+
- "thrift-gen/*/*"
910

1011
coverage:
1112
precision: 2

.github/workflows/ci-lint-test.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ jobs:
3131
submodules: recursive
3232

3333
- name: Verify Protobuf types are up to date
34-
run: make proto && git diff --name-status --exit-code
34+
run: make proto && { if git status --porcelain | grep '??'; then exit 1; else git diff --name-status --exit-code; fi }
35+
36+
- name: Verify Thrift types are up to date
37+
run: make thrift && { if git status --porcelain | grep '??'; then exit 1; else git diff --name-status --exit-code; fi }

.github/workflows/ci-unit-tests.yml

+1
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@ jobs:
5353

5454
- name: Test code gen
5555
run: make test-code-gen
56+

Makefile

+9-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ THRIFT_CMD=$(THRIFT) -o /data $(THRIFT_GEN)
2727

2828
THRIFT_FILES=agent.thrift jaeger.thrift sampling.thrift zipkincore.thrift crossdock/tracetest.thrift \
2929
baggage.thrift dependency.thrift aggregation_validator.thrift
30+
THRIFT_GEN_DIR=thrift-gen
3031

3132
.PHONY: test-code-gen
32-
test-code-gen: thrift swagger-validate protocompile proto proto-zipkin
33+
test-code-gen: thrift-all swagger-validate protocompile proto-all proto-zipkin
3334
git diff --exit-code ./swagger/api_v3/query_service.swagger.json
3435

3536
.PHONY: swagger-validate
@@ -43,7 +44,13 @@ clean:
4344
rm -rf coverage.txt
4445

4546
.PHONY: thrift
46-
thrift: thrift-image clean $(THRIFT_FILES)
47+
thrift:
48+
[ -d $(THRIFT_GEN_DIR) ] || mkdir $(THRIFT_GEN_DIR)
49+
$(THRIFT) -o /data --gen go:$(THRIFT_GO_ARGS) -out /data/$(THRIFT_GEN_DIR) /data/thrift/zipkincore.thrift
50+
rm -rf thrift-gen/*/*-remote thrift-gen/*/*.bak
51+
52+
.PHONY: thrift-all
53+
thrift-all: thrift-image clean $(THRIFT_FILES)
4754

4855
$(THRIFT_FILES):
4956
@echo Compiling $@

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This repository does not publish the generated code, but it does run Thrift and
1616

1717
To generate the stubs for your own purposes:
1818
* clone the repository
19-
* run `make proto` or `make thrift`
19+
* run `make proto-all` or `make thrift-all`
2020
* the stubs will be generated under `gen-{lang}` for Thrift and `proto-gen-{lang}` for Protobuf
2121

2222

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ require (
1414
)
1515

1616
require (
17+
github.com/apache/thrift v0.21.0 // indirect
1718
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
1819
github.com/kr/pretty v0.3.1 // indirect
1920
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
github.com/apache/thrift v0.21.0 h1:tdPmh/ptjE1IJnhbhrcl2++TauVjy242rkV/UzJChnE=
2+
github.com/apache/thrift v0.21.0/go.mod h1:W1H8aR/QRtYNvrPeFXBtobyRkd0/YVhTc6i07XIAgDw=
13
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
24
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
35
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

thrift-gen/zipkincore/GoUnusedProtection__.go

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

thrift-gen/zipkincore/zipkincore-consts.go

+46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)