Skip to content

add logformatter back and provide better github log output #29091

Open
Luap99 wants to merge 2 commits into
podman-container-tools:mainfrom
Luap99:logformatter
Open

add logformatter back and provide better github log output #29091
Luap99 wants to merge 2 commits into
podman-container-tools:mainfrom
Luap99:logformatter

Conversation

@Luap99

@Luap99 Luap99 commented Jun 30, 2026

Copy link
Copy Markdown
Member

Adapt the logformatter script to run again to produce nicely formatted
html logs. Because github cannot upload and show raw html files we can
only add it to the log archive which must be downloaded and viewed
locally.

To improve the online experience however github does have the
GITHUB_STEP_SUMMARY logic which allows us to produce markdown which will
be shown on the summary page for a given test run.

The problem is even though github markdown supports some html is does
not support CSS and out custom style of the logformatter, in addition
the output size is limited so I wrote another script parsing the html
output again and turning it into plain test for only the failed tests
and then show this as plain text inside codeblocks in the markdown.

With this we have a short failure summary which should display all
failures at once in the run page so maintainers can see if the failed
log was just some flake or an actual problem with the PR.

Does this PR introduce a user-facing change?

None

@github-actions github-actions Bot added the CI label Jun 30, 2026
@Luap99
Luap99 force-pushed the logformatter branch 8 times, most recently from 715d387 to 1297d16 Compare July 2, 2026 16:29
Adapt the logformatter script to run again to produce nicely formatted
html logs. Because github cannot upload and show raw html files we can
only add it to the log archive which must be downloaded and viewed
locally.

To improve the online experience however github does have the
GITHUB_STEP_SUMMARY logic which allows us to produce markdown which will
be shown on the summary page for a given test run.

The problem is even though github markdown supports some html is does
not support CSS and out custom style of the logformatter, in addition
the output size is limited so I wrote another script parsing the html
output again and turning it into plain test for only the failed tests
and then show this as plain text inside codeblocks in the markdown.

With this we have a short failure summary which should display all
failures at once in the run page so maintainers can see if the failed
log was just some flake or an actual problem with the PR.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This groups log output in the github UI and makes it easier to just show
the actual test results, the groups are hidden under an extra drop down
and only shown when selected.

Inspired by Miloslav container-libs change for this.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@Luap99
Luap99 marked this pull request as ready for review July 2, 2026 17:33
@packit-as-a-service

Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

Comment thread hack/ci/runner.sh
$SUDO sh -c "source .venv/docker-py/bin/activate && make run-docker-py-tests" |& logformatter
}

function run_unit() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we skipping run_unit, and run_machine deliberately?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the logformmater cannot handle the default unit test output and we never used it there so yes

run_machine as of now is completely unused here

Comment thread hack/ci/runner.sh
"$SCRIPT_DIR/logcollector.sh" ip
echo "::endgroup::" # Test Setup

mkdir -p "$SCRIPT_DIR/logs"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

isn't this already created before?

Suggested change
mkdir -p "$SCRIPT_DIR/logs"

Comment thread hack/ci/runner.sh
echo "::group::Logging system info"
"$SCRIPT_DIR/logcollector.sh" packages
"$SCRIPT_DIR/logcollector.sh" ip
echo "::endgroup::" # Test Setup

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
echo "::endgroup::" # Test Setup
echo "::endgroup::" # Logging system info

Comment thread hack/ci/runner.sh
Comment on lines +180 to +181
$SUDO make localapiv2-bash |& logformatter
$SUDO sh -c "source .venv/requests/bin/activate && make localapiv2-python" |& logformatter

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I could be wrong but looking at logformatter's definition, wouldn't formatted logs from make localapiv2-python replace the logs (on disk file by the same name) generated by make localapiv2-bash?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ah good point I have to check how it was with cirrus, I guess we need to pipe both output into one logformatter run.

@Luap99

Luap99 commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

oh and just to be clear this is blocked on #29186 (which itself is blocked on external things) as I need new images with the proper gnu awk in debian, so until that all is sorted out I will not make progress here

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants