Skip to content

feat: display juju debug-log in integration test runs#360

Open
PietroPasotti wants to merge 34 commits into
mainfrom
feat/jdl-upload
Open

feat: display juju debug-log in integration test runs#360
PietroPasotti wants to merge 34 commits into
mainfrom
feat/jdl-upload

Conversation

@PietroPasotti
Copy link
Copy Markdown
Contributor

@PietroPasotti PietroPasotti commented Jul 7, 2025

Change to _charm-quality-checks.yaml (integration tests part) adding two steps:

for each file found in ./.logs:

  1. print to console
  2. upload it as artifact

the idea is, we can put our juju debug-log output in there, and the CI will display them and upload as artifact.

Context: canonical/pytest-jubilant#11

Tandem PR to demonstrate the workflow in action: https://github.com/canonical/o11y-tester-operator/actions/runs/16414197049

@PietroPasotti PietroPasotti requested a review from a team as a code owner July 7, 2025 11:54
Copy link
Copy Markdown
Contributor

@lucabello lucabello left a comment

Choose a reason for hiding this comment

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

To re-review this PR, I would like:

  • convert the PR title to conventional commits format, like we practice everywhere
  • test the branch with some repository (if you don't know which one, use https://github.com/canonical/o11y-tester-operator) and link a successful run here
  • consider updating the diagram here and see how it looks like (adding another box under integration tests maybe)?

Comment thread .github/workflows/_charm-quality-checks.yaml Outdated
Comment thread .github/workflows/_charm-quality-checks.yaml Outdated
Comment thread .github/workflows/_charm-quality-checks.yaml Outdated
Comment thread .github/workflows/_charm-quality-checks.yaml Outdated
Comment thread .github/workflows/_charm-quality-checks.yaml Outdated
@PietroPasotti PietroPasotti changed the title Display juju debug-log in integration test runs feat: display juju debug-log in integration test runs Jul 11, 2025
@PietroPasotti
Copy link
Copy Markdown
Contributor Author

@lucabello ready for another round, all points addressed

@PietroPasotti PietroPasotti requested a review from lucabello July 23, 2025 08:28
@PietroPasotti PietroPasotti changed the title feat: display juju debug-log in integration test runs [feat]: display juju debug-log in integration test runs Jul 23, 2025
@PietroPasotti PietroPasotti changed the title [feat]: display juju debug-log in integration test runs feat: display juju debug-log in integration test runs Jul 23, 2025
@lucabello lucabello requested a review from Copilot April 23, 2026 12:01
@lucabello
Copy link
Copy Markdown
Contributor

@copilot please make comment suggestions that would make the workflows lint pass.

Copy link
Copy Markdown

Copilot AI commented Apr 23, 2026

@copilot please make comment suggestions that would make the workflows lint pass.

Fixed in 07b4840. The issue was a shellcheck SC2193 warning on the [[ "${{ inputs.log-path }}" = /* ]] comparison — actionlint replaces GitHub expressions with placeholders before passing to shellcheck, so shellcheck saw a literal string being compared to a glob pattern (/*) and flagged it as "can never be equal". Replaced it with a case statement which shellcheck handles correctly. actionlint now passes with no errors.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the charm CI reusable workflows to surface integration test logs in GitHub Actions output and as downloadable artifacts, making debugging (e.g., Juju debug-log) easier across charm repositories.

Changes:

  • Adds a new log-path workflow input (default .logs) to control where integration test logs are collected from.
  • Updates the quality-checks workflow to display *.txt logs in the job output and upload the log directory as an artifact.
  • Updates the README Mermaid workflow diagram to include the new log display/upload steps.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.

File Description
README.md Documents the additional “Display logs” / “Upload logs” steps in the workflow diagram.
.github/workflows/charm-pull-request.yaml Introduces log-path input and forwards it into the reusable quality-checks workflow.
.github/workflows/_charm-quality-checks.yaml Adds log-path input and implements log display + upload behavior for integration runs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/_charm-quality-checks.yaml Outdated
Comment thread .github/workflows/charm-pull-request.yaml Outdated
Comment thread README.md Outdated
Comment thread .github/workflows/_charm-quality-checks.yaml
Comment thread .github/workflows/_charm-quality-checks.yaml
Comment thread .github/workflows/charm-pull-request.yaml Outdated
Comment thread README.md Outdated
Comment thread .github/workflows/_charm-quality-checks.yaml
Comment thread .github/workflows/_charm-quality-checks.yaml Outdated
lucabello and others added 7 commits April 30, 2026 12:32
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Luca Bello <36242061+lucabello@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Luca Bello <36242061+lucabello@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Luca Bello <36242061+lucabello@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Luca Bello <36242061+lucabello@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Luca Bello <36242061+lucabello@users.noreply.github.com>
- Security: pass inputs via env vars instead of direct interpolation
  in run scripts to prevent script injection
- Add log display and upload steps to sequential integration job
  (integration-mono) for consistent behavior across modes
- Add 'if: always()' to log steps so they run even on test failure
- Add 'shopt -s nullglob' to handle empty glob when no .txt files exist
- Connect displaylogs/uploadlogs nodes in Mermaid diagram

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

4 participants