Skip to content

Restructure and clean up GitHub release notes generator#345

Open
NotTheEvilOne wants to merge 1 commit into
mainfrom
feature/github-release-notes-generator
Open

Restructure and clean up GitHub release notes generator#345
NotTheEvilOne wants to merge 1 commit into
mainfrom
feature/github-release-notes-generator

Conversation

@NotTheEvilOne
Copy link
Copy Markdown
Contributor

@NotTheEvilOne NotTheEvilOne commented May 13, 2026

What this PR does / why we need it:
This PR restructures and cleans up gardenlinux.github.release.

Which issue(s) this PR fixes:
Closes #189

Special notes for your reviewer:
Requires #335
Supersedes #332

@NotTheEvilOne NotTheEvilOne force-pushed the feature/github-release-notes-generator branch 2 times, most recently from 2cfd413 to 9bcb6ad Compare May 13, 2026 09:43
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 93.39853% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.77%. Comparing base (35741dd) to head (a7de0f0).

Files with missing lines Patch % Lines
...enlinux/github/release/notes/markdown_generator.py 92.59% 10 Missing ⚠️
...denlinux/github/release/release_images_metadata.py 92.56% 9 Missing ⚠️
.../gardenlinux/github/release/deployment_platform.py 92.07% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #345      +/-   ##
==========================================
+ Coverage   91.29%   91.77%   +0.47%     
==========================================
  Files          51       46       -5     
  Lines        2954     2870      -84     
==========================================
- Hits         2697     2634      -63     
+ Misses        257      236      -21     

☔ 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 force-pushed the feature/github-release-notes-generator branch 4 times, most recently from 3622c39 to 3802291 Compare May 16, 2026 08:43
@NotTheEvilOne NotTheEvilOne self-assigned this May 16, 2026
@NotTheEvilOne NotTheEvilOne added the enhancement New feature or request label May 16, 2026
@NotTheEvilOne NotTheEvilOne requested a review from a team May 16, 2026 08:47
@NotTheEvilOne NotTheEvilOne marked this pull request as ready for review May 16, 2026 08:48
@NotTheEvilOne NotTheEvilOne force-pushed the feature/github-release-notes-generator branch 4 times, most recently from 1598f88 to 45e6fb4 Compare May 18, 2026 15:13
@yeoldegrove yeoldegrove self-requested a review May 19, 2026 07:17
@NotTheEvilOne NotTheEvilOne force-pushed the feature/github-release-notes-generator branch from 45e6fb4 to 0507dad Compare May 19, 2026 07:18
Copy link
Copy Markdown
Contributor

@yeoldegrove yeoldegrove left a comment

Choose a reason for hiding this comment

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

make test does not work for me.

========================================================================================================================================================================================== ERRORS ==========================================================================================================================================================================================
______________________________________________________________________________________________________________________________________________________________________ ERROR collecting tests/github/test_release.py _______________________________________________________________________________________________________________________________________________________________________
ImportError while importing test module '/.../python-gardenlinux-lib/tests/github/test_release.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/apzyghrw3m6iw69y7prw6jp2kbmsb8z2-python3-3.13.12-env/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/github/test_release.py:7: in <module>
    from ..constants import (
E   ImportError: cannot import name 'TEST_GARDENLINUX_RELEASE' from 'tests.constants' (/home/yeoldegrove/kunden/SAP/gardenlinux/python-gardenlinux-lib/tests/constants.py)
================================================================================================================================================================================= short test summary info ==================================================================================================================================================================================
ERROR tests/github/test_release.py

Also a dry-run is not working for me.

❯ gl-gh-release create-with-gl-release-notes --dry-run --owner gardenlinux --repo gardenlinux --tag 2150.3.0 --commit ddf3b2d84d972b6b6c7195d2ab726cdb84806e3a
Dry Run ...
This release would be created:
Traceback (most recent call last):
  File ".../python-gardenlinux-lib/.venv/bin/gl-gh-release", line 6, in <module>
    sys.exit(main())
             ~~~~^^
  File ".../python-gardenlinux-lib/src/gardenlinux/github/release/__main__.py", line 179, in main
    print(str(generator))
          ~~~^^^^^^^^^^^
  File ".../python-gardenlinux-lib/src/gardenlinux/github/release/notes/markdown_generator.py", line 222, in __str__
    published_images_table=self.release_images_table,
                           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../python-gardenlinux-lib/src/gardenlinux/github/release/notes/markdown_generator.py", line 137, in release_images_table
    grouped_data = self._release_images_metadata.grouped_flavors_metadata
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../python-gardenlinux-lib/src/gardenlinux/github/release/release_images_metadata.py", line 141, in grouped_flavors_metadata
    flavors = self.flavors_parser.filter(only_publish=True)
              ^^^^^^^^^^^^^^^^^^^
  File ".../python-gardenlinux-lib/src/gardenlinux/github/release/release_images_metadata.py", line 116, in flavors_parser
    repo = Repository.checkout_repo_sparse(
        tmpdir, ["flavors.yaml"], commit=self._commitish
    )
  File ".../python-gardenlinux-lib/src/gardenlinux/git/repository.py", line 171, in checkout_repo_sparse
    return Repository.checkout_repo(
           ~~~~~~~~~~~~~~~~~~~~~~~~^
        git_directory,
        ^^^^^^^^^^^^^^
    ...<4 lines>...
        logger=logger,
        ^^^^^^^^^^^^^^
    )
    ^
  File ".../python-gardenlinux-lib/src/gardenlinux/git/repository.py", line 138, in checkout_repo
    repo.remotes["origin"].fetch()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File ".../python-gardenlinux-lib/.venv/lib/python3.13/site-packages/pygit2/remotes.py", line 245, in fetch
    payload.check_error(err)
    ~~~~~~~~~~~~~~~~~~~^^^^^
  File ".../python-gardenlinux-lib/.venv/lib/python3.13/site-packages/pygit2/callbacks.py", line 111, in check_error
    check_error(error_code)
    ~~~~~~~~~~~^^^^^^^^^^^^
  File ".../python-gardenlinux-lib/.venv/lib/python3.13/site-packages/pygit2/errors.py", line 67, in check_error
    raise GitError(message)
_pygit2.GitError: authentication required but no callback set

@NotTheEvilOne NotTheEvilOne force-pushed the feature/github-release-notes-generator branch from 0507dad to a361120 Compare May 19, 2026 07:22
@NotTheEvilOne
Copy link
Copy Markdown
Contributor Author

NotTheEvilOne commented May 19, 2026

make test does not work for me.

========================================================================================================================================================================================== ERRORS ==========================================================================================================================================================================================
______________________________________________________________________________________________________________________________________________________________________ ERROR collecting tests/github/test_release.py _______________________________________________________________________________________________________________________________________________________________________
ImportError while importing test module '/.../python-gardenlinux-lib/tests/github/test_release.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/apzyghrw3m6iw69y7prw6jp2kbmsb8z2-python3-3.13.12-env/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/github/test_release.py:7: in <module>
    from ..constants import (
E   ImportError: cannot import name 'TEST_GARDENLINUX_RELEASE' from 'tests.constants' (/.../python-gardenlinux-lib/tests/constants.py)
================================================================================================================================================================================= short test summary info ==================================================================================================================================================================================
ERROR tests/github/test_release.py

Merge conflict. Just fixed. Tests and linting should be successful again.

@NotTheEvilOne NotTheEvilOne force-pushed the feature/github-release-notes-generator branch from a361120 to 5553383 Compare May 19, 2026 07:23
@yeoldegrove
Copy link
Copy Markdown
Contributor

@

make test does not work for me.

========================================================================================================================================================================================== ERRORS ==========================================================================================================================================================================================
______________________________________________________________________________________________________________________________________________________________________ ERROR collecting tests/github/test_release.py _______________________________________________________________________________________________________________________________________________________________________
ImportError while importing test module '/.../python-gardenlinux-lib/tests/github/test_release.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/apzyghrw3m6iw69y7prw6jp2kbmsb8z2-python3-3.13.12-env/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/github/test_release.py:7: in <module>
    from ..constants import (
E   ImportError: cannot import name 'TEST_GARDENLINUX_RELEASE' from 'tests.constants' (/.../python-gardenlinux-lib/tests/constants.py)
================================================================================================================================================================================= short test summary info ==================================================================================================================================================================================
ERROR tests/github/test_release.py

Merge conflict. Just fixed. Tests and linting should be successful again.

Now I get:

E       _pygit2.GitError: authentication required but no callback set

GITHUB_TOKEN env variable is set.

@NotTheEvilOne
Copy link
Copy Markdown
Contributor Author

NotTheEvilOne commented May 19, 2026

Now I get:

E       _pygit2.GitError: authentication required but no callback set

GITHUB_TOKEN env variable is set.

Interesting. Trying to reproduce :)

Edit: I've been unable to reproduce it including GITHUB_TOKEN="invalid" (and it's still working ;))

@NotTheEvilOne NotTheEvilOne force-pushed the feature/github-release-notes-generator branch 2 times, most recently from 79bb785 to 44695fd Compare May 19, 2026 07:47
@NotTheEvilOne
Copy link
Copy Markdown
Contributor Author

@yeoldegrove While I think you might run an unclean checkout I just updated poetry.lock to the latest compatible versions. Could you please give it another try (including poetry update for the sake of updating)?

Signed-off-by: Tobias Wolf <wolf@b1-systems.de>
On-behalf-of: SAP <tobias.wolf@sap.com>
@NotTheEvilOne NotTheEvilOne force-pushed the feature/github-release-notes-generator branch from 44695fd to a7de0f0 Compare May 19, 2026 07:49
@yeoldegrove
Copy link
Copy Markdown
Contributor

@NotTheEvilOne I have the following in my ~/.config/git/config which is "pretty common" I guess.

[url "ssh://git@github.com/"]
    insteadOf = "https://github.com/"

This is picked up by pygit2 and publickey authentication is tried which fails internally.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor new code for GitHub releases

2 participants