[PR #5316] [MERGED] [core]: unify misc/*.func scripts with centralized logic from core.func #5704

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

📋 Pull Request Information

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

Base: mainHead: core_changes


📝 Commits (5)

📊 Changes

7 files changed (+396 additions, -692 deletions)

View changed files

📝 misc/alpine-install.func (+11 -69)
📝 misc/api.func (+27 -24)
📝 misc/build.func (+73 -224)
📝 misc/config-file.func (+121 -122)
📝 misc/core.func (+23 -6)
📝 misc/create_lxc.sh (+111 -143)
📝 misc/install.func (+30 -104)

📄 Description

✍️ Description

This PR performs a structural refactor across several function libraries and the LXC creation script.
It consolidates message output, retry logic, and network checks into a shared core.func file.

🔧 Key changes:

  • Replaced local msg_info, msg_ok, msg_error, color, and retry blocks in:
    • alpine-install.func, build.func, api.func, install.func, config-file.func
  • core.func has been extended and acts now as the shared entry point for common functions.
  • create_lxc.sh has been migrated to rely on the new unified function logic (e.g., load_functions).
  • All logic is now cleaner, more DRY-compliant, and easier to maintain going forward.

These changes are compatible with both Debian and Alpine container environments.

Link: #

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/5316 **Author:** [@MickLesk](https://github.com/MickLesk) **Created:** 6/20/2025 **Status:** ✅ Merged **Merged:** 6/20/2025 **Merged by:** [@MickLesk](https://github.com/MickLesk) **Base:** `main` ← **Head:** `core_changes` --- ### 📝 Commits (5) - [`69e5159`](https://github.com/community-scripts/ProxmoxVE/commit/69e51590bb45e99879f2fd58592a28e5095ded43) Core Changes - [`52b6560`](https://github.com/community-scripts/ProxmoxVE/commit/52b656000b6ba1f69390cf47ae20efa24e6d06bf) Formatting - [`3d237cb`](https://github.com/community-scripts/ProxmoxVE/commit/3d237cbea7431c830cf2b37ae68630b745541c37) add create_lxc patches - [`d6fb577`](https://github.com/community-scripts/ProxmoxVE/commit/d6fb5778cc44df054ad12ba6ef1b7f3e5eb038e7) Update install.func - [`03a004c`](https://github.com/community-scripts/ProxmoxVE/commit/03a004cca64a32c9ed3cf181437ebf634519fc14) remove dev header ### 📊 Changes **7 files changed** (+396 additions, -692 deletions) <details> <summary>View changed files</summary> 📝 `misc/alpine-install.func` (+11 -69) 📝 `misc/api.func` (+27 -24) 📝 `misc/build.func` (+73 -224) 📝 `misc/config-file.func` (+121 -122) 📝 `misc/core.func` (+23 -6) 📝 `misc/create_lxc.sh` (+111 -143) 📝 `misc/install.func` (+30 -104) </details> ### 📄 Description ## ✍️ Description This PR performs a structural refactor across several function libraries and the LXC creation script. It consolidates message output, retry logic, and network checks into a shared `core.func` file. ### 🔧 Key changes: - Replaced local `msg_info`, `msg_ok`, `msg_error`, `color`, and retry blocks in: - `alpine-install.func`, `build.func`, `api.func`, `install.func`, `config-file.func` - `core.func` has been extended and acts now as the shared entry point for common functions. - `create_lxc.sh` has been migrated to rely on the new unified function logic (e.g., `load_functions`). - All logic is now cleaner, more DRY-compliant, and easier to maintain going forward. These changes are compatible with both Debian and Alpine container environments. ## 🔗 Related PR / Issue Link: # ## ✅ 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. - [ ] ✨ **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. - [x] 🔧 **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:07:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#5704