Skip to content

Support artifacts export via Tekton volumeClaimTemplate#73

Merged
avasilevskii merged 5 commits intoopenshift-psap:mainfrom
avasilevskii:artifacts-export-support
Apr 29, 2026
Merged

Support artifacts export via Tekton volumeClaimTemplate#73
avasilevskii merged 5 commits intoopenshift-psap:mainfrom
avasilevskii:artifacts-export-support

Conversation

@avasilevskii
Copy link
Copy Markdown
Collaborator

@avasilevskii avasilevskii commented Apr 29, 2026

Implement support for artifacts export from Forge by mounting a Tekton PipelineRun scoped volumeClaimTemplate.
Closes #15.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced shared artifact storage across pipeline tasks, backed by a dynamically provisioned PersistentVolumeClaim. Configure storage size using the FOURNOS_ARTIFACT_PVC_SIZE environment variable (default: 5Gi).
    • Added automatic artifact export functionality to finalize artifact collection after pipeline execution.
  • Documentation

    • Updated architecture and setup documentation to describe artifact storage configuration and workspace implementation.

Signed-off-by: avasilev <avasilev@redhat.com>
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 29, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kpouget for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Warning

Rate limit exceeded

@avasilevskii has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 22 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b7738661-bc43-4042-aa7c-b9a2f94548c8

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd94db and 34321c3.

📒 Files selected for processing (5)
  • config/forge/workflows/pipeline-full.yaml
  • config/forge/workflows/pipeline-test-only.yaml
  • config/forge/workflows/tasks.yaml
  • fournos/settings.py
  • manifests/crd.yaml
📝 Walkthrough

Walkthrough

This PR introduces shared artifact storage across Tekton pipeline tasks using workspaces backed by dynamically provisioned PersistentVolumeClaims, enabling tasks to collaboratively write artifacts to a unified location accessible by an export-artifacts finally task.

Changes

Cohort / File(s) Summary
Documentation
Fournos_Design_Document.md, README.md
Updated pipeline matrix to document new forge-full and forge-test-only pipeline structures with artifact export stages; introduced FOURNOS_ARTIFACT_PVC_SIZE environment variable for PVC sizing.
Production Pipelines & Tasks
config/forge/workflows/pipeline-full.yaml, config/forge/workflows/pipeline-test-only.yaml, config/forge/workflows/tasks.yaml
Added artifacts workspace declaration to pipelines and propagated it into all task invocations; updated task script to use workspace path instead of fixed /tmp/artifacts and scope artifacts by step name; introduced export-artifacts finally task for both pipelines.
Mock/Development Pipelines & Tasks
dev/mock-pipelines/pipeline-full.yaml, dev/mock-pipelines/pipeline-run-only.yaml, dev/mock-pipelines/tasks.yaml
Added artifacts workspace declarations and task bindings across all mock pipeline definitions; extended fournos-run script to write artifact marker file to workspace subdirectory.
Settings & PipelineRun Generation
fournos/settings.py, fournos/core/tekton.py
Added artifact_pvc_size configuration parameter (default "1Gi"); extended PipelineRun spec to declare artifacts workspace with volumeClaimTemplate for dynamic PVC provisioning per pipeline run.
Tests
tests/conftest.py, tests/test_scheduling.py
Added helper function get_pipelinerun_workspaces() to retrieve workspace configurations; extended test_cluster_pinned to validate presence of artifacts workspace with volumeClaimTemplate.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant K8s as Kubernetes API
    participant PVC as Persistent Volume
    participant Task1 as Prepare Task
    participant Task2 as Test Task
    participant ExportTask as Export-Artifacts Task

    User->>K8s: Create PipelineRun with artifacts workspace<br/>volumeClaimTemplate
    K8s->>PVC: Provision PVC (artifact_pvc_size)
    K8s->>Task1: Mount artifacts workspace
    Task1->>PVC: Write artifacts to step/prepare/*
    K8s->>Task2: Mount artifacts workspace
    Task2->>PVC: Write artifacts to step/test/*
    K8s->>ExportTask: Run finally task with complete<br/>artifact tree mounted
    ExportTask->>PVC: Read all artifacts (step/prepare/*<br/>+ step/test/*)
    ExportTask->>User: Export artifacts
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PR #9: Both PRs modify Tekton pipeline and task YAML scaffolding in config/forge/workflows/* and dev/mock-pipelines/*, with this PR extending those definitions to add workspace declarations and artifact handling.
  • PR #28: Both PRs modify config/forge/workflows/tasks.yaml artifact handling logic, changing how and where build artifacts are written and exposed across pipeline execution.
  • PR #59: Both PRs modify PipelineRun generation in fournos/core/tekton.py to add workspace/volume configurations to the PipelineRun spec sent to Kubernetes API.

Suggested labels

lgtm

Poem

🐰 A workspace for artifacts we've made,
Per-PVC, where task treasures are laid,
From prepare through test, each step leaves its trace,
Then finally, we gather them all in one place! 🎁

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR implements artifact export infrastructure (PVC-based workspace, artifact collection mechanism) but does not complete the full MVP requirement of uploading to S3 or finalizing artifact retrieval for OCPCI. Clarify whether this PR is an intermediate step providing the artifact storage foundation, or if S3 upload/OCPCI retrieval implementation is expected in this PR.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main implementation: adding support for artifacts export through Tekton volumeClaimTemplate mechanism.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing artifact export infrastructure via Tekton PVC workspaces. No unrelated modifications were detected.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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
Review rate limit: 0/1 reviews remaining, refill in 3 minutes and 22 seconds.

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

Comment thread fournos/settings.py Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/test_scheduling.py (1)

52-59: Use safe key access in workspace lookup.

Using w.get("name") keeps the assertion path cleaner if a malformed workspace object appears.

Suggested tweak
-    artifacts_ws = next((w for w in workspaces if w["name"] == "artifacts"), None)
+    artifacts_ws = next((w for w in workspaces if w.get("name") == "artifacts"), None)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/test_scheduling.py` around lines 52 - 59, The workspace lookup uses
w["name"] which can raise KeyError for malformed workspace objects; update the
generator in get_pipelinerun_workspaces test to use w.get("name") when finding
the artifacts workspace (e.g., workspaces =
get_pipelinerun_workspaces("test-cluster"); artifacts_ws = next((w for w in
workspaces if w.get("name") == "artifacts"), None)) so the assertion path stays
clean and the subsequent assertions on artifacts_ws and its
"volumeClaimTemplate" key remain valid.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@config/forge/workflows/pipeline-full.yaml`:
- Around line 67-83: The post-cleanup finally task is sending job-step:
pre-cleanup instead of job-step: post-cleanup causing it not to run as intended;
update the post-cleanup task's params so job-step is set to post-cleanup (match
the task's intended behavior) and then resolve the Tekton finally-task
parallelism by merging export-artifacts and post-cleanup into a single finally
task (e.g., export-and-cleanup) or otherwise ensure sequencing (you cannot rely
on runAfter between finally tasks), adjusting the taskRef (forge-step) params
and workspace usage accordingly to avoid races on the artifacts workspace.

---

Nitpick comments:
In `@tests/test_scheduling.py`:
- Around line 52-59: The workspace lookup uses w["name"] which can raise
KeyError for malformed workspace objects; update the generator in
get_pipelinerun_workspaces test to use w.get("name") when finding the artifacts
workspace (e.g., workspaces = get_pipelinerun_workspaces("test-cluster");
artifacts_ws = next((w for w in workspaces if w.get("name") == "artifacts"),
None)) so the assertion path stays clean and the subsequent assertions on
artifacts_ws and its "volumeClaimTemplate" key remain valid.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: b64f306e-beba-494b-a645-363ab8c9a3e0

📥 Commits

Reviewing files that changed from the base of the PR and between 93195b2 and 8dd94db.

📒 Files selected for processing (12)
  • Fournos_Design_Document.md
  • README.md
  • config/forge/workflows/pipeline-full.yaml
  • config/forge/workflows/pipeline-test-only.yaml
  • config/forge/workflows/tasks.yaml
  • dev/mock-pipelines/pipeline-full.yaml
  • dev/mock-pipelines/pipeline-run-only.yaml
  • dev/mock-pipelines/tasks.yaml
  • fournos/core/tekton.py
  • fournos/settings.py
  • tests/conftest.py
  • tests/test_scheduling.py

Comment thread config/forge/workflows/pipeline-full.yaml
Comment thread config/forge/workflows/pipeline-test-only.yaml
Signed-off-by: avasilev <avasilev@redhat.com>
Signed-off-by: avasilev <avasilev@redhat.com>
Signed-off-by: avasilev <avasilev@redhat.com>
Signed-off-by: avasilev <avasilev@redhat.com>
@kpouget
Copy link
Copy Markdown
Collaborator

kpouget commented Apr 29, 2026

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 29, 2026
@avasilevskii
Copy link
Copy Markdown
Collaborator Author

/test deploy-fournos-wip

@psap-forge-bot
Copy link
Copy Markdown

🟢 Test of 'fournos_deploy --project-source' succeeded after 00 hours 10 minutes 24 seconds 🟢

• Link to the test results.

• No reports index generated...

Test configuration:

/test deploy-fournos-wip

Execution logs

@avasilevskii avasilevskii merged commit 83811e2 into openshift-psap:main Apr 29, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MVP: Allow exporting the Job artifacts

2 participants