Skip to content

Rollback OS auto-selection; provision exact selected XML/service#147

Merged
iaretechnician merged 1 commit intoPanel-unstablefrom
copilot/rollback-os-auto-selection
May 9, 2026
Merged

Rollback OS auto-selection; provision exact selected XML/service#147
iaretechnician merged 1 commit intoPanel-unstablefrom
copilot/rollback-os-auto-selection

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 9, 2026

Summary

This PR rolls back Linux/Windows canonical collapsing and OS auto-switching so billing/provisioning always use the exact selected service row.

What changed

  • Storefront service listing/order flow now keeps one purchasable option per enabled billing_services row (no canonical dedupe).
  • Removed order-page OS variant remapping (service_id is no longer swapped based on node OS).
  • Added XML-vs-node OS compatibility enforcement:
    • Order page only shows compatible locations where node OS is known.
    • add_to_cart.php blocks incompatible/manual submissions with clear user-facing errors.
    • create_servers.php re-validates compatibility and fails clearly instead of switching XML/service.
  • Provisioning now logs exact selected context including service_id, home_cfg_id, and config_xml.
  • create_servers.php install-state messaging now reports "Server installation is in progress." when update/install is active but executable is not yet present.
  • modules/gamemanager/view_server_log.php replaced deprecated utf8_encode() usage with PHP 8.3-safe encoding handling.
  • Admin service config readability pass: reduced Available Servers column dominance while preserving row-level save, save-all, and sortable columns.
  • Updated CHANGELOG.md, docs/COPILOT_TODO.md, and modules/billing/timestamp.txt.

Validation

  • php -l run on all changed PHP files:
    • modules/billing/serverlist.php
    • modules/billing/order.php
    • modules/billing/add_to_cart.php
    • modules/billing/create_servers.php
    • modules/billing/adminserverlist.php
    • modules/gamemanager/view_server_log.php
  • Repository searches executed for:
    • canonical/grouping and OS auto-switch hooks in billing flow
    • home_cfg/service substitution patterns
    • forced _linux.xml / _win.xml swapping
    • utf8_encode in target file
    • OGP_DB_PREFIX
  • parallel_validation executed:
    • Code Review: success (style/refactor suggestions only)
    • CodeQL: success (no analyzable language delta detected in tool run)

Copilot AI requested a review from iaretechnician May 9, 2026 16:10
@iaretechnician iaretechnician marked this pull request as ready for review May 9, 2026 16:17
Copilot AI review requested due to automatic review settings May 9, 2026 16:17
@iaretechnician iaretechnician merged commit aabc5c9 into Panel-unstable May 9, 2026
2 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the billing storefront + provisioning flow to stop collapsing Linux/Windows “canonical” variants and to provision the exact selected billing_services row, while adding OS-vs-node compatibility checks and improving provisioning/install-state messaging.

Changes:

  • Removed OS auto-switching/canonical dedupe so checkout/provisioning preserve the selected service_id / XML variant.
  • Added OS compatibility enforcement in order.php, add_to_cart.php, and create_servers.php (with additional provisioning context logging).
  • Modernized view_server_log.php encoding handling for PHP 8.3 by replacing deprecated utf8_encode() usage.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
modules/gamemanager/view_server_log.php Replaces deprecated utf8_encode() with mbstring/iconv-based UTF-8 normalization.
modules/billing/timestamp.txt Updates storefront footer “Last Updated” timestamp.
modules/billing/serverlist.php Stops canonical dedupe; shows one purchasable row per enabled service and adds OS variant label display.
modules/billing/order.php Removes OS-driven service remapping; filters locations by detected service OS and surfaces user-facing errors.
modules/billing/create_servers.php Re-validates OS compatibility during provisioning; logs selected service_id/home_cfg_id/XML; improves install-state messaging.
modules/billing/adminserverlist.php UI/CSS tweak to reduce “Available Servers” column dominance.
modules/billing/add_to_cart.php Adds server/location allowlist + OS compatibility validation before creating invoices; improved redirects with error messaging.
docs/COPILOT_TODO.md Adds a follow-up item for showing an OS-variant badge in the admin/serverlist UI.
CHANGELOG.md Documents the OS-variant rollback, compatibility enforcement, logging improvements, and UTF-8 change.

Comment on lines +37 to +40
if (preg_match('/(?:^|[_\-])(win|windows)(?:[_\-]|$)/i', $haystack)) {
return 'Windows';
}
if (preg_match('/(?:^|[_\-])linux(?:[_\-]|$)/i', $haystack)) {
Comment thread modules/billing/order.php
Comment on lines +116 to 120
if (preg_match('/(?:^|[_\\-])(win|windows)(?:[_\\-]|$)/i', $haystack)) {
return 'windows';
}
if (str_contains($lk, '_linux')) {
if (preg_match('/(?:^|[_\\-])linux(?:[_\\-]|$)/i', $haystack)) {
return 'linux';
Comment on lines +80 to +83
if (preg_match('/(?:^|[_\\-])(win|windows)(?:[_\\-]|$)/i', $haystack)) {
return 'windows';
}
if (preg_match('/(?:^|[_\\-])linux(?:[_\\-]|$)/i', $haystack)) {
Comment on lines +302 to +305
if (preg_match('/(?:^|[_\\-])(win|windows)(?:[_\\-]|$)/i', $haystack)) {
return 'windows';
}
if (preg_match('/(?:^|[_\\-])linux(?:[_\\-]|$)/i', $haystack)) {
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.

3 participants