Skip to content

feat: add Stackit-cli support for different package managers (zypper, dnf) #909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

Benjosh95
Copy link
Contributor

@Benjosh95 Benjosh95 commented Aug 7, 2025

JIRA-Ticket: https://jira.schwarz/secure/RapidBoard.jspa?rapidView=41274&view=detail&selectedIssue=STACKITCLI-213#

What Was Implemented:

Overview of the workflow (isolated and stripped down for testing):

rpm-test.yml (worfklow starts when pushed on this branch) => release-rpm.sh (setup gpg & calls goreleaser) => goreleaser.rpm.yml (builds & signs the rpm packages) => rpm-test.yml (worfklow continues) => publish-rpm-repo.sh (creates a rpm repo and rpm metadata for the already created rpm packages & signs rpm metadata & publishes to distribution-test bucket for now)

Testing-Instructions for supported distributions (having RPM Version +4.15 for ed25519 signature of gpg Key)

Fedora 35+ => ./scripts/test-fedora.sh [ ]
RHEL 9+ => ./scripts/test-rhel9.sh [ ]
AlmaLinux 9+ => ./scripts/test-almalinux9.sh [ ]
Rocky Linux 9+ => ./scripts/test-rocky9.sh [ ]
OpenSUSE Tumbleweed => ./scripts/test-opensuse.sh [ ]


Next ToDos after changes were reviewed:

  • combine and cleanup some of the logic [ ]
  • transfer testing workflow logic (rpm-test.yml) into prod release worfklow (release.yml) and remove it afterwards. [ ]
  • transfer testing goreleaser logic into prod goreleaser script and remove it afterwards. [ ]

Cleanup and clarify:

  • renamed nfpms id from linux-packages to linux_packages, does it cause any problems? [ ]
  • remove test secrets from github [ ]
  • does the pm-badge need an update? [ ]
  • Where to finally put the testing scripts? [ ]

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

cache: true

- name: Install GoReleaser
run: go install github.com/goreleaser/goreleaser/v2@latest
Copy link
Member

Choose a reason for hiding this comment

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

Please use https://github.com/goreleaser/goreleaser-action like we do in the release workflow

Copy link
Contributor

@Fyusel Fyusel left a comment

Choose a reason for hiding this comment

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

Very nice with those testing scripts (I am still reviewing and need to test 😇).
Can you rebase your commits a little bit (remove some of them e.g. via git rebase -i).?

# aptly version 1.6.0 results in an segmentation fault. Therefore we fall back to version 1.5.0.
# Since it is not possible to specify a version via brew command a formula was added for aptly 1.5.0
# (source: https://github.com/Homebrew/homebrew-core/pull/202415/files)
- name: Install Aptly version 1.5.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you are installing this on ubuntu it seems to be that this is not version 1.5.0 anymore. Does this work on ubuntu so was the mentioned isse with aptly version 1.6.0 only an issue on mac?
If so, then the added brew formula can be removed and of course this note as well.

- name: Publish packages to APT repo
if: contains(github.ref_name, '-') == false
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this removed?

@@ -0,0 +1,42 @@
version: 2
Copy link
Contributor

Choose a reason for hiding this comment

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

For my understanding: This will be added/merged later to the .goreleaser.yaml, right?

docker exec $CONTAINER_NAME bash -c "
if command -v stackit >/dev/null 2>&1; then
echo '✅ stackit command found: \$(which stackit)'
echo '✅ Version: \$(stackit version)'
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not work on my side. I get the plain output of "which stackit".

Suggested change
echo '✅ Version: \$(stackit version)'
echo "✅ stackit command found: $(which stackit)"

If changing to this I get the error: "stackit command not found"

docker exec $CONTAINER_NAME bash -c "
if command -v stackit >/dev/null 2>&1; then
echo '✅ stackit command found: \$(which stackit)'
echo '✅ Version: \$(stackit version)'
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

@@ -0,0 +1,117 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to keep those test files:
Most of the content from almalinux fedora, rhel9 and rocky9 are the same. Is there a possibility to use one generic script for them?
Same maybe for the two opensuse scripts.

if ! command -v stackit >/dev/null 2>&1; then
echo '✅ stackit command no longer found'
else
echo '❌ stackit command still found: \$(which stackit)'
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't get there in my test but here would be the same issue

docker exec $CONTAINER_NAME bash -c "
zypper clean --all
zypper refresh
zypper repos
Copy link
Contributor

Choose a reason for hiding this comment

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

I am getting an error here. It seems to be that the Repository of the Stackit CLI is present but could not be refreshed. However the installation step works. Have you seen this on your side as well?

Repository 'STACKIT CLI Repository' is invalid.
[stackit-cli|https://distribution-test.object.storage.eu01.onstackit.cloud/rpm/cli] Failed to retrieve new repository metadata.
History:
 - Signature verification failed for repomd.xml
Please check if the URIs defined for this repository are pointing to a valid repository.
Skipping repository 'STACKIT CLI Repository' because of the above error.
Some of the repositories have not been refreshed because of an error.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same message for the other opensuse script (The output above is with "--non-interactive" for zypper, just tested this as well. So the message without this is slightly different.

Copy link

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

@github-actions github-actions bot added the Stale label Aug 20, 2025
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.

3 participants