Draft: feat: add OS deprecation warning banner
Relates to issue #517674
Changes
This MR implements an OS deprecation warning banner system for GitLab administrators to alert them when their operating system is approaching end-of-life.
Core Components
OS Support Checker Service (lib/gitlab/os_support_checker.rb)
- Uses Ohai gem to detect OS platform and version
- Reads EOL data from
supported_os_data.yml - Calculates months until EOL date
- Returns status hash with OS information and support status
- Handles version matching (exact and major version)
Admin OS Support Helper (app/helpers/admin/os_support_helper.rb)
-
show_os_deprecation_banner?- Shows banner only to admins when EOL ≤6 months away -
os_banner_variant- Returns:warningfor 6 months,:dangerfor ≤3 months -
os_banner_dismissible?- Returnsfalsewhen ≤1 month until EOL -
os_banner_message- Generates appropriate message based on time until EOL
Banner View Partial (app/views/admin/dashboard/_os_deprecation_banner.html.haml)
- Uses
Users::DismissibleAlertComponentwhen dismissible - Uses
Pajamas::AlertComponentwhen non-dismissible (≤1 month) - Applies correct variant (warning/danger) based on time until EOL
Integration Points
Dashboard Integration (app/views/admin/dashboard/index.html.haml)
- Banner rendered on admin dashboard after web_ide_oauth_callback_mismatch_callout
Controller (app/controllers/admin/dashboard_controller.rb)
- Assigns
@os_support_statusfrom OS Support Checker - Includes Admin::OsSupportHelper
Callout System
- Added
os_deprecation_banner: 120enum toapp/models/users/callout.rb - Added
OS_DEPRECATION_BANNERconstant toapp/helpers/users/callouts_helper.rb
Banner Behavior
-
✅ No banner shown if EOL is more than 6 months away -
✅ Orange (warning) dismissible banner if EOL is 6 months away -
✅ Red (danger) dismissible banner if EOL is 3 months away -
✅ Red (danger) non-dismissible banner if EOL is 1 month away -
✅ Only shown to administrators (current_user.can_admin_all_resources?)
Test Coverage
- OS Support Checker Specs - Tests OS detection, YAML parsing, EOL calculations, error handling
- Helper Specs - Tests all helper methods for various scenarios
- View Specs - Tests banner rendering for different time periods and user types
-
Controller Specs - Tests
@os_support_statusassignment - Callout Model Specs - Tests enum value
Additional Files
Sample OS Data File (supported_os_data.yml)
- Contains sample EOL data for Ubuntu, Debian, AlmaLinux, Rocky, CentOS, RHEL, Amazon Linux, openSUSE Leap, and SLES
- Serves as reference/example (actual file will be provided by omnibus-gitlab)
Edited by Balasankar 'Balu' C