[PR #5241] [MERGED] tools.func: Standardized and Renamed Setup Functions #5638

Closed
opened 2025-11-20 07:06:55 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/5241
Author: @MickLesk
Created: 6/18/2025
Status: Merged
Merged: 6/18/2025
Merged by: @MickLesk

Base: mainHead: upgrade_tools.func


📝 Commits (3)

📊 Changes

1 file changed (+449 additions, -276 deletions)

View changed files

📝 misc/tools.func (+449 -276)

📄 Description

✍️ Description

  • Renamed all install_* functions to setup_* for consistent naming across the codebase.
  • Unified function structure, including:
    • Clean local variable initialization
    • Consistent use of msg_info, msg_ok, msg_error
    • Reduced verbosity for spinner output (STD only on informative steps)

📦 Updated Setup Functions

Old Function New Function Notes
install_node_and_modules setup_nodejs Defaults to Node.js 22, simplifies module handling
install_postgresql setup_postgresql Improved version detection and pgdg repo handling
install_mariadb setup_mariadb Supports latest, purges legacy packages
install_mysql setup_mysql Handles upgrades and full install scenarios
install_php setup_php Clean module install logic, optional Apache/FPM flags
install_composer setup_composer Updated detection and fallback
install_go setup_go Adds arch detection, fallback to GitHub tarball
install_java setup_java Uses Temurin packages, supports upgrades
install_mongodb setup_mongodb Uses MongoDB GPG/apt source, detects version
install_rust_and_crates setup_rust Supports RUST_CRATES and version validation
setup_rbenv_stack setup_ruby Installs rbenv, ruby-build, and optional Rails
(new) setup_yq Installs mikefarah/yq via GitHub release

🚀 New & Improved Logic

  • fetch_and_deploy_gh_release now supports:
    • mode=tarball, binary, prebuild, singlefile
    • Asset pattern matching via $6
    • Version tracking via ~/.<app>
    • Better fallback logic for architecture and tarball handling
  • Enhanced support for:
    • uv based Python installs via PYTHON_VERSION
    • Graceful upgrades with detection for all stack components

🧠 Additional Improvements

  • Added inline documentation blocks above each function
  • Improved compatibility with Alpine and Debian-based systems
  • Reduced redundant command output, especially around apt, curl, and tar

All changes follow the established logging and UX style (msg_info, msg_ok, msg_error) used throughout the community-scripts project.

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/5241 **Author:** [@MickLesk](https://github.com/MickLesk) **Created:** 6/18/2025 **Status:** ✅ Merged **Merged:** 6/18/2025 **Merged by:** [@MickLesk](https://github.com/MickLesk) **Base:** `main` ← **Head:** `upgrade_tools.func` --- ### 📝 Commits (3) - [`355aff4`](https://github.com/community-scripts/ProxmoxVE/commit/355aff48828b27a03317dfe82f4a6bbf80da6693) Upgrade Tools.func - [`cc48fe8`](https://github.com/community-scripts/ProxmoxVE/commit/cc48fe84f1ae55a0038531d08a53c98652602306) Update tools.func - [`d411b62`](https://github.com/community-scripts/ProxmoxVE/commit/d411b627da5f694cf489ca2ec2cadf09db09c273) Update tools.func ### 📊 Changes **1 file changed** (+449 additions, -276 deletions) <details> <summary>View changed files</summary> 📝 `misc/tools.func` (+449 -276) </details> ### 📄 Description ## ✍️ Description - **Renamed all `install_*` functions to `setup_*`** for consistent naming across the codebase. - **Unified function structure**, including: - Clean local variable initialization - Consistent use of `msg_info`, `msg_ok`, `msg_error` - Reduced verbosity for spinner output (`STD` only on informative steps) ## 📦 Updated Setup Functions | Old Function | New Function | Notes | |----------------------|---------------------|-------| | `install_node_and_modules` | `setup_nodejs` | Defaults to Node.js 22, simplifies module handling | | `install_postgresql` | `setup_postgresql` | Improved version detection and pgdg repo handling | | `install_mariadb` | `setup_mariadb` | Supports `latest`, purges legacy packages | | `install_mysql` | `setup_mysql` | Handles upgrades and full install scenarios | | `install_php` | `setup_php` | Clean module install logic, optional Apache/FPM flags | | `install_composer` | `setup_composer` | Updated detection and fallback | | `install_go` | `setup_go` | Adds arch detection, fallback to GitHub tarball | | `install_java` | `setup_java` | Uses Temurin packages, supports upgrades | | `install_mongodb` | `setup_mongodb` | Uses MongoDB GPG/apt source, detects version | | `install_rust_and_crates` | `setup_rust` | Supports `RUST_CRATES` and version validation | | `setup_rbenv_stack` | `setup_ruby` | Installs rbenv, ruby-build, and optional Rails | | *(new)* | `setup_yq` | Installs mikefarah/yq via GitHub release | ## 🚀 New & Improved Logic - `fetch_and_deploy_gh_release` now supports: - `mode=tarball`, `binary`, `prebuild`, `singlefile` - Asset pattern matching via `$6` - Version tracking via `~/.<app>` - Better fallback logic for architecture and tarball handling - Enhanced support for: - `uv` based Python installs via `PYTHON_VERSION` - Graceful upgrades with detection for all stack components ## 🧠 Additional Improvements - Added inline documentation blocks above each function - Improved compatibility with Alpine and Debian-based systems - Reduced redundant command output, especially around `apt`, `curl`, and `tar` --- All changes follow the established logging and UX style (`msg_info`, `msg_ok`, `msg_error`) used throughout the community-scripts project. ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [ ] 🐞 **Bug fix** – Resolves an issue without breaking functionality. - [x] ✨ **New feature** – Adds new, non-breaking functionality. - [ ] 💥 **Breaking change** – Alters existing functionality in a way that may require updates. - [ ] 🆕 **New script** – A fully functional and tested script or script set. - [ ] 🌍 **Website update** – Changes to website-related JSON files or metadata. - [ ] 🔧 **Refactoring / Code Cleanup** – Improves readability or maintainability without changing functionality. - [ ] 📝 **Documentation update** – Changes to `README`, `AppName.md`, `CONTRIBUTING.md`, or other docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 07:06:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#5638