Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@igorpecovnik
Copy link
Member

@igorpecovnik igorpecovnik commented Sep 1, 2025

Description

Enable release upgrades from armbian-config

Issue reference: armbian/build#8569

Testing Procedure

  • Upgrade from Debian Bookworm to Trixie
  • Upgrade from Jammy, Noble, Plucky
  • Upgrade from Debian Bullseye to Trixie (problem is missing key)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have ensured that my changes do not introduce new warnings or errors
  • No new external dependencies are included
  • Changes have been tested and verified
  • I have included necessary metadata in the code, including associative arrays

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 1, 2025

Warning

Rate limit exceeded

@igorpecovnik has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 37 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7cf47fe and 9938143.

📒 Files selected for processing (1)
  • tools/modules/system/release_upgrade.sh (2 hunks)

Walkthrough

Renames two Update entries in tools/json/config.system.json: UPD005LTSREL and UPD006ROLREL, adds a public short field to both and changes their status from Disabled to Stable. Adds two markdown header files: tools/include/markdown/LTSREL-header.md and tools/include/markdown/ROLREL-header.md with descriptive guidance for each upgrade type. Adds pkg_fix() and its module metadata to tools/modules/functions/package.sh (runs apt-get -y --fix-broken install, using debconf-apt-progress when interactive). Updates tools/modules/system/release_upgrade.sh to exclude the current distribution from candidate lists, replace apt_* calls with pkg_*, insert pkg_fix calls between upgrade steps, run an additional full-upgrade pass, and also update armbian.list (including /etc/apt/sources.list.d/armbian.list) where present.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

size/medium

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rel-upg

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added size/small PR with less then 50 lines 11 Milestone: Fourth quarter release labels Sep 1, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (5)
tools/modules/functions/package.sh (2)

99-105: Registrations look good; align indentation for consistency.

Function metadata is correct and consistent with other pkg_* entries. Indentation mixes spaces vs tabs; match surrounding style.

-module_options+=(
-        ["pkg_fix,author"]="@igorpecovnik"
-        ["pkg_fix,desc"]="Fix dependency issues"
-        ["pkg_fix,example"]="pkg_fix"
-        ["pkg_fix,feature"]="pkg_fix"
-        ["pkg_fix,status"]="Interface"
-)
+module_options+=(
+	["pkg_fix,author"]="@igorpecovnik"
+	["pkg_fix,desc"]="Fix dependency issues"
+	["pkg_fix,example"]="pkg_fix"
+	["pkg_fix,feature"]="pkg_fix"
+	["pkg_fix,status"]="Interface"
+)

107-110: Consider making pkg_fix noninteractive and config-safe.

To mirror upgrade steps, avoid config prompts during fix-broken runs.

-pkg_fix()
-{
-        _pkg_have_stdin && debconf-apt-progress -- apt-get -y --fix-broken install "$@" || apt-get -y --fix-broken install "$@"
-}
+pkg_fix()
+{
+	# Keep existing configs; be noninteractive like other upgrade flows.
+	_pkg_have_stdin \
+		&& DEBIAN_FRONTEND=noninteractive debconf-apt-progress -- apt-get -y -o Dpkg::Options::="--force-confold" --fix-broken install "$@" \
+		|| DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confold" --fix-broken install "$@"
+}
tools/modules/system/release_upgrade.sh (3)

44-44: Good addition updating armbian.list; use word boundaries to avoid unintended replacements.

Prevents touching URLs or other tokens that partially match the codename.

-		[[ -f /etc/apt/sources.list.d/armbian.list ]] && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list.d/armbian.list
+		[[ -f /etc/apt/sources.list.d/armbian.list ]] && sed -ri "s/\b${distroid}\b/${upgrade}/g" /etc/apt/sources.list.d/armbian.list

Consider applying the same boundary-safe replacement to the other sed lines for consistency.


39-45: Back up source files before in-place sed edits.

Cheap safety net during release upgrades.

-		[[ -f /etc/apt/sources.list.d/ubuntu.sources ]] && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list.d/ubuntu.sources
+		[[ -f /etc/apt/sources.list.d/ubuntu.sources ]] && cp -n /etc/apt/sources.list.d/ubuntu.sources{,.bak} && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list.d/ubuntu.sources
-		[[ -f /etc/apt/sources.list.d/debian.sources ]] && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list.d/debian.sources
+		[[ -f /etc/apt/sources.list.d/debian.sources ]] && cp -n /etc/apt/sources.list.d/debian.sources{,.bak} && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list.d/debian.sources
-		[[ -f /etc/apt/sources.list ]] && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list
+		[[ -f /etc/apt/sources.list ]] && cp -n /etc/apt/sources.list{,.bak} && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list
@@
-		[[ -f /etc/apt/sources.list.d/armbian.sources ]] && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list.d/armbian.sources
+		[[ -f /etc/apt/sources.list.d/armbian.sources ]] && cp -n /etc/apt/sources.list.d/armbian.sources{,.bak} && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list.d/armbian.sources
-		[[ -f /etc/apt/sources.list.d/armbian.list ]] && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list.d/armbian.list
+		[[ -f /etc/apt/sources.list.d/armbian.list ]] && cp -n /etc/apt/sources.list.d/armbian.list{,.bak} && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list.d/armbian.list

51-51: Revisit autopurge after upgrades.

Autopurge can remove packages marked auto during the process (including kernels). Consider marking critical packages manual before this step or converting to a safer autoremove policy.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1e429c3 and bcb049d.

📒 Files selected for processing (3)
  • tools/json/config.system.json (1 hunks)
  • tools/modules/functions/package.sh (1 hunks)
  • tools/modules/system/release_upgrade.sh (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tools/json/config.system.json
🧰 Additional context used
🧬 Code graph analysis (1)
tools/modules/system/release_upgrade.sh (1)
tools/modules/functions/package.sh (4)
  • pkg_update (81-84)
  • pkg_upgrade (94-97)
  • pkg_fix (107-110)
  • pkg_full_upgrade (28-31)

@github-actions github-actions bot added the Documentation Documentation changes or additions label Sep 1, 2025
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@igorpecovnik igorpecovnik added the Needs review Seeking for review label Sep 1, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tools/include/markdown/LTSREL-header.md (1)

6-6: Remove stray trailing character.

There’s a lone “6” at EOF that will render as text. Delete it.

-6
🧹 Nitpick comments (1)
tools/include/markdown/LTSREL-header.md (1)

3-5: Use canonical admonition syntax and tighten the wording.

Lowercase the admonition type for MkDocs/Material compatibility and avoid implying upgrades are “safe.” Suggested edit also adds a concise title.

-!!! Note
-
-    While LTS upgrades are considered safe, always back up your data before proceeding with a distribution upgrade.
+!!! note "Backup recommended"
+    Even though LTS releases are generally stable, always back up your data before performing a distribution upgrade.

If this content is rendered outside MkDocs/Material, consider a fallback:

Note: Even though LTS releases are generally stable, always back up your data before performing a distribution upgrade.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bcb049d and 7cf47fe.

📒 Files selected for processing (5)
  • tools/include/markdown/LTSREL-header.md (1 hunks)
  • tools/include/markdown/ROLREL-header.md (1 hunks)
  • tools/json/config.system.json (1 hunks)
  • tools/modules/functions/package.sh (1 hunks)
  • tools/modules/system/release_upgrade.sh (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • tools/include/markdown/ROLREL-header.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • tools/modules/functions/package.sh
  • tools/json/config.system.json
  • tools/modules/system/release_upgrade.sh
🧰 Additional context used
🪛 LanguageTool
tools/include/markdown/LTSREL-header.md

[style] ~2-~2: Using many exclamation marks might seem excessive (in this case: 3 exclamation marks for a text that’s 350 characters long)
Context: ...rioritize stability over new features. !!! Note While LTS upgrades are consid...

(EN_EXCESSIVE_EXCLAMATION)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: samba install (bookworm)
  • GitHub Check: Stable repository (bookworm)
  • GitHub Check: Rolling repository (bookworm)
  • GitHub Check: Uptimekuma install (noble)
  • GitHub Check: Home Assistant install (bookworm)
  • GitHub Check: Duplicati install (noble)
  • GitHub Check: Cockpit install (noble)

@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines and removed size/small PR with less then 50 lines labels Sep 1, 2025
@igorpecovnik igorpecovnik changed the title Adjust release upgrade routines Fix and improve release upgrade routines Sep 1, 2025
@igorpecovnik igorpecovnik changed the title Fix and improve release upgrade routines Fix, improve and enable distribution upgrade routines Sep 1, 2025
@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Sep 1, 2025
@igorpecovnik igorpecovnik merged commit 5639be4 into main Sep 1, 2025
1 check passed
@igorpecovnik igorpecovnik deleted the rel-upg branch September 1, 2025 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

11 Milestone: Fourth quarter release Documentation Documentation changes or additions Ready to merge Reviewed, tested and ready for merge size/medium PR with more then 50 and less then 250 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants