Skip to content

Commit

Permalink
Merge pull request #344 from Clever/wag-9.1.0
Browse files Browse the repository at this point in the history
Upgrade to wagv9.1
  • Loading branch information
Nikhil Bhatia authored Feb 24, 2023
2 parents 5bfe31d + adc7a69 commit 936d1e0
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 30 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ swagger2markup-cli-1.3.1.jar:
generate: wag-generate-deps swagger2markup-cli-1.3.1.jar
java -jar swagger2markup-cli-1.3.1.jar convert -c docs/config.properties -i swagger.yml -d docs/
$(call wag-generate-mod,./swagger.yml)
go mod vendor
# wag bug: this test file assumes usage of functions like `aws.String(...)` but the workflow-manager
# ark db doesn't use this, leading to an unused import error. Remove the import with a hack.
sed -i -e '6d' gen-go/server/db/tests/tests.go
Expand Down
3 changes: 2 additions & 1 deletion cmd/sfn-execution-events-consumer/launch.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/sfn-execution-events-consumer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func (h Handler) handleHistoryEvent(ctx context.Context, evt HistoryEvent) error
}

func main() {
lc := InitLaunchConfig()
lc := InitLaunchConfig(nil)

sfnapi := sfn.New(session.Must(session.NewSessionWithOptions(session.Options{
Config: aws.Config{
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.16
require (
github.com/Clever/aws-sdk-go-counter v1.10.39-0.20190610193009-b603aedc6d67
github.com/Clever/go-process-metrics v0.4.0
github.com/Clever/kayvee-go/v7 v7.6.0
github.com/Clever/launch-gen v0.0.0-20220707212639-7c830d53b040
github.com/Clever/kayvee-go/v7 v7.7.0
github.com/Clever/launch-gen v0.0.0-20230222233441-17c275320509
github.com/Clever/workflow-manager/gen-go/client v0.0.0-00010101000000-000000000000
github.com/Clever/workflow-manager/gen-go/models v0.0.0-00010101000000-000000000000
github.com/aws/aws-lambda-go v1.34.1
Expand Down
21 changes: 6 additions & 15 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,19 @@ cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Clever/aws-sdk-go-counter v1.10.38 h1:j7wm4soPfWMzepoDHxxQJBLQui7CF/Q/i1EG0dFSEno=
github.com/Clever/aws-sdk-go-counter v1.10.38/go.mod h1:nLHwBoaxM28ZibccJTfALxzF5EwxdPtjwUHx86LqGVM=
github.com/Clever/aws-sdk-go-counter v1.10.39-0.20190610193009-b603aedc6d67 h1:8Bzz+tjpnTX0uBwsm9yt2OeBjRTeV0olTfAZ7yHUNKE=
github.com/Clever/aws-sdk-go-counter v1.10.39-0.20190610193009-b603aedc6d67/go.mod h1:nLHwBoaxM28ZibccJTfALxzF5EwxdPtjwUHx86LqGVM=
github.com/Clever/discovery-go v1.8.1 h1:bT2q5IkEZnQviXEvC6iij9KNlJTPyLXPOQQCvvpX2Rg=
github.com/Clever/discovery-go v1.8.1/go.mod h1:2W318WszWlVde/hKBvxM3xrQKcmxWwv+6ysUu8Rfx0I=
github.com/Clever/go-process-metrics v0.4.0 h1:f7sqN8NxRlLV0phlTRPe1/wDmVOqW/EnILM6J+MkcLE=
github.com/Clever/go-process-metrics v0.4.0/go.mod h1:nT1q7aJkDqYYwRFfqmuM3akED4ambORB+WhunT9jTEk=
github.com/Clever/kayvee-go/v7 v7.4.0/go.mod h1:LvO0+U9vKd45yv2j9MtTA1r5LTTf+epSXsxMfw1WNd8=
github.com/Clever/kayvee-go/v7 v7.6.0 h1:0oKF/yLSZZG0cJoYyuXj49zVU41I1eySvfHunlJkw7A=
github.com/Clever/kayvee-go/v7 v7.6.0/go.mod h1:B2IcQE7OK8rpYvDotSAvCtfZqZ1UqTs1YacM+YFtxR8=
github.com/Clever/launch-gen v0.0.0-20220707212639-7c830d53b040 h1:PRHVrX8nr9HROmdryT6ofNpxqRik2Vp7T/d28dxRtOY=
github.com/Clever/launch-gen v0.0.0-20220707212639-7c830d53b040/go.mod h1:SN5Cf87o/YLSIXOmShxJfVfN6yADVr3S+IlHD2sltXA=
github.com/Clever/wag/logging/wagclientlogger v0.0.0-20220916194010-36f974d66e08 h1:hr8vR3NyIrxMKFOUzqMY5y1VboQaT2Lia4RXVvogLfM=
github.com/Clever/kayvee-go/v7 v7.7.0 h1:quAQ5s1mcLqXjU3AgLg1A2lOIH102G8zEkasvJdBVlY=
github.com/Clever/kayvee-go/v7 v7.7.0/go.mod h1:B2IcQE7OK8rpYvDotSAvCtfZqZ1UqTs1YacM+YFtxR8=
github.com/Clever/launch-gen v0.0.0-20230222233441-17c275320509 h1:MnKINIQc6ZVuNC6IztCq/1JODd+wm6RYKTTKfXpO7Wk=
github.com/Clever/launch-gen v0.0.0-20230222233441-17c275320509/go.mod h1:SN5Cf87o/YLSIXOmShxJfVfN6yADVr3S+IlHD2sltXA=
github.com/Clever/wag/logging/wagclientlogger v0.0.0-20220916194010-36f974d66e08/go.mod h1:NPerIFemV/7da/vNGALWkky+mit4ulSa24NSalIXgpo=
github.com/Clever/wag/logging/wagclientlogger v0.0.0-20221024182247-2bf828ef51be h1:1q4fCi5CfB+ru7uqnwRg4xWKBDwwATDptNxebm2Kx0g=
github.com/Clever/wag/logging/wagclientlogger v0.0.0-20221024182247-2bf828ef51be/go.mod h1:NPerIFemV/7da/vNGALWkky+mit4ulSa24NSalIXgpo=
Expand Down Expand Up @@ -400,8 +401,6 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:
github.com/xeipuuv/gojsonschema v0.0.0-20171025060643-212d8a0df7ac/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/xeipuuv/gojsonschema v1.2.1-0.20200424115421-065759f9c3d7 h1:tdnG+ZILOafvA29+pYKP3gauEbigHll3PHsf1GQa2ms=
github.com/xeipuuv/gojsonschema v1.2.1-0.20200424115421-065759f9c3d7/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand All @@ -422,14 +421,10 @@ go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.34
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.34.0/go.mod h1:zMu+r6aEorSQi8Ad0Y1fNrznm+VM8F10D2WlZp3HeFw=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0 h1:9NkMW03wwEzPtP/KciZ4Ozu/Uz5ZA7kfqXJIObnrjGU=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0/go.mod h1:548ZsYzmT4PL4zWKRd8q/N4z0Wxzn/ZxUE+lkEpwWQA=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 h1:aUEBEdCa6iamGzg6fuYxDA8ThxvOG240mAvWDU+XLio=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4/go.mod h1:l2MdsbKTocpPS5nQZscqTR9jd8u96VYZdcpF8Sye7mA=
go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs=
go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM=
go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw=
go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo=
go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4=
go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE=
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4=
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.8.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY=
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.9.0 h1:ggqApEjDKczicksfvZUCxuvoyDmR6Sbm56LwiK8DVR0=
Expand All @@ -448,8 +443,6 @@ go.opentelemetry.io/otel/internal/metric v0.26.0/go.mod h1:CbBP6AxKynRs3QCbhklyL
go.opentelemetry.io/otel/metric v0.26.0/go.mod h1:c6YL0fhRo4YVoNs6GoByzUgBp36hBL523rECoZA5UWg=
go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs=
go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A=
go.opentelemetry.io/otel/metric v0.33.0 h1:xQAyl7uGEYvrLAiV/09iTJlp1pZnQ9Wl793qbVvED1E=
go.opentelemetry.io/otel/metric v0.33.0/go.mod h1:QlTYc+EnYNq/M2mNk1qDDMRLpqCOj2f/r5c7Fd5FYaI=
go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs=
go.opentelemetry.io/otel/sdk v1.8.0/go.mod h1:uPSfc+yfDH2StDM/Rm35WE8gXSNdvCg023J6HeGNO0c=
go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo=
Expand All @@ -462,8 +455,6 @@ go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKu
go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4=
go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc=
go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo=
go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ=
go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ=
go.opentelemetry.io/proto/otlp v0.18.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
Expand Down
37 changes: 35 additions & 2 deletions golang.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is the default Clever Golang Makefile.
# It is stored in the dev-handbook repo, github.com/Clever/dev-handbook
# Please do not alter this file directly.
GOLANG_MK_VERSION := 1.0.1
GOLANG_MK_VERSION := 1.1.0

SHELL := /bin/bash
SYSTEM := $(shell uname -a | cut -d" " -f1 | tr '[:upper:]' '[:lower:]')
Expand Down Expand Up @@ -102,6 +102,21 @@ define golang-test-strict
@go test -v -race $(1)
endef

# golang-test-strict-cover-deps is here for consistency
golang-test-strict-cover-deps:

# golang-test-strict-cover uses the Go toolchain to run all tests in the pkg with the race and cover flag.
# appends coverage results to coverage.txt
# arg1: pkg path
define golang-test-strict-cover
@echo "TESTING $(1)..."
@go test -v -race -cover -coverprofile=profile.tmp -covermode=atomic $(1)
@if [ -f profile.tmp ]; then \
cat profile.tmp | tail -n +2 >> coverage.txt; \
rm profile.tmp; \
fi;
endef

# golang-vet-deps is here for consistency
golang-vet-deps:

Expand Down Expand Up @@ -137,11 +152,24 @@ $(call golang-vet,$(1))
$(call golang-test-strict,$(1))
endef

# golang-test-all-strict-cover-deps: installs all dependencies needed for different test cases.
golang-test-all-strict-cover-deps: golang-fmt-deps golang-lint-deps-strict golang-test-strict-cover-deps golang-vet-deps

# golang-test-all-strict-cover calls fmt, lint, vet and test on the specified pkg with strict and cover
# requirements that no errors are thrown while linting.
# arg1: pkg path
define golang-test-all-strict-cover
$(call golang-fmt,$(1))
$(call golang-lint-strict,$(1))
$(call golang-vet,$(1))
$(call golang-test-strict-cover,$(1))
endef

# golang-build: builds a golang binary. ensures CGO build is done during CI. This is needed to make a binary that works with a Docker alpine image.
# arg1: pkg path
# arg2: executable name
define golang-build
@echo "BUILDING..."
@echo "BUILDING $(2)..."
@if [ -z "$$CI" ]; then \
go build -o bin/$(2) $(1); \
else \
Expand All @@ -150,6 +178,11 @@ else \
fi;
endef

# golang-setup-coverage: set up the coverage file
define golang-setup-coverage:
@echo "mode: atomic" > coverage.txt
endef

# golang-update-makefile downloads latest version of golang.mk
golang-update-makefile:
@wget https://raw.githubusercontent.com/Clever/dev-handbook/master/make/golang-v1.mk -O /tmp/golang.mk 2>/dev/null
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ info:
description: Orchestrator for AWS Step Functions
# when changing the version here, make sure to
# re-run `make generate` to generate clients and server
version: 0.14.3
version: 0.15.0
x-npm-package: workflow-manager
schemes:
- http
Expand Down
11 changes: 6 additions & 5 deletions wag.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
WAG_MK_VERSION := 0.6.1
# This is the default Clever Wag Makefile.
# Please do not alter this file directly.
WAG_MK_VERSION := 0.7.0
SHELL := /bin/bash
SYSTEM := $(shell uname -a | cut -d" " -f1 | tr '[:upper:]' '[:lower:]')
ifndef CI
WAG_INSTALLED := $(shell [[ -e "bin/wag" ]] && bin/wag --version)
WAG_LATEST = $(shell curl --retry 5 -f -s https://api.github.com/repos/Clever/wag/releases | grep tag_name | head -1 | cut -d\" -f4)
WAG_LATEST = $(shell curl --retry 5 -f -s https://api.github.com/repos/Clever/wag/releases/latest | grep tag_name | cut -d\" -f4)
endif
.PHONY: wag-update-makefile ensure-wag-version-set wag-generate-deps

Expand All @@ -20,7 +22,6 @@ ensure-wag-version-set:
bin/wag: ensure-wag-version-set
@mkdir -p bin
$(eval WAG_VERSION := $(if $(filter latest,$(WAG_VERSION)),$(WAG_LATEST),$(WAG_VERSION)))
@echo $(WAG_VERSION), $(WAG_INSTALLED)
@echo "Checking for wag updates..."
@echo "Using wag version $(WAG_INSTALLED)"
@if [[ "$(WAG_VERSION)" != "$(WAG_INSTALLED)" ]]; \
Expand Down Expand Up @@ -52,7 +53,7 @@ endif
define wag-yaml-aliases
@if [ -z "$$CI" ]; then \
cat $(1) | python3 -c "import sys, yaml, json; y=yaml.load(sys.stdin.read(), yaml.Loader); print(yaml.dump(y))" > /tmp/swagger.catapult.yml; \
bin/wag -output-path gen-go -js-path ./gen-js -file /tmp/swagger.catapult.yml; \
bin/wag -output-path ./gen-go -js-path ./gen-js -file /tmp/swagger.catapult.yml; \
(cd ./gen-js && ../node_modules/.bin/jsdoc2md index.js types.js > ./README.md); \
else \
echo "skipping wag-yaml-aliases in CI"; \
Expand All @@ -75,7 +76,7 @@ endef
# arg1: path to swagger.yml
define wag-generate-mod
@if [ -z "$$CI" ]; then \
bin/wag -output-path gen-go -js-path ./gen-js -file $(1); \
bin/wag -output-path ./gen-go -js-path ./gen-js -file $(1); \
(cd ./gen-js && ../node_modules/.bin/jsdoc2md index.js types.js > ./README.md); \
else \
echo "skipping wag-generate-mod in CI"; \
Expand Down

0 comments on commit 936d1e0

Please sign in to comment.