Skip to content

ci(integration-tests): Add workflow for package integration tests. - #2407

Open
quinntaylormitchell wants to merge 8 commits into
y-scope:mainfrom
quinntaylormitchell:integration-test-ci-package
Open

ci(integration-tests): Add workflow for package integration tests.#2407
quinntaylormitchell wants to merge 8 commits into
y-scope:mainfrom
quinntaylormitchell:integration-test-ci-package

Conversation

@quinntaylormitchell

@quinntaylormitchell quinntaylormitchell commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds the package-integration-tests workflow to clp-artifact-build. The workflow proceeds as follows:

  1. Downloads and untars the package tarball artifact
  2. Gets and loads the package image (either by pulling the image or downloading the artifact, as appropriate)
  3. Installs dependencies
  4. Runs smoke tests and package tests with uv run pytest -m 'smoke or package'
  5. Uploads the integration test logs after the run

The dev docs are updated w.r.t. the changes in clp-artifact-build.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

The package-integration-tests workflow passes.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Package image builds can now be published to a registry or exported as a downloadable local artifact.
    • Added package integration tests, smoke-test classification, and automatic test-log uploads.
  • Improvements
    • Updated package artifact naming and workflow coordination.
    • Streamlined package assembly and configuration generation.
    • Increased integration-test command timeouts for improved reliability.
  • Documentation
    • Updated workflow documentation to reflect the revised package build and testing process.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d3d73a76-d44a-41b5-a382-72803e21329a

📥 Commits

Reviewing files that changed from the base of the PR and between 116a4f0 and 4fa0ac1.

📒 Files selected for processing (2)
  • .github/workflows/clp-artifact-build.yaml
  • docs/src/dev-docs/tooling-gh-workflows.md

Walkthrough

The package image action now supports registry publishing or local tar artifacts. The packaging workflow builds and packages CLP components, transfers package artifacts, runs package integration tests, and updates job naming and documentation.

Changes

Package pipeline

Layer / File(s) Summary
Package image build action
.github/actions/clp-build-package-image/action.yaml
Renames the action, adds push_image and image_ref, selects registry or tar output, and conditionally uploads local image artifacts.
Package assembly and workflow orchestration
taskfile.yaml, .github/workflows/clp-artifact-build.yaml
Extracts package assembly, runs schema generation once, builds the package image, creates package artifacts, and updates matrix and manifest-job wiring.
Integration-test validation and workflow documentation
integration-tests/*, .github/workflows/clp-artifact-build.yaml, docs/src/dev-docs/tooling-gh-workflows.md
Adds smoke-test categorization, increases the subprocess timeout, tests downloaded package artifacts, uploads logs, and documents the renamed workflow jobs.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PackageJob
  participant PackageImageAction
  participant PackageArtifact
  participant PackageIntegrationTests
  PackageJob->>PackageImageAction: build package image
  PackageImageAction-->>PackageJob: return image_ref
  PackageJob->>PackageArtifact: upload package tarball
  PackageIntegrationTests->>PackageArtifact: download and extract package
  PackageIntegrationTests->>PackageIntegrationTests: load local image or pull published image
  PackageIntegrationTests-->>PackageJob: run smoke and package tests
Loading

Possibly related PRs

  • y-scope/clp#2273: Both changes pass UBUNTU_VERSION_CODENAME to package image builds.
  • y-scope/clp#2334: Both changes modify package integration-test jobs and artifact handling.

Suggested reviewers: kirkrodrigues, junhaoliao, jackluo923

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title focuses on adding package integration tests to the workflow, which is the primary objective stated in the PR summary, but the changeset includes substantial modifications to the build action, build process, and related infrastructure beyond just the integration tests.
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.
✨ 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.

@quinntaylormitchell
quinntaylormitchell marked this pull request as ready for review July 30, 2026 19:36
@quinntaylormitchell
quinntaylormitchell requested a review from a team as a code owner July 30, 2026 19:36

@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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
docs/src/dev-docs/tooling-gh-workflows.md (1)

17-48: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

New package-integration-tests job isn't reflected in the dependency graph or job list.

The diagram and bullet list were updated to rename package-imagepackage, but the newly added package-integration-tests job (which depends on package) is missing from both the Mermaid DAG and the job descriptions below it.

📝 Proposed doc additions
     ubuntu-jammy-deps-image --> package
+    package --> package-integration-tests
     ubuntu-jammy-binaries --> ubuntu-jammy-binaries-image
 * `package`: Builds CLP's package, along with a container image containing the package's components.
+* `package-integration-tests`: Runs smoke and package integration tests against the built package and container image.
 * `ubuntu-jammy-binaries`: Builds the CLP-core binaries in the built Ubuntu Jammy container and runs

Also applies to: 50-76

🤖 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 `@docs/src/dev-docs/tooling-gh-workflows.md` around lines 17 - 48, Update the
tooling workflow documentation’s Mermaid DAG and job list to include the
package-integration-tests job, showing its dependency on package. Preserve the
existing package naming and dependency relationships while adding the missing
job in both documented sections.
.github/workflows/clp-artifact-build.yaml (2)

682-783: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Both new/renamed jobs run with default (broad) GITHUB_TOKEN permissions.

Neither package nor package-integration-tests declares a permissions: block, so both inherit the repository's default token scope even though package logs in to ghcr.io with secrets.GITHUB_TOKEN. Consider scoping down to least privilege (e.g., contents: read, packages: write only where needed).

Also applies to: 785-867

🤖 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/clp-artifact-build.yaml around lines 682 - 783, Restrict
the GITHUB_TOKEN permissions for the package and package-integration-tests jobs
by adding explicit permissions blocks. Grant only contents: read, and add
packages: write solely to the job that pushes the GHCR package image; keep
package-integration-tests read-only unless its steps require no registry write
access.

Source: Linters/SAST tools


721-736: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate run-on-image configuration between "Build the package without the package image" and "Assemble the package directory structure".

Both steps share identical image_name/use_published_image expressions, differing only in run_command. Consider factoring the common with: block out (e.g., via a job-level env or YAML anchor) to avoid having to keep two copies in sync.

Also applies to: 749-764

🤖 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/clp-artifact-build.yaml around lines 721 - 736, Factor the
duplicated image_name and use_published_image configuration shared by the “Build
the package without the package image” and “Assemble the package directory
structure” run-on-image steps into a reusable job-level value or YAML anchor,
then have both steps reference it while retaining their distinct run_command
values.
🤖 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/actions/clp-build-package-image/action.yaml:
- Around line 97-111: Update the image_path construction in the “Compute image
output properties” step to include a workflow-run-unique identifier, such as
github.run_id, alongside image_name and arch. Keep the existing output
properties and push_image branching unchanged while ensuring concurrent runs
cannot write the same tar path.
- Around line 126-132: Update the “Upload package image as artifact” step to use
actions/upload-artifact pinned to b7c566a772e6b6bfb58ed0dc250532a479d7789f
(v6.0.0), matching the artifact build workflow, while preserving its existing
condition and inputs.

In @.github/workflows/clp-artifact-build.yaml:
- Around line 799-801: Update the checkout step using actions/checkout in the
artifact build job to set persist-credentials to false alongside the existing
recursive submodules option. Preserve the pinned action version and all other
checkout behavior.
- Around line 749-783: Update the package assembly steps around “Write the
package image reference” to also create the package’s VERSION file before “Tar
the package directories” runs. Reuse the same VERSION value and format
established by the package-assemble/package flow, ensuring build/clp-package
contains VERSION alongside clp-package-image.id in the uploaded artifact.

---

Outside diff comments:
In @.github/workflows/clp-artifact-build.yaml:
- Around line 682-783: Restrict the GITHUB_TOKEN permissions for the package and
package-integration-tests jobs by adding explicit permissions blocks. Grant only
contents: read, and add packages: write solely to the job that pushes the GHCR
package image; keep package-integration-tests read-only unless its steps require
no registry write access.
- Around line 721-736: Factor the duplicated image_name and use_published_image
configuration shared by the “Build the package without the package image” and
“Assemble the package directory structure” run-on-image steps into a reusable
job-level value or YAML anchor, then have both steps reference it while
retaining their distinct run_command values.

In `@docs/src/dev-docs/tooling-gh-workflows.md`:
- Around line 17-48: Update the tooling workflow documentation’s Mermaid DAG and
job list to include the package-integration-tests job, showing its dependency on
package. Preserve the existing package naming and dependency relationships while
adding the missing job in both documented sections.
🪄 Autofix (Beta)

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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ade561a1-cc6e-413e-9c37-0af22d9fdd89

📥 Commits

Reviewing files that changed from the base of the PR and between 0f08ff9 and 3a2b518.

📒 Files selected for processing (7)
  • .github/actions/clp-build-package-image/action.yaml
  • .github/workflows/clp-artifact-build.yaml
  • docs/src/dev-docs/tooling-gh-workflows.md
  • integration-tests/.pytest.ini
  • integration-tests/tests/test_clp_native_py_project_imports.py
  • integration-tests/tests/utils/classes.py
  • taskfile.yaml

Comment on lines +97 to +111
- name: "Compute image output properties"
id: "output-properties"
shell: "bash"
run: |
image_name="${{steps.compute-meta.outputs.IMAGE_NAME}}"
if [[ "${{inputs.push_image}}" == "true" ]]; then
echo "image_output=type=registry" >> "$GITHUB_OUTPUT"
else
image_path="/tmp/${image_name}-image-${{inputs.arch}}.tar"
echo "image_path=${image_path}" >> "$GITHUB_OUTPUT"
echo "image_output=type=docker,dest=${image_path}" >> "$GITHUB_OUTPUT"
fi

- name: "Build and Push"
if: "github.event_name != 'pull_request' && github.ref == 'refs/heads/main'"
id: "build-and-push"

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.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Hardcoded /tmp tar path may collide across concurrent jobs on shared self-hosted runners.

image_path="/tmp/${image_name}-image-${{inputs.arch}}.tar" is fixed per arch but not per-workflow-run. On the self-hosted runner pool used by this repo, two concurrent runs (e.g., two PRs) building the same arch could write to the same /tmp path simultaneously.

🛠️ Proposed fix: scope the path to the run
-          image_path="/tmp/${image_name}-image-${{inputs.arch}}.tar"
+          image_path="${RUNNER_TEMP}/${image_name}-image-${{inputs.arch}}-${{github.run_id}}.tar"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: "Compute image output properties"
id: "output-properties"
shell: "bash"
run: |
image_name="${{steps.compute-meta.outputs.IMAGE_NAME}}"
if [[ "${{inputs.push_image}}" == "true" ]]; then
echo "image_output=type=registry" >> "$GITHUB_OUTPUT"
else
image_path="/tmp/${image_name}-image-${{inputs.arch}}.tar"
echo "image_path=${image_path}" >> "$GITHUB_OUTPUT"
echo "image_output=type=docker,dest=${image_path}" >> "$GITHUB_OUTPUT"
fi
- name: "Build and Push"
if: "github.event_name != 'pull_request' && github.ref == 'refs/heads/main'"
id: "build-and-push"
- name: "Compute image output properties"
id: "output-properties"
shell: "bash"
run: |
image_name="${{steps.compute-meta.outputs.IMAGE_NAME}}"
if [[ "${{inputs.push_image}}" == "true" ]]; then
echo "image_output=type=registry" >> "$GITHUB_OUTPUT"
else
image_path="${RUNNER_TEMP}/${image_name}-image-${{inputs.arch}}-${{github.run_id}}.tar"
echo "image_path=${image_path}" >> "$GITHUB_OUTPUT"
echo "image_output=type=docker,dest=${image_path}" >> "$GITHUB_OUTPUT"
fi
- name: "Build and Push"
id: "build-and-push"
🤖 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/actions/clp-build-package-image/action.yaml around lines 97 - 111,
Update the image_path construction in the “Compute image output properties” step
to include a workflow-run-unique identifier, such as github.run_id, alongside
image_name and arch. Keep the existing output properties and push_image
branching unchanged while ensuring concurrent runs cannot write the same tar
path.

Comment on lines +126 to +132
- name: "Upload package image as artifact"
if: "inputs.push_image == 'false'"
uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02"
with:
name: "clp-package-image-${{inputs.arch}}"
path: "${{steps.output-properties.outputs.image_path}}"
retention-days: 1

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow/action files =="
git ls-files '.github/workflows/*.yaml' '.github/actions/**/action.yaml' | sed -n '1,200p'

echo
echo "== target usage =="
rg -n "actions/upload-artifact|node-version|defaults:|runs-on:|actions/checkout|clp-build-package-image|path_to_repo" .github -S || true

echo
echo "== target snippet =="
nl -ba .github/actions/clp-build-package-image/action.yaml | sed -n '1,170p'

echo
echo "== tag/SHA resolution attempts =="
for ref in actions/upload-artifact@v4.6.2 actions/upload-artifact@v6.0.0; do
  echo "--- $ref"
  gh api "repos/$ref" --jq '{ref: .ref, object_type: .object.type, tag_object_sha: .object.sha, target_commit: (if .object.type=="tag" then .object.target_sha else .object.sha end)}' 2>/dev/null || echo "gh api failed"
done

Repository: y-scope/clp

Length of output: 7426


🌐 Web query:

GitHub Actions upload-artifact Node.js tool cache Node 20 deprecation Node 24 runners June 2026

💡 Result:

As of July 30, 2026, GitHub Actions has transitioned to Node.js 24 as the default runtime for JavaScript/TypeScript actions, a change that took effect on June 16, 2026 [1][2]. Key details regarding this transition include: Deprecation of Node 20: Node.js 20 reached end-of-life (EOL) in April 2026, leading to its deprecation as a supported runtime for GitHub Actions [1]. Default Runner Version: Beginning June 16, 2026, GitHub-hosted runners default to Node.js 24 [1][2]. Workflows using actions that still target Node.js 20 may trigger deprecation warnings [3][2]. Temporary Opt-Out: While Node.js 24 is the new default, users can temporarily continue using Node.js 20 by setting the environment variable ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true in their workflow file or on their runner machine [1][4]. This is a temporary measure intended only until Node.js 20 is completely removed from the runners, which is scheduled for the fall of 2026 [1]. Action Updates (upload-artifact): The official actions/upload-artifact action has been updated to v6.0.0, which uses Node.js 24 by default [5][6]. Users are strongly encouraged to update to the latest versions of their actions to ensure compatibility with the new Node.js 24 runtime [1]. Self-Hosted Considerations: Self-hosted runners require an upgrade to at least version 2.327.1 to support the Node.js 24 runtime [5][6]. Additionally, Node.js 24 does not support ARM32, meaning self-hosted runners on that architecture are no longer supported [1]. For users on GitHub Enterprise Server (GHES), check documentation as some versions may still require older, Node-specific releases of the upload-artifact action [7][8].

Citations:


🌐 Web query:

actions/upload-artifact v4 node-version action.yml

💡 Result:

The actions/upload-artifact@v4 action does not accept a node-version input in its action.yml file [1][2]. In GitHub Actions, the node-version input is specific to the actions/setup-node action, which is used to configure the Node.js environment on the runner [3][4]. The actions/upload-artifact action is a JavaScript-based GitHub Action that internally specifies its required Node.js runtime environment using the runs.using field within its own action.yml (e.g., node20 or similar, depending on the specific patch version of v4) [4][5]. Users do not need to—and cannot—configure the Node.js version of the artifact action itself through its inputs [1][6]. If you need to use a specific version of Node.js for tasks within your workflow, you should use actions/setup-node@v4 in a preceding step [3][4].

Citations:


Align upload-artifact to the Node 24-based release. The pinned release is still Node 20-based, while GitHub-hosted runners now default to Node 24; use the same actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f / v6.0.0 used by the artifact build workflow.

🤖 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/actions/clp-build-package-image/action.yaml around lines 126 - 132,
Update the “Upload package image as artifact” step to use
actions/upload-artifact pinned to b7c566a772e6b6bfb58ed0dc250532a479d7789f
(v6.0.0), matching the artifact build workflow, while preserving its existing
condition and inputs.

Comment on lines +749 to +783
- name: "Assemble the package directory structure"
uses: "./.github/actions/run-on-image"
env:
OS_NAME: "ubuntu-jammy"
with:
image_name: >-
${{format('{0}ubuntu-jammy',
matrix.arch == 'amd64' && env.DEPS_IMAGE_NAME_PREFIX_X86
|| env.DEPS_IMAGE_NAME_PREFIX_AARCH64)}}
use_published_image: >-
${{needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'false'
|| (github.event_name != 'pull_request' && github.ref == 'refs/heads/main')}}
run_command: >-
CLP_CPP_MAX_PARALLELISM_PER_BUILD_TASK=$(getconf _NPROCESSORS_ONLN)
HOME=/tmp
task package-assemble OUTPUT_DIR=build/clp-package

- name: "Write the package image reference"
shell: "bash"
run: >-
echo "${{steps.build-package-image.outputs.image_ref}}"
> "build/clp-package/clp-package-image.id"

- name: "Tar the package directories"
shell: "bash"
run: >-
tar --create --file "build/clp-package.tar"
--directory "build/clp-package" .

- name: "Upload the package tarball artifact"
uses: "actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f" # v6.0.0
with:
name: "${{env.PACKAGE_ARTIFACT_NAME_PREFIX}}${{matrix.arch}}"
path: "build/clp-package.tar"
retention-days: 1

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Repository files matching task/workflow/package names:\n'
git ls-files | rg '(^|/)(taskfile.*|.*workflow.*|.*package.*|.*install.*|.*release.*)' || true

printf '\nRelevant workflow section:\n'
if [ -f .github/workflows/clp-artifact-build.yaml ]; then
  nl -ba .github/workflows/clp-artifact-build.yaml | sed -n '700,790p'
fi

printf '\nSearch for package task/package-assemble/version behavior:\n'
rg -n "task package|package-assemble|G_PACKAGE_VERSION|VERSION|checksum|clp-package-image|clp-package.tar" -S .

Repository: y-scope/clp

Length of output: 31017


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'taskfile.yaml task package/assemble excerpts:\n'
awk 'NR>=120 && NR<=165 {printf "%d\t%s\n", NR, $0}' taskfile.yaml

printf '\nWorkflow assembly/tar/upload excerpt:\n'
awk 'NR>=720 && NR<=785 {printf "%d\t%s\n", NR, $0}' .github/workflows/clp-artifact-build.yaml

printf '\nVERSION/CLP_PACKAGE_VERSION references in taskfile/docker/package docs:\n'
rg -n "G_PACKAGE_VERSION|CLP_PACKAGE_VERSION|package-assemble|task package|VERSION|checksum" taskfile.yaml Dockerfile components package templates docs 2>/dev/null || true

printf '\nRead-only model of taskfile dependency chain:\n'
python3 - <<'PY'
from pathlib import Path
p=Path("taskfile.yaml")
text=p.read_text()
for alias in ["package:", "package-assemble:"]:
    idx=text.find(alias)
    print(f"{alias} line={text.count(chr(10),0,idx)+1 if idx!=-1 else None}")
    if idx!=-1:
        print(text[idx:idx+450])
        print("---")
PY

Repository: y-scope/clp

Length of output: 21392


Write VERSION before tarring the CI package artifact.

task package runs package-assemble, rsyncs clp-package-image.id, writes VERSION, and then computes the checksum. This workflow invokes package-assemble directly and tarball/uses the image id immediately after, so the uploaded artifact omits the version file that the local full package contract includes.

🩹 Proposed fix: write VERSION alongside the image id
       - name: "Write the package image reference"
         shell: "bash"
         run: >-
           echo "${{steps.build-package-image.outputs.image_ref}}"
           > "build/clp-package/clp-package-image.id"

+      - name: "Write the package version"
+        shell: "bash"
+        run: >-
+          echo "${{env.G_PACKAGE_VERSION}}" > "build/clp-package/VERSION"
+
       - name: "Tar the package directories"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: "Assemble the package directory structure"
uses: "./.github/actions/run-on-image"
env:
OS_NAME: "ubuntu-jammy"
with:
image_name: >-
${{format('{0}ubuntu-jammy',
matrix.arch == 'amd64' && env.DEPS_IMAGE_NAME_PREFIX_X86
|| env.DEPS_IMAGE_NAME_PREFIX_AARCH64)}}
use_published_image: >-
${{needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'false'
|| (github.event_name != 'pull_request' && github.ref == 'refs/heads/main')}}
run_command: >-
CLP_CPP_MAX_PARALLELISM_PER_BUILD_TASK=$(getconf _NPROCESSORS_ONLN)
HOME=/tmp
task package-assemble OUTPUT_DIR=build/clp-package
- name: "Write the package image reference"
shell: "bash"
run: >-
echo "${{steps.build-package-image.outputs.image_ref}}"
> "build/clp-package/clp-package-image.id"
- name: "Tar the package directories"
shell: "bash"
run: >-
tar --create --file "build/clp-package.tar"
--directory "build/clp-package" .
- name: "Upload the package tarball artifact"
uses: "actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f" # v6.0.0
with:
name: "${{env.PACKAGE_ARTIFACT_NAME_PREFIX}}${{matrix.arch}}"
path: "build/clp-package.tar"
retention-days: 1
- name: "Assemble the package directory structure"
uses: "./.github/actions/run-on-image"
env:
OS_NAME: "ubuntu-jammy"
with:
image_name: >-
${{format('{0}ubuntu-jammy',
matrix.arch == 'amd64' && env.DEPS_IMAGE_NAME_PREFIX_X86
|| env.DEPS_IMAGE_NAME_PREFIX_AARCH64)}}
use_published_image: >-
${{needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'false'
|| (github.event_name != 'pull_request' && github.ref == 'refs/heads/main')}}
run_command: >-
CLP_CPP_MAX_PARALLELISM_PER_BUILD_TASK=$(getconf _NPROCESSORS_ONLN)
HOME=/tmp
task package-assemble OUTPUT_DIR=build/clp-package
- name: "Write the package image reference"
shell: "bash"
run: >-
echo "${{steps.build-package-image.outputs.image_ref}}"
> "build/clp-package/clp-package-image.id"
- name: "Write the package version"
shell: "bash"
run: >-
echo "${{env.G_PACKAGE_VERSION}}" > "build/clp-package/VERSION"
- name: "Tar the package directories"
shell: "bash"
run: >-
tar --create --file "build/clp-package.tar"
--directory "build/clp-package" .
- name: "Upload the package tarball artifact"
uses: "actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f" # v6.0.0
with:
name: "${{env.PACKAGE_ARTIFACT_NAME_PREFIX}}${{matrix.arch}}"
path: "build/clp-package.tar"
retention-days: 1
🧰 Tools
🪛 zizmor (1.28.0)

[warning] 682-783: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)


[info] 769-769: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)

🤖 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/clp-artifact-build.yaml around lines 749 - 783, Update the
package assembly steps around “Write the package image reference” to also create
the package’s VERSION file before “Tar the package directories” runs. Reuse the
same VERSION value and format established by the package-assemble/package flow,
ensuring build/clp-package contains VERSION alongside clp-package-image.id in
the uploaded artifact.

Comment thread .github/workflows/clp-artifact-build.yaml Outdated

@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.

♻️ Duplicate comments (1)
.github/workflows/clp-artifact-build.yaml (1)

766-776: 🗄️ Data Integrity & Integration | 🟠 Major

Write VERSION before creating the package tarball.

This package flow writes clp-package-image.id but tars immediately afterwards, so the CI artifact still omits the package version metadata required by the package contract. Add build/clp-package/VERSION using the same version value as the normal package flow before line 772.

🤖 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/clp-artifact-build.yaml around lines 766 - 776, Update the
package build steps before “Tar the package directories” to write
build/clp-package/VERSION, using the same version value and sourcing mechanism
as the normal package flow. Keep the existing clp-package-image.id generation
intact, and ensure VERSION is created before the tar command runs.
🤖 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.

Duplicate comments:
In @.github/workflows/clp-artifact-build.yaml:
- Around line 766-776: Update the package build steps before “Tar the package
directories” to write build/clp-package/VERSION, using the same version value
and sourcing mechanism as the normal package flow. Keep the existing
clp-package-image.id generation intact, and ensure VERSION is created before the
tar command runs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6ea22891-2a53-4753-8b3a-f1a18d9beb89

📥 Commits

Reviewing files that changed from the base of the PR and between 3a2b518 and 5a9d76c.

📒 Files selected for processing (1)
  • .github/workflows/clp-artifact-build.yaml

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/src/dev-docs/tooling-gh-workflows.md (1)

10-12: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document package-image-multiarch-manifest.

The workflow runs package-image-multiarch-manifest after the package integration-test matrix succeeds, but the DAG and job list stop at package-integration-tests. Add the manifest edge and a job entry so the documentation matches the workflow.

This comparison uses the workflow's package-image-multiarch-manifest job.

Also applies to: 48-50, 79-82

🤖 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 `@docs/src/dev-docs/tooling-gh-workflows.md` around lines 10 - 12, Update the
workflow documentation’s job list and DAG to include the
package-image-multiarch-manifest job, showing it runs after the
package-integration-tests matrix succeeds. Ensure all referenced sections,
including the later job listing, consistently document this manifest job and
dependency edge.
.github/workflows/clp-artifact-build.yaml (1)

145-178: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Security Misconfiguration (CWE-732): Incorrect Permission Assignment for Critical Resource

Reachability: External

Declare least-privilege workflow permissions.

This workflow runs on Pull Requests and uses GITHUB_TOKEN in jobs without explicit job-level permissions. Set top-level permissions: {}, then add only required job-scoped permissions: contents: read for checkout, packages: write only for the publishing jobs, and keep the job that publishes the Spider worker image read-only when push: "${{github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}".

🤖 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/clp-artifact-build.yaml around lines 145 - 178, Set
top-level workflow permissions to empty, then add job-scoped contents: read
permissions for checkout-based jobs and packages: write only to jobs that
publish artifacts or images. For the Spider worker image publishing job, keep
permissions read-only while retaining its existing push condition; update the
relevant workflow jobs rather than only manylinux_2_28-deps-image.

Sources: Learnings, Linters/SAST tools

🤖 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.

Outside diff comments:
In @.github/workflows/clp-artifact-build.yaml:
- Around line 145-178: Set top-level workflow permissions to empty, then add
job-scoped contents: read permissions for checkout-based jobs and packages:
write only to jobs that publish artifacts or images. For the Spider worker image
publishing job, keep permissions read-only while retaining its existing push
condition; update the relevant workflow jobs rather than only
manylinux_2_28-deps-image.

In `@docs/src/dev-docs/tooling-gh-workflows.md`:
- Around line 10-12: Update the workflow documentation’s job list and DAG to
include the package-image-multiarch-manifest job, showing it runs after the
package-integration-tests matrix succeeds. Ensure all referenced sections,
including the later job listing, consistently document this manifest job and
dependency edge.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5bc565f6-19b4-4aed-a846-f97a2a540de2

📥 Commits

Reviewing files that changed from the base of the PR and between 0bd423e and 116a4f0.

📒 Files selected for processing (3)
  • .github/workflows/clp-artifact-build.yaml
  • docs/src/dev-docs/tooling-gh-workflows.md
  • taskfile.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant