Skip to content

feat: Move test formatter from .github/workflows/format_diff.py to python-gardenlinux-lib#294

Merged
Leon-hk merged 25 commits intomainfrom
feat/port-difference-formatter
Feb 26, 2026
Merged

feat: Move test formatter from .github/workflows/format_diff.py to python-gardenlinux-lib#294
Leon-hk merged 25 commits intomainfrom
feat/port-difference-formatter

Conversation

@Leon-hk
Copy link
Contributor

@Leon-hk Leon-hk commented Jan 7, 2026

What this PR does / why we need it:

  • For the still unmerged reproducibility checker, I've written a format_diff.py script which generates a readme report for the workflow run
  • This script manually parsed the flavors directory and created feature trees. But this can also be way easier and more reliable done using the python-gardenlinux-lib
  • This PR ports the readme generator to the python-gardenlinux-lib in order to clean up the workflows directory, to use features of the library and to be able to test the output with simple unit tests

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 95.37954% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.41%. Comparing base (a776256) to head (7b89b74).
⚠️ Report is 31 commits behind head on main.

Files with missing lines Patch % Lines
...gardenlinux/features/reproducibility/comparator.py 89.39% 7 Missing ⚠️
...c/gardenlinux/features/reproducibility/__main__.py 89.58% 5 Missing ⚠️
...ardenlinux/features/reproducibility/diff_parser.py 98.68% 1 Missing ⚠️
...nux/features/reproducibility/markdown_formatter.py 99.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #294      +/-   ##
==========================================
- Coverage   91.51%   91.41%   -0.11%     
==========================================
  Files          42       49       +7     
  Lines        2158     2585     +427     
==========================================
+ Hits         1975     2363     +388     
- Misses        183      222      +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@NotTheEvilOne NotTheEvilOne self-requested a review January 17, 2026 09:48
@Leon-hk
Copy link
Contributor Author

Leon-hk commented Jan 29, 2026

Thanks for your detailed feedback. I have heavily restricted the formatter and implemented all your comments. It's still a massive PR, as it also contains the difference generator now. So take your time!

I was not able to find a python package or better way to unpack .oci containers, so I've implemented unpacking logic myself. It works so far.

Copy link
Contributor

@NotTheEvilOne NotTheEvilOne left a comment

Choose a reason for hiding this comment

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

In general this is a nice feature. I'm not sure if gl-diff is the most suitable command line tool name for it. As you compare OCI images or tar files based on features you may want to name it something similar to gl-feature-fs-diff?

@Leon-hk
Copy link
Contributor Author

Leon-hk commented Feb 25, 2026

Thanks for your valuable feedback, I tried to clean things up as much as possible

Copy link
Contributor

@NotTheEvilOne NotTheEvilOne left a comment

Choose a reason for hiding this comment

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

One note left, otherwise looks good. Great work.

nightly_a, nightly_b = (
Nightly(*n.split(",")) for n in f.read().rstrip().split("\n")
)
if nightly_a.run_number != "":
Copy link
Contributor

Choose a reason for hiding this comment

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

Here you can also use a template for at least part of the generated content.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've extended the template scope to also include the run number

@Leon-hk Leon-hk merged commit d417011 into main Feb 26, 2026
10 of 11 checks passed
@Leon-hk Leon-hk deleted the feat/port-difference-formatter branch February 26, 2026 07:10
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.

2 participants