Skip to content

Commit 092073f

Browse files
committed
fix gha
1 parent 253af99 commit 092073f

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

.github/actions/setup/action.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ runs:
2525
run: |
2626
source .envrc
2727
28-
project install-tools
29-
project fetch.openapi-generator
30-
project fetch.swagger-ui
31-
bin/scripts/install-pg_format.sh
32-
bin/scripts/install-mkcert.sh
28+
project install-tools &
29+
project fetch.openapi-generator &
30+
project fetch.swagger-ui &
31+
bin/scripts/install-pg_format.sh &
32+
bin/scripts/install-mkcert.sh &
33+
bin/scripts/install-proto.sh &
34+
wait

bin/project

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ MAX_COMMENT_LEN=88
3636
x.check-build-deps() {
3737
local -i fails
3838
check.column || { ((fails++)) && true; }
39+
check.protoc || { ((fails++)) && true; }
3940
check.bash || { ((fails++)) && true; }
4041
check.go || { ((fails++)) && true; }
4142
check.java || { ((fails++)) && true; }
@@ -158,17 +159,17 @@ x.generate.counterfeiter() {
158159
# Generates the required servers/clients for relevant services.
159160
x.generate.proto() {
160161
(
162+
local import_path="./python-ml-app-protos/tfidf/v1"
163+
local filename="python-ml-app-protos/tfidf/v1/service.proto"
164+
161165
cd internal
162-
IMPORT_PATH="./python-ml-app-protos/tfidf/v1"
163-
FILENAME="python-ml-app-protos/tfidf/v1/service.proto"
164-
# -I python-ml-app-protos \
165166
rm -rf ./pb
166167
mkdir -p ./pb
167168
protoc \
168169
--go-grpc_out=./pb/. \
169170
--go_out=./pb/. \
170-
--go-grpc_opt=M$FILENAME=$IMPORT_PATH,paths=import \
171-
--go_opt=M$FILENAME=$IMPORT_PATH,paths=import \
171+
--go-grpc_opt=M$filename=$import_path,paths=import \
172+
--go_opt=M$filename=$import_path,paths=import \
172173
python-ml-app-protos/tfidf/v1/service.proto
173174
cd - >/dev/null
174175
)

bin/scripts/deps-check.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ check.column() {
2323
}
2424
}
2525

26+
check.protoc() {
27+
local vers
28+
vers=$(protoc --version)
29+
minver="libprotoc 3"
30+
{ [[ "$vers" = *$minver* ]] &&
31+
printf "%-40s ✅\n" "${FUNCNAME[0]##*.}: $minver"; } ||
32+
{
33+
echo "${RED}Failed ${FUNCNAME[0]##*.} check.${OFF}"
34+
echo "${YELLOW}Run install-protoc.sh to get $minver.${OFF}"
35+
return 1
36+
}
37+
}
38+
2639
check.curl() {
2740
local -a versa
2841
mapfile versa < <(curl -V 2>&1)

internal/rest/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func NewServer(conf Config, mws []gin.HandlerFunc) (*http.Server, error) {
6161
// WithTracerProvider
6262
router := gin.Default()
6363
// don't set propagator here again
64-
router.Use(otelgin.Middleware("rest-server", otelgin.WithTracerProvider(conf.Tracer)))
64+
router.Use(otelgin.Middleware("", otelgin.WithTracerProvider(conf.Tracer)))
6565
pprof.Register(router, "dev/pprof")
6666

6767
for _, mw := range mws {

internal/tracing/otel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func InitTracer() *sdktrace.TracerProvider {
3535
sdktrace.WithBatcher(jaegerExporter),
3636
sdktrace.WithResource(resource.NewSchemaless(attribute.KeyValue{
3737
Key: semconv.ServiceNameKey,
38-
Value: attribute.StringValue("rest-server"),
38+
Value: attribute.StringValue("openapi-go-service"),
3939
})),
4040
)
4141

0 commit comments

Comments
 (0)