Skip to content

[release_files] Add zypper support into the install.sh for OpenSUSE.#6413

Open
PizzaLovingNerd wants to merge 2 commits into
netbirdio:mainfrom
PizzaLovingNerd:opensuse
Open

[release_files] Add zypper support into the install.sh for OpenSUSE.#6413
PizzaLovingNerd wants to merge 2 commits into
netbirdio:mainfrom
PizzaLovingNerd:opensuse

Conversation

@PizzaLovingNerd

@PizzaLovingNerd PizzaLovingNerd commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Describe your changes

Added Zypper to the installer that uses the existing RPMs which work well on OpenSUSE.

Issue ticket number and link

Fixes #4683 on OpenSUSE,

Stack

Checklist

  • [] Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • This change does not modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — OR I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See CONTRIBUTING.md.

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
    Not added yet, but I will also be adding docs for manual installation on OpenSUSE.

Docs PR URL (required if "docs added" is checked)

netbirdio/docs#793

Summary by CodeRabbit

  • New Features
    • Adds native installation support for systems using the zypper package manager, with automatic OS/package-manager detection and repository setup including GPG key import.
    • Zypper installs now run non-interactively and can optionally include the UI application based on an environment-variable toggle.

Copilot AI review requested due to automatic review settings June 11, 2026 22:22
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds native zypper support to the NetBird installer: detects zypper, introduces add_zypper_repo() to configure the repository and GPG key, and adds a zypper branch to install netbird and optionally netbird-ui.

Changes

Zypper package manager support

Layer / File(s) Summary
Add zypper detection, repo configuration, and installation
release_files/install.sh
Detects zypper ahead of dnf/yum, adds add_zypper_repo() to import the repo GPG key and configure the NetBird repo, and extends install_netbird with a zypper branch that non-interactively installs netbird and conditionally netbird-ui.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • netbirdio/netbird#6139: Modifies release_files/install.sh package-manager detection and related install-time decision logic.

Suggested reviewers

  • jnfrati

Poem

🐰 I hopped into the install script today,
Found zypper waiting in the OpenSUSE way,
I added a key, and a repo so neat,
Now NetBird installs clean—no lone binary feat.
Hooray for packages, tidy and fleet!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding zypper support to install.sh for OpenSUSE.
Linked Issues check ✅ Passed The changes meet the primary coding requirement from #4683: detecting zypper and using the package manager to install NetBird via RPM packages instead of just downloading binaries.
Out of Scope Changes check ✅ Passed All changes are directly scoped to adding zypper support and are aligned with the objectives of fixing #4683 for OpenSUSE systems.
Description check ✅ Passed The PR description covers the key aspects: changes (Zypper support for OpenSUSE), issue reference (#4683), feature classification, and documentation status with a docs PR link.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for installing NetBird via zypper (openSUSE/SLES-style distros) by wiring in repo setup, package installation, and package-manager detection.

Changes:

  • Introduce add_zypper_repo to import the GPG key, add the NetBird repo, and refresh metadata.
  • Add a zypper branch in install_netbird() to install netbird and optionally netbird-ui.
  • Extend package-manager detection to select zypper when available.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread release_files/install.sh Outdated
Comment thread release_files/install.sh
Comment on lines +256 to +259
${SUDO} zypper --non-interactive install netbird

if ! $SKIP_UI_APP; then
${SUDO} zypper --non-interactive install netbird-ui
Comment thread release_files/install.sh
Comment on lines +137 to +142
add_zypper_repo() {
${SUDO} rpm --import https://pkgs.netbird.io/yum/repodata/repomd.xml.key
${SUDO} zypper --non-interactive removerepo netbird >/dev/null 2>&1 || true
${SUDO} zypper --non-interactive addrepo -f -g https://pkgs.netbird.io/yum/ netbird
${SUDO} zypper --gpg-auto-import-keys refresh netbird
}

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
release_files/install.sh (1)

456-458: Consider adding OpenSUSE to the CI test matrix.

The zypper installation path will not be exercised by the current CI workflow, which only tests on ubuntu-latest and macos-latest. Consider adding an OpenSUSE runner (e.g., using a container or VM) to the test matrix in .github/workflows/install-script-test.yml to validate the zypper installation flow in CI.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@release_files/install.sh` around lines 456 - 458, The CI doesn't exercise the
zypper branch (PACKAGE_MANAGER set to "zypper") so add an OpenSUSE job to
.github/workflows/install-script-test.yml to run the install.sh path that
detects zypper; update the matrix or add a separate job that uses an OpenSUSE
VM/container (or docker image like opensuse/leap) and runs the same install
script to validate the zypper branch, ensuring the job runs the script
end-to-end and fails on errors so the zypper installation flow is covered by CI.

Source: MCP tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@release_files/install.sh`:
- Around line 137-142: The add_zypper_repo() has redundant/possibly incorrect
key handling and a suspicious -g flag; either import the GPG key once via rpm
and remove zypper's auto-import steps, or rely on zypper to auto-import and drop
the separate rpm --import. Concretely: in add_zypper_repo(), choose one flow—(A)
keep ${SUDO} rpm --import https://pkgs.netbird.io/yum/repodata/repomd.xml.key,
remove the zypper --gpg-auto-import-keys line, and call ${SUDO} zypper
--non-interactive addrepo -f https://pkgs.netbird.io/yum/ netbird (drop the -g
flag); or (B) remove the rpm --import line, add the repo with ${SUDO} zypper
--non-interactive --gpg-auto-import-keys addrepo -f https://pkgs.netbird.io/yum/
netbird and then ${SUDO} zypper --non-interactive refresh netbird; update the
add_zypper_repo function accordingly so only one key-import path is used and the
-g flag is not present in the addrepo call.

---

Nitpick comments:
In `@release_files/install.sh`:
- Around line 456-458: The CI doesn't exercise the zypper branch
(PACKAGE_MANAGER set to "zypper") so add an OpenSUSE job to
.github/workflows/install-script-test.yml to run the install.sh path that
detects zypper; update the matrix or add a separate job that uses an OpenSUSE
VM/container (or docker image like opensuse/leap) and runs the same install
script to validate the zypper branch, ensuring the job runs the script
end-to-end and fails on errors so the zypper installation flow is covered by CI.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a348ab79-a274-4f3b-b2b2-760ee0787632

📥 Commits

Reviewing files that changed from the base of the PR and between d770376 and 2eba544.

📒 Files selected for processing (1)
  • release_files/install.sh

Comment thread release_files/install.sh
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 30.29%. Comparing base (d770376) to head (628698d).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6413      +/-   ##
==========================================
+ Coverage   30.27%   30.29%   +0.02%     
==========================================
  Files         905      911       +6     
  Lines      112288   112902     +614     
==========================================
+ Hits        33994    34208     +214     
- Misses      73786    74165     +379     
- Partials     4508     4529      +21     
Flag Coverage Δ
client 29.33% <ø> (+0.19%) ⬆️
integration ?
management 29.57% <ø> (-0.13%) ⬇️
proxy 41.39% <ø> (-0.07%) ⬇️
relay 35.91% <ø> (-0.31%) ⬇️
signal 16.56% <ø> (-0.19%) ⬇️
unit 30.29% <ø> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PizzaLovingNerd PizzaLovingNerd changed the title Add zypper support into the install.sh for OpenSUSE. [release_files] Add zypper support into the install.sh for OpenSUSE. Jun 13, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

Install.sh just pulls binary on some distros

2 participants