From 3f73e41acf7da2c4bf37e5ad89499e469233d592 Mon Sep 17 00:00:00 2001 From: Zhenya Tikhonov Date: Wed, 18 Nov 2026 20:08:12 +0400 Subject: [PATCH 1/4] refactor(codecov-reporter): use dedicated image --- incubating/codecov-reporter/Dockerfile | 29 ++++++++++++++++++++++ incubating/codecov-reporter/step.yaml | 33 +++++++------------------- 2 files changed, 38 insertions(+), 24 deletions(-) create mode 100644 incubating/codecov-reporter/Dockerfile diff --git a/incubating/codecov-reporter/Dockerfile b/incubating/codecov-reporter/Dockerfile new file mode 100644 index 000000000..86ba938bb --- /dev/null +++ b/incubating/codecov-reporter/Dockerfile @@ -0,0 +1,29 @@ +# syntax=docker/dockerfile:1 + +FROM --platform=${BUILDPLATFORM} alpine:3.24.4@sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf AS build +ARG CF_CLI_VERSION=v1.3.6 +ARG CODECOV_VERSION=v0.8.0 +ARG TARGETARCH +WORKDIR /download +RUN apk add --no-cache curl gnupg +RUN case "${TARGETARCH}" in \ + amd64) CF_OS=alpine-x64; CODECOV_OS=alpine ;; \ + arm64) CF_OS=alpine-arm64; CODECOV_OS=aarch64 ;; \ + *) echo "unsupported architecture: ${TARGETARCH}" >&2; exit 1 ;; \ + esac \ + && curl -fsSL "https://github.com/codefresh-io/cli/releases/download/${CF_CLI_VERSION}/codefresh-${CF_CLI_VERSION}-${CF_OS}.tar.gz" \ + | tar -xz codefresh \ + && curl -fsSL https://keybase.io/codecovsecops/pgp_keys.asc \ + | gpg --dearmor > codecov.gpg \ + && curl -fsSLO "https://uploader.codecov.io/${CODECOV_VERSION}/${CODECOV_OS}/codecov" \ + && curl -fsSLO "https://uploader.codecov.io/${CODECOV_VERSION}/${CODECOV_OS}/codecov.SHA256SUM" \ + && curl -fsSLO "https://uploader.codecov.io/${CODECOV_VERSION}/${CODECOV_OS}/codecov.SHA256SUM.sig" \ + && gpgv --keyring ./codecov.gpg codecov.SHA256SUM.sig codecov.SHA256SUM \ + && sha256sum -c codecov.SHA256SUM \ + && chmod +x codefresh codecov + + +FROM alpine:3.24.4@sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf +RUN apk add --no-cache git jq +COPY --from=build /download/codefresh /download/codecov /usr/local/bin/ +RUN codefresh version && codecov --version diff --git a/incubating/codecov-reporter/step.yaml b/incubating/codecov-reporter/step.yaml index c33d53e4a..d2b2cdb3e 100644 --- a/incubating/codecov-reporter/step.yaml +++ b/incubating/codecov-reporter/step.yaml @@ -66,7 +66,7 @@ spec: }, "os": { "type": "string", - "description": "OS being used ( alpine | linux | macos | windows )", + "description": "Deprecated and ignored: the Codecov uploader is now bundled in the step image and only supports Linux", "default": "linux" }, "working_directory": { @@ -77,32 +77,17 @@ spec: } } steps: - first: - title: "get token" - image: codefresh/cli - environment: - - CODECOV_INTEGRATION=${{codecov_integration}} - commands: - - export CODECOV_API_KEY=$(codefresh get context $CODECOV_INTEGRATION --decrypt -o yaml | yq -r -c .spec.data.token) - - export CODECOV_URL=$(codefresh get context $CODECOV_INTEGRATION --decrypt -o yaml | yq -r -c .spec.data.url) - - echo CODECOV_API_KEY=$CODECOV_API_KEY >> /meta/env_vars_to_export - - echo CODECOV_URL=$CODECOV_URL >> /meta/env_vars_to_export - second: + main: name: "send report" - image: node:24 + image: quay.io/codefreshplugins/codecov-reporter:2.1.1 environment: - - CODECOV_API_KEY=${{CODECOV_API_KEY}} + - CODECOV_INTEGRATION=${{codecov_integration}} - WORKING_DIRECTORY=${{working_directory}} - - os=${{os}} commands: + - CODECOV_CONTEXT=$(codefresh get context "$CODECOV_INTEGRATION" --decrypt -o json) + - CODECOV_API_KEY=$(echo "$CODECOV_CONTEXT" | jq -r .spec.data.token) + - CODECOV_URL=$(echo "$CODECOV_CONTEXT" | jq -r .spec.data.url) - cd ${WORKING_DIRECTORY} - - curl https://keybase.io/codecovsecops/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step - - curl -Os "https://uploader.codecov.io/latest/${{os}}/codecov" - - curl -Os "https://uploader.codecov.io/latest/${{os}}/codecov.SHA256SUM" - - curl -Os "https://uploader.codecov.io/latest/${{os}}/codecov.SHA256SUM.sig" - - gpgv codecov.SHA256SUM.sig codecov.SHA256SUM - - shasum -a 256 -c codecov.SHA256SUM - - chmod +x ./codecov - - ./codecov -t ${{CODECOV_API_KEY}} -u ${{CODECOV_URL}} -Q codefresh-2.0.0 | tee codecov.log + - codecov -t "$CODECOV_API_KEY" -u "$CODECOV_URL" -Q codefresh-2.0.0 | tee codecov.log # [<< timestamp >>] ['info'] {"status":"success","resultURL":"<< Codecov URL >>"} - - cf_export second_CF_OUTPUT_URL=$(grep -A0 'resultURL' codecov.log | awk 'BEGIN{FS="\"";}{print $8}') + - cf_export main_CF_OUTPUT_URL=$(grep -A0 'resultURL' codecov.log | awk 'BEGIN{FS="\"";}{print $8}') From d0f0d5489c0b9b1ee3f104712796cc4da4d66a83 Mon Sep 17 00:00:00 2001 From: Zhenya Tikhonov Date: Wed, 18 Nov 2026 20:24:14 +0400 Subject: [PATCH 2/4] ci: trigger build From c8904a06971b100a628f83e05303bf2c5e4191f7 Mon Sep 17 00:00:00 2001 From: Zhenya Tikhonov Date: Wed, 18 Nov 2026 20:28:04 +0400 Subject: [PATCH 3/4] ci: trigger build From 63edf8f93799163718725e0c5ca6a4c24bca9378 Mon Sep 17 00:00:00 2001 From: Zhenya Tikhonov Date: Wed, 18 Nov 2026 20:36:33 +0400 Subject: [PATCH 4/4] ci: bump version --- incubating/codecov-reporter/step.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/incubating/codecov-reporter/step.yaml b/incubating/codecov-reporter/step.yaml index d2b2cdb3e..365895526 100644 --- a/incubating/codecov-reporter/step.yaml +++ b/incubating/codecov-reporter/step.yaml @@ -3,7 +3,7 @@ kind: step-type metadata: name: codecov-reporter title: Sends a code scan report to codecov - version: 2.1.1 + version: 2.1.2 isPublic: true description: Sends a code scan report to codecov sources: @@ -79,7 +79,7 @@ spec: steps: main: name: "send report" - image: quay.io/codefreshplugins/codecov-reporter:2.1.1 + image: quay.io/codefreshplugins/codecov-reporter:2.1.2 environment: - CODECOV_INTEGRATION=${{codecov_integration}} - WORKING_DIRECTORY=${{working_directory}}