diff --git a/.github/workflows/connect-profile-cpu-acceptance.yml b/.github/workflows/connect-profile-cpu-acceptance.yml index b2e7852e2..8e319b8be 100644 --- a/.github/workflows/connect-profile-cpu-acceptance.yml +++ b/.github/workflows/connect-profile-cpu-acceptance.yml @@ -37,6 +37,10 @@ on: description: Expected rustfs binary SHA-256 required: true type: string + connect_sha: + description: Exact 40-character RustFS Connect harness commit + required: true + type: string permissions: actions: read @@ -44,15 +48,37 @@ permissions: jobs: profile-cpu: - name: Verify native Linux x86_64 profile.cpu artifact + name: Verify native Linux x86_64 profile.cpu service job runs-on: ubuntu-latest - timeout-minutes: 15 + timeout-minutes: 45 steps: - name: Checkout acceptance harness uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 with: persist-credentials: false + - name: Checkout exact RustFS source + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 + with: + path: rustfs-source + persist-credentials: false + ref: ${{ inputs.source_sha }} + + - name: Checkout exact Connect harness + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 + with: + repository: rustfs/connect + path: connect-harness + persist-credentials: false + ref: ${{ inputs.connect_sha }} + + - name: Set up Node.js + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: 22.22.2 + cache: npm + cache-dependency-path: connect-harness/web/package-lock.json + - name: Verify source run and artifact identity shell: bash env: @@ -61,12 +87,18 @@ jobs: ARTIFACT_ID: ${{ inputs.artifact_id }} SOURCE_SHA: ${{ inputs.source_sha }} ARTIFACT_DIGEST: ${{ inputs.artifact_digest }} + CONNECT_SHA: ${{ inputs.connect_sha }} run: | set -euo pipefail [[ "$BUILD_RUN_ID" =~ ^[0-9]+$ ]] [[ "$ARTIFACT_ID" =~ ^[0-9]+$ ]] [[ "$SOURCE_SHA" =~ ^[0-9a-f]{40}$ ]] [[ "$ARTIFACT_DIGEST" =~ ^sha256:[0-9a-f]{64}$ ]] + [[ "$CONNECT_SHA" =~ ^[0-9a-f]{40}$ ]] + [[ $(git -C rustfs-source rev-parse HEAD) == "$SOURCE_SHA" ]] + [[ $(git -C connect-harness rev-parse HEAD) == "$CONNECT_SHA" ]] + [[ $(git -C rustfs-source remote get-url origin) == https://github.com/rustfs/rustfs ]] + [[ $(git -C connect-harness remote get-url origin) == https://github.com/rustfs/connect ]] run=$(gh api "repos/${GITHUB_REPOSITORY}/actions/runs/${BUILD_RUN_ID}") [[ $(jq -r '.conclusion' <<<"$run") == success ]] @@ -114,12 +146,29 @@ jobs: binary/rustfs "$SOURCE_SHA" "$BINARY_SHA256" \ profile-cpu-runtime-evidence.json profile-cpu.zip profile-cpu-bundle.zip + - name: Run signed service job acceptance + shell: bash + env: + SOURCE_SHA: ${{ inputs.source_sha }} + run: | + set -euo pipefail + printf '%s\n' "$SOURCE_SHA" >connect-harness/tests/e2e/connected/rustfs-ref + npm --prefix connect-harness/web ci + connect-harness/web/node_modules/.bin/playwright install --with-deps chromium + make -C connect-harness e2e-connected-dispatch-check + RUSTFS_BINARY="$GITHUB_WORKSPACE/binary/rustfs" \ + RUSTFS_WORKTREE="$GITHUB_WORKSPACE/rustfs-source" \ + CONNECT_E2E_PROFILE_EVIDENCE="$GITHUB_WORKSPACE/profile-service-job-evidence.json" \ + make -C connect-harness e2e-connected E2E_SCENARIO=profile + - name: Bind workflow and artifact provenance shell: bash env: BUILD_RUN_ID: ${{ inputs.build_run_id }} ARTIFACT_ID: ${{ inputs.artifact_id }} ARTIFACT_DIGEST: ${{ inputs.artifact_digest }} + CONNECT_SHA: ${{ inputs.connect_sha }} + SOURCE_SHA: ${{ inputs.source_sha }} run: | set -euo pipefail jq \ @@ -127,9 +176,21 @@ jobs: --arg buildRunId "$BUILD_RUN_ID" \ --arg artifactId "$ARTIFACT_ID" \ --arg artifactDigest "$ARTIFACT_DIGEST" \ - '. + {workflowRunId: $workflowRunId, buildRunId: $buildRunId, artifactId: $artifactId, artifactDigest: $artifactDigest}' \ + --arg connectSha "$CONNECT_SHA" \ + --arg sourceSha "$SOURCE_SHA" \ + '. + {workflowRunId: $workflowRunId, buildRunId: $buildRunId, artifactId: $artifactId, artifactDigest: $artifactDigest, connectSha: $connectSha, sourceSha: $sourceSha}' \ profile-cpu-runtime-evidence.json >profile-cpu-runtime-evidence.bound.json mv profile-cpu-runtime-evidence.bound.json profile-cpu-runtime-evidence.json + jq \ + --arg workflowRunId "$GITHUB_RUN_ID" \ + --arg buildRunId "$BUILD_RUN_ID" \ + --arg artifactId "$ARTIFACT_ID" \ + --arg artifactDigest "$ARTIFACT_DIGEST" \ + --arg connectSha "$CONNECT_SHA" \ + --arg sourceSha "$SOURCE_SHA" \ + '. + {workflowRunId: $workflowRunId, buildRunId: $buildRunId, artifactId: $artifactId, artifactDigest: $artifactDigest, connectSha: $connectSha, sourceSha: $sourceSha}' \ + profile-service-job-evidence.json >profile-service-job-evidence.bound.json + mv profile-service-job-evidence.bound.json profile-service-job-evidence.json - name: Upload acceptance evidence uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 @@ -139,5 +200,6 @@ jobs: profile-cpu-runtime-evidence.json profile-cpu.zip profile-cpu-bundle.zip + profile-service-job-evidence.json retention-days: 14 if-no-files-found: error