Skip to content

Conversation

@vivus-ignis
Copy link
Contributor

@vivus-ignis vivus-ignis commented Oct 7, 2025

What this PR does / why we need it:
Splitting #179 into smaller parts

Which issue(s) this PR fixes:
gardenlinux/gardenlinux#3054

@codecov
Copy link

codecov bot commented Oct 8, 2025

Codecov Report

❌ Patch coverage is 88.42105% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.37%. Comparing base (1199aab) to head (6064d23).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...thub/release_notes/deployment_platform/__init__.py 71.62% 21 Missing ⚠️
src/gardenlinux/github/release_notes/sections.py 90.35% 11 Missing ⚠️
.../github/release_notes/deployment_platform/azure.py 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #217      +/-   ##
==========================================
+ Coverage   87.62%   92.37%   +4.74%     
==========================================
  Files          33       40       +7     
  Lines        1543     1822     +279     
==========================================
+ Hits         1352     1683     +331     
+ Misses        191      139      -52     

☔ 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.

@vivus-ignis vivus-ignis marked this pull request as ready for review October 8, 2025 12:17
@vivus-ignis vivus-ignis requested a review from Akendo October 8, 2025 12:18
@vivus-ignis vivus-ignis mentioned this pull request Oct 13, 2025
"""
Generate the table format with collapsible region details
"""
output = "| Variant | Platform | Architecture | Flavor | Regions & Image IDs | Download Links |\n"
Copy link

@Akendo Akendo Oct 13, 2025

Choose a reason for hiding this comment

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

Why not use a module for this? Could something like PrettyTable or pytable be a better solution?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be probably (maybe) easier to read, but I'm not sure if need to bring another dependency because of that.

@@ -0,0 +1,12 @@
from . import DeploymentPlatform


Copy link

Choose a reason for hiding this comment

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

Should this not be a dataclass?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could very well be.

"usi": "USI (Unified System Image)",
"tpm2_trustedboot": "TPM2 Trusted Boot",
}
PLATFORMS = {
Copy link

Choose a reason for hiding this comment

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

That's an interesting take. Maybe we should add some documentation about why we do this? Couldn't we create this not with enums instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dict is used here simply for grouping platform objects.

if variant not in grouped_data:
continue

for platform in sorted(grouped_data[variant].keys()):
Copy link

Choose a reason for hiding this comment

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

I think we could write more effective code here by using the itertools module instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, but suggest to do it as a separate improvement PR.

continue

output += (
f"<details>\n<summary>Variant - {IMAGE_IDS_VARIANT_NAMES[variant]}</summary>\n\n"
Copy link

Choose a reason for hiding this comment

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

With Python 3.14, they stabilized the template string. I feel like I might benefit from using it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's keep it in mind, but 3.14 is too fresh to demand it from the library users.

return "openstackbaremetal"

def full_name(self):
return "OpenStack Baremetal"
Copy link

Choose a reason for hiding this comment

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

Don't we miss the published_images_by_regions here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some platforms superclass' version is used.



def test_script_parse_args_wrong_command(monkeypatch, capfd):
monkeypatch.setattr(sys, "argv", ["gh", "rejoice"])
Copy link

Choose a reason for hiding this comment

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

Do we call this tool gh? That is confusing, and we have to change it; otherwise, it will collide with the gh cli tool.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this command name is used just for testing. The actual script name for releases creation has to be added to pyproject.toml's tool.poetry.scripts section.

@vivus-ignis vivus-ignis merged commit 5126dc7 into main Oct 14, 2025
9 of 11 checks passed
@vivus-ignis vivus-ignis deleted the release-notes-image-ids branch October 14, 2025 17:58
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.

3 participants