Skip to content

ci: Add external postgresql logs#340

Merged
dsavineau merged 1 commit intoansible:mainfrom
dsavineau:ci_external_postgresql_logs
Apr 13, 2026
Merged

ci: Add external postgresql logs#340
dsavineau merged 1 commit intoansible:mainfrom
dsavineau:ci_external_postgresql_logs

Conversation

@dsavineau
Copy link
Copy Markdown
Contributor

@dsavineau dsavineau commented Apr 13, 2026

Only the internal managed postgresql pod get logs gathered at the end of the CI run.
When using an external database (like one of the CI scenario) then those logs aren't gathered.

Summary by CodeRabbit

  • Chores
    • Enhanced CI/CD pipeline logging capabilities to better support different database scenarios during automated testing.
    • Improved database log collection mechanisms to ensure comprehensive diagnostics across multiple test deployment configurations.
    • Streamlined log retrieval processes for various environment setups to improve debugging efficiency.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

Both CI and PR workflow files are updated to conditionally fetch database logs based on the matrix.SCENARIO parameter. When the scenario is externaldb, logs are retrieved from a locally-run PostgreSQL Docker container; for all other scenarios, Kubernetes logs are used.

Changes

Cohort / File(s) Summary
GitHub Workflows - Log Collection
.github/workflows/ci.yml, .github/workflows/pr.yml
Updated "Get logs" step to conditionally fetch PostgreSQL logs. For externaldb scenario, switches to Docker environment and retrieves logs from local postgresql container via docker logs. For other scenarios, retains existing kubectl logs behavior with label selector.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: Add external postgresql logs' clearly and concisely describes the main change—adding PostgreSQL log collection for external databases in CI workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

@dsavineau dsavineau force-pushed the ci_external_postgresql_logs branch from 83869f4 to 2ebede0 Compare April 13, 2026 19:31
Only the internal managed postgresql pod get logs gathered at the end
of the CI run.
When using an external database (like one of the CI scenario) then those
logs aren't gathered.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
@dsavineau dsavineau force-pushed the ci_external_postgresql_logs branch from 2ebede0 to 3415718 Compare April 13, 2026 19:47
@sonarqubecloud
Copy link
Copy Markdown

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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 126-128: The eval command in the "Get logs" step is currently not
tolerant to failure, so if eval $(minikube -p minikube docker-env) fails it
aborts log collection; change that invocation to be best-effort (e.g., make the
eval non-fatal by appending a failure-tolerant operator such as "|| true" or
otherwise ensuring the shell does not exit on failure) so the subsequent docker
logs postgresql || true still runs; apply the same change to the matching line
in .github/workflows/pr.yml where eval $(minikube -p minikube docker-env)
appears.

In @.github/workflows/pr.yml:
- Around line 120-122: The unguarded eval $(minikube -p minikube docker-env) can
fail and abort the always() log-collection step; modify the step to guard that
command (e.g., append "|| true" or otherwise tolerate failure) so the eval
cannot cause the job to exit before running docker logs postgresql --tail 1000;
locate the eval invocation and update it to be a no-fail invocation (eval
$(minikube -p minikube docker-env) || true) so docker logs postgresql still
runs.
🪄 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: CHILL

Plan: Pro Plus

Run ID: 397ce906-b9e5-4813-bcd7-b1d677f6197e

📥 Commits

Reviewing files that changed from the base of the PR and between 3ab62d8 and 3415718.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • .github/workflows/pr.yml

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/pr.yml
@dsavineau dsavineau merged commit c069798 into ansible:main Apr 13, 2026
7 checks passed
@dsavineau dsavineau deleted the ci_external_postgresql_logs branch April 13, 2026 20:04
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