From 64e5744d8ca7d813cf81a03a441de1aa7458605f Mon Sep 17 00:00:00 2001 From: regexowl Date: Wed, 30 Jul 2025 13:19:17 +0200 Subject: [PATCH] Wizard: Remove RHEL betas from release options This removes RHEL betas from release menu and cleans up the code in several places. --- .../CreateImageWizard/CreateImageWizard.tsx | 13 ++---------- .../ImageOutput/components/ReleaseSelect.tsx | 18 ----------------- .../steps/Oscap/removeBetaFromRelease.ts | 2 +- .../Registration/components/Registration.tsx | 20 +++---------------- .../utilities/requestMapper.ts | 10 ++-------- src/constants.ts | 3 --- .../steps/ImageOutput/ImageOutput.test.tsx | 5 ----- 7 files changed, 8 insertions(+), 63 deletions(-) diff --git a/src/Components/CreateImageWizard/CreateImageWizard.tsx b/src/Components/CreateImageWizard/CreateImageWizard.tsx index 2999d1a5..3507693e 100644 --- a/src/Components/CreateImageWizard/CreateImageWizard.tsx +++ b/src/Components/CreateImageWizard/CreateImageWizard.tsx @@ -65,7 +65,6 @@ import { AARCH64, AMPLITUDE_MODULE_NAME, RHEL_10, - RHEL_10_BETA, RHEL_8, RHEL_9, } from '../../constants'; @@ -210,9 +209,6 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => { if (searchParams.get('release') === 'rhel9') { dispatch(changeDistribution(RHEL_9)); } - if (searchParams.get('release') === 'rhel10beta') { - dispatch(changeDistribution(RHEL_10_BETA)); - } if (searchParams.get('release') === 'rhel10') { dispatch(changeDistribution(RHEL_10)); } @@ -489,7 +485,6 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => { name={complianceEnabled ? 'Compliance' : 'OpenSCAP'} id="step-oscap" key="step-oscap" - isHidden={distribution === RHEL_10_BETA} navItem={CustomStatusNavItem} footer={ @@ -529,9 +524,7 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => { key="wizard-repository-snapshot" navItem={CustomStatusNavItem} status={snapshotValidation.disabledNext ? 'error' : 'default'} - isHidden={ - distribution === RHEL_10_BETA || !!process.env.IS_ON_PREMISE - } + isHidden={!!process.env.IS_ON_PREMISE} footer={ { id="wizard-custom-repositories" key="wizard-custom-repositories" navItem={CustomStatusNavItem} - isHidden={ - distribution === RHEL_10_BETA || !!process.env.IS_ON_PREMISE - } + isHidden={!!process.env.IS_ON_PREMISE} isDisabled={snapshotValidation.disabledNext} footer={ diff --git a/src/Components/CreateImageWizard/steps/ImageOutput/components/ReleaseSelect.tsx b/src/Components/CreateImageWizard/steps/ImageOutput/components/ReleaseSelect.tsx index 620e067b..fc0e3164 100644 --- a/src/Components/CreateImageWizard/steps/ImageOutput/components/ReleaseSelect.tsx +++ b/src/Components/CreateImageWizard/steps/ImageOutput/components/ReleaseSelect.tsx @@ -13,14 +13,12 @@ import { ON_PREM_RELEASES, RELEASES, RHEL_10, - RHEL_10_BETA, RHEL_10_FULL_SUPPORT, RHEL_10_MAINTENANCE_SUPPORT, RHEL_8, RHEL_8_FULL_SUPPORT, RHEL_8_MAINTENANCE_SUPPORT, RHEL_9, - RHEL_9_BETA, RHEL_9_FULL_SUPPORT, RHEL_9_MAINTENANCE_SUPPORT, } from '../../../../../constants'; @@ -33,7 +31,6 @@ import { } from '../../../../../store/wizardSlice'; import isRhel from '../../../../../Utilities/isRhel'; import { toMonthAndYear } from '../../../../../Utilities/time'; -import { useFlag } from '../../../../../Utilities/useGetEnvironment'; const ReleaseSelect = () => { // What the UI refers to as the "release" is referred to as the "distribution" in the API. @@ -44,9 +41,6 @@ const ReleaseSelect = () => { const [isOpen, setIsOpen] = useState(false); const [showDevelopmentOptions, setShowDevelopmentOptions] = useState(false); - const isRHEL9BetaEnabled = useFlag('image-builder.rhel9.beta.enabled'); - const isRHEL10BetaEnabled = useFlag('image-builder.rhel10.beta.enabled'); - const releases = process.env.IS_ON_PREMISE ? ON_PREM_RELEASES : RELEASES; const handleSelect = (_event: React.MouseEvent, selection: Distributions) => { @@ -70,10 +64,6 @@ const ReleaseSelect = () => { return ''; } - if (key === RHEL_9_BETA || key === RHEL_10_BETA) { - return ''; - } - let fullSupportEnd = ''; let maintenanceSupportEnd = ''; @@ -105,14 +95,6 @@ const ReleaseSelect = () => { return key === distribution; } - if (key === RHEL_9_BETA) { - return isRHEL9BetaEnabled; - } - - if (key === RHEL_10_BETA) { - return isRHEL10BetaEnabled; - } - // Only show non-RHEL distros if expanded if (showDevelopmentOptions) { return true; diff --git a/src/Components/CreateImageWizard/steps/Oscap/removeBetaFromRelease.ts b/src/Components/CreateImageWizard/steps/Oscap/removeBetaFromRelease.ts index de8155c5..e628d155 100644 --- a/src/Components/CreateImageWizard/steps/Oscap/removeBetaFromRelease.ts +++ b/src/Components/CreateImageWizard/steps/Oscap/removeBetaFromRelease.ts @@ -11,7 +11,7 @@ import { Distributions } from '../../../../store/imageBuilderApi'; export const removeBetaFromRelease = (dist: Distributions): Distributions => { switch (dist) { case RHEL_10_BETA: - return RHEL_10 as Distributions; + return RHEL_10; case RHEL_9_BETA: return RHEL_9; default: diff --git a/src/Components/CreateImageWizard/steps/Registration/components/Registration.tsx b/src/Components/CreateImageWizard/steps/Registration/components/Registration.tsx index e19a2030..3d8acf53 100644 --- a/src/Components/CreateImageWizard/steps/Registration/components/Registration.tsx +++ b/src/Components/CreateImageWizard/steps/Registration/components/Registration.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { Button, @@ -11,11 +11,10 @@ import { import { ExternalLinkAltIcon, HelpIcon } from '@patternfly/react-icons'; import { useFlag } from '@unleash/proxy-client-react'; -import { INSIGHTS_URL, RHC_URL, RHEL_10_BETA } from '../../../../../constants'; +import { INSIGHTS_URL, RHC_URL } from '../../../../../constants'; import { useAppDispatch, useAppSelector } from '../../../../../store/hooks'; import { changeRegistrationType, - selectDistribution, selectRegistrationType, } from '../../../../../store/wizardSlice'; @@ -98,7 +97,6 @@ const RhcPopover = () => { const Registration = () => { const dispatch = useAppDispatch(); - const distribution = useAppSelector(selectDistribution); const registrationType = useAppSelector(selectRegistrationType); const [showOptions, setShowOptions] = useState( @@ -109,13 +107,6 @@ const Registration = () => { 'image-builder.satellite.enabled' ); - // TO DO: Remove when rhc starts working for RHEL 10 Beta - useEffect(() => { - if (distribution === RHEL_10_BETA) { - dispatch(changeRegistrationType('register-now-insights')); - } - }, []); - return ( { registrationType === 'register-now-rhc' } onChange={(_event, checked) => { - // TO DO: Update when rhc starts working for RHEL 10 Beta - if (checked && distribution !== RHEL_10_BETA) { + if (checked) { dispatch(changeRegistrationType('register-now-rhc')); - } else if (checked && distribution === RHEL_10_BETA) { - dispatch(changeRegistrationType('register-now-insights')); } }} id="register-system-now" @@ -187,8 +175,6 @@ const Registration = () => { dispatch(changeRegistrationType('register-now-insights')); } }} - // TO DO: Remove when rhc starts working for RHEL 10 Beta - isDisabled={distribution === RHEL_10_BETA} id="register-system-now-rhc" name="register-system-rhc" /> diff --git a/src/Components/CreateImageWizard/utilities/requestMapper.ts b/src/Components/CreateImageWizard/utilities/requestMapper.ts index fc9756e1..b0a7b3a7 100644 --- a/src/Components/CreateImageWizard/utilities/requestMapper.ts +++ b/src/Components/CreateImageWizard/utilities/requestMapper.ts @@ -9,10 +9,8 @@ import { FIRSTBOOT_PATH, FIRSTBOOT_SERVICE_PATH, RHEL_10, - RHEL_10_BETA, RHEL_8, RHEL_9, - RHEL_9_BETA, SATELLITE_PATH, SATELLITE_SERVICE_DATA, SATELLITE_SERVICE_PATH, @@ -163,12 +161,8 @@ const convertFilesystemToPartition = (filesystem: Filesystem): Partition => { * @param distribution blueprint distribution */ const getLatestRelease = (distribution: Distributions) => { - return distribution === RHEL_10_BETA - ? (RHEL_10_BETA as Distributions) - : distribution.startsWith('rhel-10') - ? (RHEL_10 as Distributions) - : distribution === RHEL_9_BETA - ? (RHEL_9_BETA as Distributions) + return distribution.startsWith('rhel-10') + ? RHEL_10 : distribution.startsWith('rhel-9') ? RHEL_9 : distribution.startsWith('rhel-8') diff --git a/src/constants.ts b/src/constants.ts index 792946a4..f278414c 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -88,8 +88,6 @@ export const RELEASES = new Map([ [RHEL_10, 'Red Hat Enterprise Linux (RHEL) 10'], [RHEL_9, 'Red Hat Enterprise Linux (RHEL) 9'], [RHEL_8, 'Red Hat Enterprise Linux (RHEL) 8'], - [RHEL_9_BETA, 'Red Hat Enterprise Linux (RHEL) 9 Beta'], - [RHEL_10_BETA, 'Red Hat Enterprise Linux (RHEL) 10 Beta'], [CENTOS_9, 'CentOS Stream 9'], [CENTOS_10, 'CentOS Stream 10'], ]); @@ -98,7 +96,6 @@ export const ON_PREM_RELEASES = new Map([ [CENTOS_10, 'CentOS Stream 10'], [FEDORA_41, 'Fedora Linux 41'], [FEDORA_42, 'Fedora Linux 42'], - [RHEL_10_BETA, 'Red Hat Enterprise Linux (RHEL) 10 Beta'], [RHEL_10, 'Red Hat Enterprise Linux (RHEL) 10'], ]); diff --git a/src/test/Components/CreateImageWizard/steps/ImageOutput/ImageOutput.test.tsx b/src/test/Components/CreateImageWizard/steps/ImageOutput/ImageOutput.test.tsx index ab295707..ee026638 100644 --- a/src/test/Components/CreateImageWizard/steps/ImageOutput/ImageOutput.test.tsx +++ b/src/test/Components/CreateImageWizard/steps/ImageOutput/ImageOutput.test.tsx @@ -682,11 +682,6 @@ describe('Set release using query parameter', () => { await renderCreateMode({ release: 'rhel9' }); await screen.findByText('Red Hat Enterprise Linux (RHEL) 9'); }); - - test('rhel 10 beta (query parameter provided)', async () => { - await renderCreateMode({ release: 'rhel10beta' }); - await screen.findByText('Red Hat Enterprise Linux (RHEL) 10 Beta'); - }); }); describe('Set architecture using query parameter', () => {