From e4c3c1b3566e6bd9a88921582979cbf376f92e50 Mon Sep 17 00:00:00 2001 From: sg Date: Fri, 30 Aug 2024 17:23:26 +0100 Subject: [PATCH] fix #327, change dependency track consumer's debug flag name --- api/proto/v1/engine.pb.go | 7 +++---- api/proto/v1/issue.pb.go | 7 +++---- buf.gen.yaml | 5 +++++ components/consumers/dependency-track/main.go | 10 +++++----- components/consumers/dependency-track/task.yaml | 2 +- components/consumers/jira/Makefile | 4 ++-- .../pipelines/cdxgen-project/kustomization.yaml | 3 ++- .../pipelines/cdxgen-project/pipelinerun.yaml | 16 +++++++++++----- .../pipelines/golang-project/pipelinerun.yaml | 4 +--- 9 files changed, 33 insertions(+), 25 deletions(-) diff --git a/api/proto/v1/engine.pb.go b/api/proto/v1/engine.pb.go index b93fd46be..1a549eaf7 100644 --- a/api/proto/v1/engine.pb.go +++ b/api/proto/v1/engine.pb.go @@ -1,18 +1,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.33.0 // protoc (unknown) // source: api/proto/v1/engine.proto package v1 import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( diff --git a/api/proto/v1/issue.pb.go b/api/proto/v1/issue.pb.go index d0d2ec3fa..29876da09 100644 --- a/api/proto/v1/issue.pb.go +++ b/api/proto/v1/issue.pb.go @@ -1,18 +1,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.33.0 // protoc (unknown) // source: api/proto/v1/issue.proto package v1 import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( diff --git a/buf.gen.yaml b/buf.gen.yaml index 3afb99547..685b9b1d0 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -3,6 +3,11 @@ plugins: - local: protoc-gen-go out: . opt: paths=source_relative + - remote: buf.build/protocolbuffers/python:v27.3 + out: gen + # dependencies + - remote: buf.build/protocolbuffers/pyi:v27.3 + out: gen inputs: - proto_file: api/proto/v1/issue.proto - proto_file: api/proto/v1/engine.proto diff --git a/components/consumers/dependency-track/main.go b/components/consumers/dependency-track/main.go index 5446edc2c..b6cde3e8d 100644 --- a/components/consumers/dependency-track/main.go +++ b/components/consumers/dependency-track/main.go @@ -28,7 +28,7 @@ var ( client *dtrack.Client ownerAnnotation string // used for debugging, turns off certificate and enables debug - debug bool + debugDT bool ) func main() { @@ -37,7 +37,7 @@ func main() { flag.StringVar(&projectName, "projectName", "", "dependency track project name") flag.StringVar(&projectUUID, "projectUUID", "", "dependency track project name") flag.StringVar(&projectVersion, "projectVersion", "", "dependency track project version") - flag.BoolVar(&debug, "debug", false, "setup client with no tls and enable debug") + flag.BoolVar(&debugDT, "debugDT", false, "setup client with no tls and enable debug") flag.StringVar( &ownerAnnotation, "ownerAnnotation", @@ -71,11 +71,11 @@ func main() { dtrack.WithHttpClient( &http.Client{Transport: &http.Transport{ TLSClientConfig: &tls.Config{ - InsecureSkipVerify: debug, + InsecureSkipVerify: debugDT, }, }, }), - dtrack.WithDebug(debug), + dtrack.WithDebug(debugDT), dtrack.WithAPIKey(apiKey), ) if err != nil { @@ -86,7 +86,7 @@ func main() { if err != nil { log.Fatalf("cannot connect to Dependency Track at %s, err:'%v'", authURL, err) } - slog.Info("connection to DT successful listed projects in instance", "projects", abt.Projects) + slog.Info("Connection to DT successful, projects in instance:", "instance", abt.Projects) if consumers.Raw { responses, err := consumers.LoadToolResponse() if err != nil { diff --git a/components/consumers/dependency-track/task.yaml b/components/consumers/dependency-track/task.yaml index 7d2b7067e..743fcd642 100644 --- a/components/consumers/dependency-track/task.yaml +++ b/components/consumers/dependency-track/task.yaml @@ -41,5 +41,5 @@ spec: "-projectVersion", "$(params.consumer-dependency-track-project-version)", "-projectUUID", "$(params.consumer-dependency-track-project-uuid)", "-ownerAnnotation","$(params.consumer-dependency-track-owner-annotation)", - "-debug", "$(params.consumer-dependency-track-debug)" + "-debugDT", "$(params.consumer-dependency-track-debug)" ] diff --git a/components/consumers/jira/Makefile b/components/consumers/jira/Makefile index bb2408a88..b160f0073 100644 --- a/components/consumers/jira/Makefile +++ b/components/consumers/jira/Makefile @@ -8,10 +8,10 @@ PRODUCER_AGGREGATOR_BASE_IMAGE=$(shell test -e .custom_image && cat .custom_imag DOCKER=docker container: - $(DOCKER) build --tag $(CONTAINER_REPO)/components/consumers/jira:$(DRACON_VERSION) \ + $(DOCKER) build --tag $(CONTAINER_REPO)/components/consumers/dependency-track:$(DRACON_VERSION) \ --file Dockerfile \ $$([ "${SOURCE_CODE_REPO}" != "" ] && echo "--label=org.opencontainers.image.source=${SOURCE_CODE_REPO}" ) \ ../../../bin 1>&2 publish: - $(DOCKER) push $(CONTAINER_REPO)/components/consumers/jira:$(DRACON_VERSION) 1>&2 + $(DOCKER) push $(CONTAINER_REPO)/components/consumers/dependency-track:$(DRACON_VERSION) 1>&2 diff --git a/examples/pipelines/cdxgen-project/kustomization.yaml b/examples/pipelines/cdxgen-project/kustomization.yaml index 03668753b..647466b1e 100644 --- a/examples/pipelines/cdxgen-project/kustomization.yaml +++ b/examples/pipelines/cdxgen-project/kustomization.yaml @@ -9,4 +9,5 @@ components: - pkg:helm/dracon-oss-components/producer-aggregator - pkg:helm/dracon-oss-components/enricher-deduplication - pkg:helm/dracon-oss-components/enricher-aggregator - - pkg:helm/dracon-oss-components/consumer-stdout-json \ No newline at end of file + - pkg:helm/dracon-oss-components/consumer-stdout-json + - components/consumers/dependency-track diff --git a/examples/pipelines/cdxgen-project/pipelinerun.yaml b/examples/pipelines/cdxgen-project/pipelinerun.yaml index 9cb917173..856c44c16 100644 --- a/examples/pipelines/cdxgen-project/pipelinerun.yaml +++ b/examples/pipelines/cdxgen-project/pipelinerun.yaml @@ -9,11 +9,17 @@ spec: name: dracon-cdxgen-project params: - name: git-clone-url - value: https://github.com/ocurity/e2e-monorepo.git - - name: b64-signature-key - # THIS IS AN EXAMPLE, PLEASE USE A PROPERLY SECURED SECRET KEY IN PRODUCTION - # Corresponding public key for verification is MOt7TFuLyGB9yRN5mcIeAPa6jKoFglkwEwGBTOVLeXI= - value: Lvbo+wAsW8Y4ENBA+lAikOwGTYAIXCQ49eRMEwClv94w63tMW4vIYH3JE3mZwh4A9rqMqgWCWTATAYFM5Ut5cg== + value: 'https://github.com/sqreen/go-dvwa.git' + - name: consumer-dependency-track-api-url + value: http://192.168.1.13:8081 + - name: consumer-dependency-track-project-name + value: cdxgen-test + - name: consumer-dependency-track-project-version + value: "0.1.0" + - name: consumer-dependency-track-token + value: odt_HvaqxzTkekZeiI5Nd2I73azqxh31hadL + - name: consumer-dependency-track-project-uuid + value: ac819655-8e0d-4117-8ae8-1b05e9723b23 workspaces: - name: output subPath: source-code diff --git a/examples/pipelines/golang-project/pipelinerun.yaml b/examples/pipelines/golang-project/pipelinerun.yaml index 0b1ff15f2..b6e67f375 100644 --- a/examples/pipelines/golang-project/pipelinerun.yaml +++ b/examples/pipelines/golang-project/pipelinerun.yaml @@ -8,9 +8,7 @@ spec: name: dracon-golang-project params: - name: git-clone-url - value: https://github.com/ocurity/e2e-monorepo.git - - name: git-clone-subdirectory - value: source-code + value: 'https://github.com/sqreen/go-dvwa.git' workspaces: - name: output volumeClaimTemplate: