Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix codegen for fork #9

Merged
merged 2 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,7 @@ jobs:
run: |
mkdir -p /home/runner/go/src/github.com/argoproj
ln -s "$PWD" /home/runner/go/src/github.com/argoproj/argo-workflows
- run: |
pwd
ls -lrth
echo "---"
ls -lrth /home/runner/go/src/github.com/argoproj/argo-workflows
cd /home/runner/go/src/github.com/argoproj/argo-workflows
make codegen -B STATIC_FILES=false
- run: make codegen -B STATIC_FILES=false
- run: git diff --exit-code

lint:
Expand Down
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,23 @@ $(info KUBECTX=$(KUBECTX) DOCKER_DESKTOP=$(DOCKER_DESKTOP) K3D=$(K3D) DOCKER_PUS
$(info RUN_MODE=$(RUN_MODE) PROFILE=$(PROFILE) AUTH_MODE=$(AUTH_MODE) SECURE=$(SECURE) STATIC_FILES=$(STATIC_FILES) ALWAYS_OFFLOAD_NODE_STATUS=$(ALWAYS_OFFLOAD_NODE_STATUS) UPPERIO_DB_DEBUG=$(UPPERIO_DB_DEBUG) LOG_LEVEL=$(LOG_LEVEL) NAMESPACED=$(NAMESPACED))

override LDFLAGS += \
-X github.com/pipekit/argo-workflows/v3.version=$(VERSION) \
-X github.com/pipekit/argo-workflows/v3.buildDate=${BUILD_DATE} \
-X github.com/pipekit/argo-workflows/v3.gitCommit=${GIT_COMMIT} \
-X github.com/pipekit/argo-workflows/v3.gitTreeState=${GIT_TREE_STATE}
-X github.com/argoproj/argo-workflows/v3.version=$(VERSION) \
-X github.com/argoproj/argo-workflows/v3.buildDate=${BUILD_DATE} \
-X github.com/argoproj/argo-workflows/v3.gitCommit=${GIT_COMMIT} \
-X github.com/argoproj/argo-workflows/v3.gitTreeState=${GIT_TREE_STATE}

ifneq ($(GIT_TAG),)
override LDFLAGS += -X github.com/pipekit/argo-workflows/v3.gitTag=${GIT_TAG}
override LDFLAGS += -X github.com/argoproj/argo-workflows/v3.gitTag=${GIT_TAG}
endif

ifndef $(GOPATH)
GOPATH=$(shell go env GOPATH)
export GOPATH
endif

ARGOEXEC_PKGS := $(shell echo cmd/argoexec && go list -f '{{ join .Deps "\n" }}' ./cmd/argoexec/ | grep 'pipekit/argo-workflows/v3/' | cut -c 39-)
CLI_PKGS := $(shell echo cmd/argo && go list -f '{{ join .Deps "\n" }}' ./cmd/argo/ | grep 'pipekit/argo-workflows/v3/' | cut -c 39-)
CONTROLLER_PKGS := $(shell echo cmd/workflow-controller && go list -f '{{ join .Deps "\n" }}' ./cmd/workflow-controller/ | grep 'pipekit/argo-workflows/v3/' | cut -c 39-)
ARGOEXEC_PKGS := $(shell echo cmd/argoexec && go list -f '{{ join .Deps "\n" }}' ./cmd/argoexec/ | grep 'argoproj/argo-workflows/v3/' | cut -c 39-)
CLI_PKGS := $(shell echo cmd/argo && go list -f '{{ join .Deps "\n" }}' ./cmd/argo/ | grep 'argoproj/argo-workflows/v3/' | cut -c 39-)
CONTROLLER_PKGS := $(shell echo cmd/workflow-controller && go list -f '{{ join .Deps "\n" }}' ./cmd/workflow-controller/ | grep 'argoproj/argo-workflows/v3/' | cut -c 39-)
TYPES := $(shell find pkg/apis/workflow/v1alpha1 -type f -name '*.go' -not -name openapi_generated.go -not -name '*generated*' -not -name '*test.go')
CRDS := $(shell find manifests/base/crds -type f -name 'argoproj.io_*.yaml')
SWAGGER_FILES := pkg/apiclient/_.primary.swagger.json \
Expand Down Expand Up @@ -142,7 +142,7 @@ define protoc
--grpc-gateway_out=logtostderr=true:$(GOPATH)/src \
--swagger_out=logtostderr=true,fqn_for_swagger_name=true:. \
$(1)
perl -i -pe 's|pipekit/argo-workflows/|pipekit/argo-workflows/v3/|g' `echo "$(1)" | sed 's/proto/pb.go/g'`
perl -i -pe 's|argoproj/argo-workflows/|argoproj/argo-workflows/v3/|g' `echo "$(1)" | sed 's/proto/pb.go/g'`

endef

Expand Down Expand Up @@ -545,8 +545,8 @@ pkg/apis/workflow/v1alpha1/openapi_generated.go: $(GOPATH)/bin/openapi-gen $(TYP
[ -e ./v3 ] || ln -s . v3
$(GOPATH)/bin/openapi-gen \
--go-header-file ./hack/custom-boilerplate.go.txt \
--input-dirs github.com/pipekit/argo-workflows/v3/pkg/apis/workflow/v1alpha1 \
--output-package github.com/pipekit/argo-workflows/v3/pkg/apis/workflow/v1alpha1 \
--input-dirs github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1 \
--output-package github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1 \
--report-filename pkg/apis/api-rules/violation_exceptions.list
# Delete the link
[ -e ./v3 ] && rm -rf v3
Expand All @@ -558,7 +558,7 @@ pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go: $(TYPES)
[ -e ./v3 ] || ln -s . v3
bash $(GOPATH)/pkg/mod/k8s.io/code-generator@v0.21.5/generate-groups.sh \
"deepcopy,client,informer,lister" \
github.com/pipekit/argo-workflows/v3/pkg/client github.com/pipekit/argo-workflows/v3/pkg/apis \
github.com/argoproj/argo-workflows/v3/pkg/client github.com/argoproj/argo-workflows/v3/pkg/apis \
workflow:v1alpha1 \
--go-header-file ./hack/custom-boilerplate.go.txt
# Delete the link
Expand Down