Skip to content

OLS-2926 - adding artifact exporting step and logs finalizer#2011

Open
JoaoFula wants to merge 1 commit into
openshift:release-4.19from
JoaoFula:add-playwright-artifact-exporting
Open

OLS-2926 - adding artifact exporting step and logs finalizer#2011
JoaoFula wants to merge 1 commit into
openshift:release-4.19from
JoaoFula:add-playwright-artifact-exporting

Conversation

@JoaoFula
Copy link
Copy Markdown
Contributor

@JoaoFula JoaoFula commented Jun 1, 2026

Summary by CodeRabbit

  • Chores
    • Enhanced test infrastructure with automated cluster artifact and log collection during integration tests.
    • Implemented pipeline steps to export and retain test artifacts for improved debugging and troubleshooting capabilities.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Warning

Review limit reached

@JoaoFula, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 49 minutes and 18 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b3d5af7f-097a-4bab-8998-02fc1cd28180

📥 Commits

Reviewing files that changed from the base of the PR and between faa7763 and 67c99b2.

📒 Files selected for processing (3)
  • .tekton/integration-tests/lightspeed-console-pre-commit.yaml
  • tests/support/fixtures.ts
  • tests/support/global-teardown.ts
📝 Walkthrough

Walkthrough

The PR adds artifact collection and export at two levels of the CI system: test teardown now gathers OpenShift cluster resources and pod logs locally, and the Tekton pipeline's finally section exports retained logs to Quay for diagnostics and retention.

Changes

Artifact Collection and Export

Layer / File(s) Summary
Cluster artifact gathering in test teardown
tests/support/fixtures.ts, tests/support/global-teardown.ts
Adds filesystem utilities, implements gatherClusterArtifacts() to export namespace resources as YAML and per-container pod logs, and invokes it in teardown with error suppression.
Pipeline finally task for log export
.tekton/integration-tests/lightspeed-console-pre-commit.yaml
Adds pipeline-level finally section with export-logs-for-retention task that exports logs to Quay using artifact bot credentials.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A rabbit hops through logs and streams,
Gathering artifacts for diagnostic dreams,
From teardown calls to pipeline's end,
Quay awaits each debug friend! 🏃‍♂️✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 accurately reflects the main changes: adding artifact exporting functionality and a logs finalizer step across the pipeline and test fixtures.
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.

✏️ 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

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

@openshift-ci openshift-ci Bot requested review from joshuawilson and syedriko June 1, 2026 10:44
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 1, 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 joaofula 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

@JoaoFula JoaoFula mentioned this pull request Jun 1, 2026
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.

🧹 Nitpick comments (1)
tests/support/fixtures.ts (1)

114-132: 💤 Low value

Consider capturing init/ephemeral and previous-instance logs.

The loop only iterates pod.spec?.containers, so logs from initContainers (and ephemeral debug containers) are skipped. Also, oc logs without --previous returns only the current instance — for a container that crashed/restarted during the run (the case you most want to diagnose), the useful logs are in the previous instance.

♻️ Possible extension to broaden log coverage
-        const containers = (pod.spec?.containers || []).map((c: { name: string }) => c.name);
+        const containers = [
+          ...(pod.spec?.initContainers || []),
+          ...(pod.spec?.containers || []),
+        ].map((c: { name: string }) => c.name);
         for (const container of containers) {
           const logs = safeOc(['logs', `pod/${podName}`, '-c', container, '-n', OLS_NAMESPACE]);
           if (logs) {
             fs.writeFileSync(path.join(podLogsDir, `${podName}-${container}.log`), logs);
           }
+          const prevLogs = safeOc([
+            'logs', `pod/${podName}`, '-c', container, '-n', OLS_NAMESPACE, '--previous',
+          ]);
+          if (prevLogs) {
+            fs.writeFileSync(path.join(podLogsDir, `${podName}-${container}-previous.log`), prevLogs);
+          }
         }
🤖 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 `@tests/support/fixtures.ts` around lines 114 - 132, The pod log collection
only iterates pod.spec?.containers so it misses initContainers and ephemeral
containers and it only grabs current logs; update the loop that processes pods
(podsJson -> pods parsing and the inner container iteration) to also include
names from pod.spec?.initContainers and any ephemeral containers (e.g.,
pod.status?.ephemeralContainerStatuses or equivalent), and when invoking
safeOc(['logs', ...]) call it twice per container: once without and once with
the '--previous' flag to capture prior crashed instances; keep using podName and
container name to generate the same output filenames (e.g.,
`${podName}-${container}.log`) but ensure you avoid clobbering by appending
suffixes like `.previous` or `.ephemeral` when appropriate.
🤖 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.

Nitpick comments:
In `@tests/support/fixtures.ts`:
- Around line 114-132: The pod log collection only iterates pod.spec?.containers
so it misses initContainers and ephemeral containers and it only grabs current
logs; update the loop that processes pods (podsJson -> pods parsing and the
inner container iteration) to also include names from pod.spec?.initContainers
and any ephemeral containers (e.g., pod.status?.ephemeralContainerStatuses or
equivalent), and when invoking safeOc(['logs', ...]) call it twice per
container: once without and once with the '--previous' flag to capture prior
crashed instances; keep using podName and container name to generate the same
output filenames (e.g., `${podName}-${container}.log`) but ensure you avoid
clobbering by appending suffixes like `.previous` or `.ephemeral` when
appropriate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3f97ee76-16e0-4d0f-acbd-ef65671cd2f0

📥 Commits

Reviewing files that changed from the base of the PR and between 1927f45 and faa7763.

📒 Files selected for processing (3)
  • .tekton/integration-tests/lightspeed-console-pre-commit.yaml
  • tests/support/fixtures.ts
  • tests/support/global-teardown.ts

adding artifact exporting step and logs finalizer
@JoaoFula JoaoFula force-pushed the add-playwright-artifact-exporting branch from faa7763 to 67c99b2 Compare June 1, 2026 10:55
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