Skip to content

Add build workflow for metering-test-adapter image - #171

Merged
omer-vishlitzky merged 1 commit into
osac-project:mainfrom
omer-vishlitzky:fix/metering-test-adapter-build
Aug 6, 2026
Merged

omer-vishlitzky merged 1 commit into
osac-project:mainfrom
omer-vishlitzky:fix/metering-test-adapter-build

Conversation

@omer-vishlitzky

@omer-vishlitzky omer-vishlitzky commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add build-metering-test-adapter-image.yaml — builds and publishes ghcr.io/osac-project/metering-test-adapter on push to main and semver tags, mirroring the existing metering-service workflow
  • Add metering-test-adapter to the VMaaS E2E components array so PR builds also build and load it onto the test cluster

Problem

The metering-test-adapter has source code (osac-metering/metering-service/cmd/test-adapter), a Containerfile (Containerfile.test-adapter), and full Helm chart integration — but no CI workflow to build the image. VMaaS CI values enable metering.testAdapter.enabled: true, so helm install --wait blocks indefinitely on ImagePullBackOff for ghcr.io/osac-project/metering-test-adapter:latest (403 — image doesn't exist).

Every VMaaS full-install E2E run has been failing at "Install OSAC" since the metering test-adapter was enabled in CI values. BMaaS and CaaS are unaffected (test-adapter not enabled in their values).

Test plan

  • This PR's own VMaaS E2E should pass the "Install OSAC" step (test-adapter image built and loaded from PR code)
  • After merge, verify ghcr.io/osac-project/metering-test-adapter:latest exists in GHCR
  • Confirm periodic VMaaS runs recover

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added automated builds for the metering test-adapter container image.
    • Added support for building the test-adapter image during full installation workflows.
    • Images can be tagged and published automatically for eligible builds and releases.

The metering-test-adapter Containerfile, source code, and Helm chart
integration all exist, but no CI workflow builds and publishes the
container image. This causes every VMaaS E2E run to fail at
"Install OSAC" with ImagePullBackOff on
ghcr.io/osac-project/metering-test-adapter:latest (403 Forbidden).

- Add build-metering-test-adapter-image.yaml mirroring the existing
  metering-service build workflow but targeting Containerfile.test-adapter
- Add the test-adapter to the E2E VMaaS components array so PR builds
  also build and load it onto the test cluster

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: omer-vishlitzky <omer.vishlitzky@gmail.com>
@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: omer-vishlitzky

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The PR adds a GitHub Actions workflow to build and conditionally publish the metering test-adapter image. It also adds this image to the VMaaS full-install component build list.

Changes

Metering test-adapter image

Layer / File(s) Summary
Build and publish workflow
.github/workflows/build-metering-test-adapter-image.yaml
The workflow handles triggers, concurrency, GHCR authentication, release tag validation, Docker metadata, and conditional image build and push operations.
VMaaS component wiring
.github/workflows/e2e-vmaas-full-install.yml
The VMaaS full-install workflow builds the metering test-adapter image with its dedicated Containerfile and repository override key.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant DockerMetadata
  participant GHCR
  GitHubActions->>DockerMetadata: Generate image tags and version metadata
  DockerMetadata-->>GitHubActions: Return Docker metadata
  GitHubActions->>GHCR: Push the built image for eligible events
Loading

Possibly related PRs

Suggested labels: ok-to-test

Suggested reviewers: eliorerz

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: adding a workflow to build the metering test-adapter image.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets ✅ Passed The PR adds no hardcoded credentials; the only secret match is the standard ${{ secrets.GITHUB_TOKEN }} reference, and scans found no literal keys, passwords, private keys, embedded credentials,...
No-Weak-Crypto ✅ Passed The PR only adds workflow configuration. It contains no weak cipher, custom crypto, or secret comparison; its SHA image tag and concurrency key are non-cryptographic identifiers.
No-Injection-Vectors ✅ Passed Changed workflows contain none of the specified injection constructs; the only shell block quotes GITHUB_REF_NAME and validates it against a restrictive semver regex before GITHUB_ENV writes.
Container-Privileges ✅ Passed The changed workflows set no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation options; the built image uses USER 65532 and the pod enforces runAsNonRoot.
No-Sensitive-Data-In-Logs ✅ Passed Changed workflows log only a release tag and job statuses; GITHUB_TOKEN is passed as the registry password, and the test-adapter Containerfile has no secret or logging commands.
Ai-Attribution ✅ Passed AI use is disclosed in the PR and commit; the PR commit has an Assisted-by: Claude Code trailer and no Co-Authored-By trailer.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@omer-vishlitzky
omer-vishlitzky merged commit 86a0eba into osac-project:main Aug 6, 2026
19 of 20 checks passed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build-metering-test-adapter-image.yaml:
- Around line 70-77: Update the publishing job containing the “Build and push
Docker image” step to grant `id-token: write` in its permissions, limited to
that job. Expose the build digest via the action step’s `id` and add a
subsequent step that runs only when `push` is enabled, signing
`steps.build.outputs.digest` with the repository’s established Sigstore/cosign
tooling.
- Around line 31-32: Update the “Checkout repository” step using
actions/checkout@v7 to set persist-credentials to false in its with
configuration, while leaving the existing checkout behavior unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 851938dc-918a-4940-92db-6c855db502d7

📥 Commits

Reviewing files that changed from the base of the PR and between 0067d19 and d9a1195.

📒 Files selected for processing (2)
  • .github/workflows/build-metering-test-adapter-image.yaml
  • .github/workflows/e2e-vmaas-full-install.yml

Comment on lines +31 to +32
- name: Checkout repository
uses: actions/checkout@v7

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file=".github/workflows/build-metering-test-adapter-image.yaml"

echo "== file exists =="
test -f "$file" && echo yes || echo no

echo "== workflow excerpts =="
if test -f "$file"; then
  nl -ba "$file" | sed -n '1,220p'
fi

echo "== checkout occurrences in workflow =="
rg -n "actions/checkout|persist-credentials|GITHUB_TOKEN|docker login|podman login|GHCR|ghcr|registry" "$file" || true

Repository: osac-project/osac

Length of output: 242


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file=".github/workflows/build-metering-test-adapter-image.yaml"

echo "== workflow excerpts =="
awk '{printf "%6u  %s\n", NR, $0}' "$file" | sed -n '1,220p'

echo
echo "== checkout occurrences in workflow =="
grep -nE "actions/checkout|persist-credentials|GITHUB_TOKEN|docker login|podman login|GHCR|ghcr|registry" "$file" || true

Repository: osac-project/osac

Length of output: 3788


Sensitive Data Exposure (CWE-522): Insufficiently Protected Credentials

Disable checkout credential persistence.

actions/checkout@v7 stores GITHUB_TOKEN in local Git config by default. No later step performs Git operations; registry push credentials come from the separate login step, so no other credential is required. Set with: persist-credentials: false.

🧰 Tools
🪛 zizmor (1.29.0)

[warning] 31-32: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-metering-test-adapter-image.yaml around lines 31 -
32, Update the “Checkout repository” step using actions/checkout@v7 to set
persist-credentials to false in its with configuration, while leaving the
existing checkout behavior unchanged.

Source: Linters/SAST tools

Comment on lines +70 to +77
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: osac-metering/metering-service
file: osac-metering/metering-service/Containerfile.test-adapter
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow header and relevant sections =="
cat -n .github/workflows/build-metering-test-adapter-image.yaml | sed -n '1,140p'

echo
echo "== occurrences of github-token permissions, id-token, cosign/Sigstore, docker/build-push and push outputs =="
rg -n "permissions:|id-token:|GITHUB_TOKEN|cosign|sigstore|docker/build-push-action|docker/build-push-action@|build:|outputs:|digest|ghcr|push:" .github/workflows/build-metering-test-adapter-image.yaml

Repository: osac-project/osac

Length of output: 3815


Security Misconfiguration (CWE-345)

Reachability: External

Sign each published image digest.

This workflow publishes GHCR images without a Sigstore or cosign signature. Add a push-only signing step for steps.build.outputs.digest, and grant id-token: write only to the publishing job.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-metering-test-adapter-image.yaml around lines 70 -
77, Update the publishing job containing the “Build and push Docker image” step
to grant `id-token: write` in its permissions, limited to that job. Expose the
build digest via the action step’s `id` and add a subsequent step that runs only
when `push` is enabled, signing `steps.build.outputs.digest` with the
repository’s established Sigstore/cosign tooling.

Source: Path instructions

This branch was previously deployed

1 inactive deployment
e2e-test — d9a11952 Deployed Aug 6, 2026 by omer-vishlitzky via e2e-caas-full-install / e2e #586
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant