From b9833406f47138bec3d28b2464bc4601324bb384 Mon Sep 17 00:00:00 2001 From: Diego Noceda Date: Mon, 3 Nov 2025 12:07:12 +0100 Subject: [PATCH 1/6] Configure hermetic builds and prefetch --- .tekton/export-service-pull-request.yaml | 4 ++++ .tekton/export-service-push.yaml | 4 ++++ Dockerfile | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.tekton/export-service-pull-request.yaml b/.tekton/export-service-pull-request.yaml index 8b20e051..12e9d1be 100644 --- a/.tekton/export-service-pull-request.yaml +++ b/.tekton/export-service-pull-request.yaml @@ -28,6 +28,10 @@ spec: value: 5d - name: dockerfile value: Dockerfile + - name: hermetic + value: "true" + - name: prefetch-input + value: '[{"type": "gomod", "path": "."}]' pipelineRef: params: - name: url diff --git a/.tekton/export-service-push.yaml b/.tekton/export-service-push.yaml index 7ad79bae..975bd2b1 100644 --- a/.tekton/export-service-push.yaml +++ b/.tekton/export-service-push.yaml @@ -25,6 +25,10 @@ spec: value: quay.io/redhat-user-workloads/hcc-integrations-tenant/export-service/export-service:{{revision}} - name: dockerfile value: Dockerfile + - name: hermetic + value: "true" + - name: prefetch-input + value: '[{"type": "gomod", "path": "."}]' pipelineRef: params: - name: url diff --git a/Dockerfile b/Dockerfile index 84668550..3fc9db40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ RUN GO111MODULE=on go build -ldflags "-w -s" -o export-service cmd/export-servic ############################ FROM registry.access.redhat.com/ubi9-minimal:latest -RUN microdnf update -y +# RUN microdnf update -y # TODO:Cannot be run in hermetic builds COPY --from=builder /workspace/export-service /usr/bin COPY --from=builder /workspace/db/migrations /db/migrations/ From 0467e1895fff244069b3e2f0a0f76f5a03b658a4 Mon Sep 17 00:00:00 2001 From: Diego Noceda Date: Mon, 3 Nov 2025 12:23:15 +0100 Subject: [PATCH 2/6] Enable the prefetch package-manager --- .tekton/export-service-pull-request.yaml | 2 ++ .tekton/export-service-push.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.tekton/export-service-pull-request.yaml b/.tekton/export-service-pull-request.yaml index 12e9d1be..252e55ce 100644 --- a/.tekton/export-service-pull-request.yaml +++ b/.tekton/export-service-pull-request.yaml @@ -32,6 +32,8 @@ spec: value: "true" - name: prefetch-input value: '[{"type": "gomod", "path": "."}]' + - name: prefetch-dev-package-managers + value: "true" pipelineRef: params: - name: url diff --git a/.tekton/export-service-push.yaml b/.tekton/export-service-push.yaml index 975bd2b1..130eff22 100644 --- a/.tekton/export-service-push.yaml +++ b/.tekton/export-service-push.yaml @@ -29,6 +29,8 @@ spec: value: "true" - name: prefetch-input value: '[{"type": "gomod", "path": "."}]' + - name: prefetch-dev-package-managers + value: "true" pipelineRef: params: - name: url From 1d402be86dd9435f21858cfc88df1d5a9c8e1f88 Mon Sep 17 00:00:00 2001 From: Diego Noceda Date: Mon, 3 Nov 2025 12:30:22 +0100 Subject: [PATCH 3/6] specify go toolchain as 1.24.x format --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 3faa3b16..ceb9c7b1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/redhatinsights/export-service-go -go 1.24 +go 1.24.0 require ( github.com/RedHatInsights/event-schemas-go v1.0.6 From 4b63742d482e0247cf6e828613de416e5730149a Mon Sep 17 00:00:00 2001 From: Diego Noceda Date: Mon, 3 Nov 2025 12:45:26 +0100 Subject: [PATCH 4/6] Drop the prefetch of the package manager --- .tekton/export-service-pull-request.yaml | 2 -- .tekton/export-service-push.yaml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.tekton/export-service-pull-request.yaml b/.tekton/export-service-pull-request.yaml index 252e55ce..12e9d1be 100644 --- a/.tekton/export-service-pull-request.yaml +++ b/.tekton/export-service-pull-request.yaml @@ -32,8 +32,6 @@ spec: value: "true" - name: prefetch-input value: '[{"type": "gomod", "path": "."}]' - - name: prefetch-dev-package-managers - value: "true" pipelineRef: params: - name: url diff --git a/.tekton/export-service-push.yaml b/.tekton/export-service-push.yaml index 130eff22..975bd2b1 100644 --- a/.tekton/export-service-push.yaml +++ b/.tekton/export-service-push.yaml @@ -29,8 +29,6 @@ spec: value: "true" - name: prefetch-input value: '[{"type": "gomod", "path": "."}]' - - name: prefetch-dev-package-managers - value: "true" pipelineRef: params: - name: url From 888f9797ba0a5fea59bcd1df420b984f4c6420ef Mon Sep 17 00:00:00 2001 From: Diego Noceda Date: Mon, 3 Nov 2025 13:08:52 +0100 Subject: [PATCH 5/6] enable the microdnf update for testing purposes --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3fc9db40..7454c45e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ RUN GO111MODULE=on go build -ldflags "-w -s" -o export-service cmd/export-servic ############################ FROM registry.access.redhat.com/ubi9-minimal:latest -# RUN microdnf update -y # TODO:Cannot be run in hermetic builds +RUN microdnf update -y # TODO:Cannot be run in hermetic builds COPY --from=builder /workspace/export-service /usr/bin COPY --from=builder /workspace/db/migrations /db/migrations/ From a14b14829d86bf5add36df977ff65e9347315ebe Mon Sep 17 00:00:00 2001 From: Diego Noceda Date: Mon, 3 Nov 2025 13:28:43 +0100 Subject: [PATCH 6/6] Removed microdnf exec after confirming it doesn't work in hermetic builds --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7454c45e..f860bf29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,8 +37,6 @@ RUN GO111MODULE=on go build -ldflags "-w -s" -o export-service cmd/export-servic ############################ FROM registry.access.redhat.com/ubi9-minimal:latest -RUN microdnf update -y # TODO:Cannot be run in hermetic builds - COPY --from=builder /workspace/export-service /usr/bin COPY --from=builder /workspace/db/migrations /db/migrations/ COPY --from=builder /workspace/static/spec/openapi.json /var/tmp/openapi.json