Skip to content

Conversation

@gazarenkov
Copy link
Member

Description

Delete APIs of v1alpha1 and v1alpha2

Which issue(s) does this PR fix or relate to

https://issues.redhat.com/browse/RHIDP-7198

PR acceptance criteria

  • Tests
  • Documentation

How to test changes / Special notes to the reviewer

@openshift-ci
Copy link

openshift-ci bot commented Nov 4, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rm3l for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@qodo-merge-pro
Copy link

qodo-merge-pro bot commented Nov 4, 2025

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

RHIDP-7198 - Partially compliant

Compliant requirements:

  • Remove v1alpha1 and v1alpha2 versions from the Operator code.
  • Ensure v1alpha1/v1alpha2 are no longer used in upstream docs and examples.

Non-compliant requirements:

  • None

Requires further human verification:

  • All tests should still pass (CI execution required).
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🔒 No security concerns identified
⚡ Recommended focus areas for review

Upgrade Test Intent

The e2e upgrade test now applies a v1alpha3 Backstage resource instead of an older version. Verify this still validates upgrade paths as intended; if the goal was to test upgrading from removed versions, consider keeping a legacy manifest at cluster level while ensuring no code depends on removed APIs.

apiVersion: rhdh.redhat.com/v1alpha3
kind: Backstage
metadata:
  name: my-backstage-app
  namespace: %s
CSV Content Removed

CSV now has empty CRDs and deployments. Confirm this file is either intentionally a placeholder or regenerated elsewhere; otherwise OLM installation will fail due to missing owned CRDs, permissions and deployment specs.

customresourcedefinitions: {}
description: |
  Backstage Operator
displayName: Backstage Operator
install:
  spec:
    deployments: []
Naming/Metadata Changes

The CSV name and package labels changed (rhdh-operator -> backstage-operator). Ensure channel/package name changes are coordinated with catalog and upgrade paths to avoid breaking upgrades for existing subscribers.

  name: backstage-operator.v1.9.0
  namespace: placeholder
spec:
  apiservicedefinitions: {}
  customresourcedefinitions:
    owned:
    - description: |-
        Backstage is the Schema for the Red Hat Developer Hub backstages API.
        It comes with pre-built plug-ins, configuration settings, and deployment mechanisms,
        which can help streamline the process of setting up a self-managed internal
        developer portal for adopters who are just starting out.
📄 References
  1. No matching references available

@gazarenkov gazarenkov requested a review from rm3l November 4, 2025 14:20
@qodo-merge-pro qodo-merge-pro bot added the enhancement New feature or request label Nov 4, 2025
@qodo-merge-pro
Copy link

qodo-merge-pro bot commented Nov 4, 2025

PR Type

(Describe updated until commit 1b60738)

Enhancement


Description

  • Remove deprecated v1alpha1 and v1alpha2 API versions

  • Update test and sample configurations to use v1alpha3

  • Regenerate bundle and installer manifests with updated timestamps

  • Clean up commented-out labels in sample YAML files


File Walkthrough

Relevant files
Tests
2 files
e2e_upgrade_test.go
Update e2e test to use v1alpha3 API                                           
+1/-1     
suite_test.go
Update integration tests for API version removal                 
+0/-6     
Configuration changes
8 files
backstage-operator.clusterserviceversion.yaml
Remove alpha1/alpha2 examples from CSV manifest                   
+1/-37   
backstage-operator.clusterserviceversion.yaml
Remove alpha1/alpha2 examples from CSV manifest                   
+1/-37   
rhdh.redhat.com_backstages.yaml
Regenerate CRD manifest removing alpha versions                   
+0/-762 
rhdh.redhat.com_backstages.yaml
Regenerate CRD manifest removing alpha versions                   
+0/-762 
rhdh.redhat.com_backstages.yaml
Regenerate CRD base removing alpha versions                           
+0/-762 
install.yaml
Regenerate distribution manifest removing alpha versions 
+0/-762 
install.yaml
Regenerate distribution manifest removing alpha versions 
+0/-762 
kustomization.yaml
Update kustomization for sample configuration changes       
+0/-2     
Formatting
2 files
_v1alpha3_backstage.yaml
Clean up commented labels and TODO comment                             
+1/-5     
_v1alpha4_backstage.yaml
Clean up commented labels and TODO comment                             
+1/-5     
Additional files
8 files
backstage_types.go +0/-287 
groupversion_info.go +0/-20   
zz_generated.deepcopy.go +0/-351 
backstage_types.go +0/-299 
groupversion_info.go +0/-20   
zz_generated.deepcopy.go +0/-377 
_v1alpha1_backstage.yaml +0/-12   
_v1alpha2_backstage.yaml +0/-12   

@rhdh-qodo-merge
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

RHIDP-7198 - Partially compliant

Compliant requirements:

  • Remove v1alpha1 and v1alpha2 versions from the Operator code
  • Ensure v1alpha1 and v1alpha2 are no longer used in upstream docs and examples

Non-compliant requirements:

  • All tests should still pass

Requires further human verification:

  • All tests should still pass (must be verified via CI execution)
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🔒 No security concerns identified
⚡ Recommended focus areas for review

Upgrade Path Change

The e2e upgrade test now creates a v1alpha3 Backstage resource instead of v1alpha1, which changes the exercised upgrade path. Confirm this still validates intended upgrade scenarios and doesn’t skip coverage for existing users on older versions if that’s required.

apiVersion: rhdh.redhat.com/v1alpha3
kind: Backstage
metadata:
  name: my-backstage-app
  namespace: %s
📚 Focus areas based on broader codebase context

CSV Regression

The CSV drops owned CRDs and deployment/permissions, setting empty customresourcedefinitions and deployments. Validate that the operator still installs and reconciles v1alpha3/v1alpha4 as exercised by integration tests and that required RBAC and controller deployment remain present. (Ref 6)

    alm-examples: '[]'
    createdAt: "2025-11-04T14:02:55Z"
    description: Backstage Operator
    operators.operatorframework.io/builder: operator-sdk-v1.37.0
    operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
  labels:
    operatorframework.io/arch.amd64: supported
  name: backstage-operator.v0.9.0
spec:
  apiservicedefinitions: {}
  customresourcedefinitions: {}
  description: |
    Backstage Operator
  displayName: Backstage Operator
  install:
    spec:
      deployments: []
    strategy: deployment

Reference reasoning: Integration tests expect the operator to reconcile Backstage resources for v1alpha3 and v1alpha4 and create deployments. Removing owned CRDs and the controller deployment from the CSV conflicts with these behaviors, risking install/run-time failures.

📄 References
  1. redhat-developer/rhdh-operator/integration_tests/cr-compatibility_test.go [37-85]
  2. redhat-developer/rhdh-operator/integration_tests/cr-compatibility_test.go [97-135]
  3. redhat-developer/rhdh-operator/integration_tests/cr-compatibility_test.go [147-177]
  4. redhat-developer/rhdh-operator/integration_tests/cr-compatibility_test.go [86-95]
  5. redhat-developer/rhdh-operator/integration_tests/cr-compatibility_test.go [136-145]
  6. redhat-developer/rhdh-operator/integration_tests/cr-compatibility_test.go [1-35]
  7. redhat-developer/rhdh-operator/internal/controller/backstage_controller_test.go [25-65]
  8. redhat-developer/rhdh-operator/integration_tests/db_test.go [74-87]

@qodo-merge-pro
Copy link

qodo-merge-pro bot commented Nov 4, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
The community operator bundle is broken

The bundle/backstage.io/manifests/backstage-operator.clusterserviceversion.yaml
file is almost entirely deleted, which will break the community operator
installation. This file should be fixed to only remove the deprecated API
versions (v1alpha1, v1alpha2) while keeping the definitions for the remaining
versions.

Examples:

bundle/backstage.io/manifests/backstage-operator.clusterserviceversion.yaml [1-49]
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  annotations:
    alm-examples: '[]'
    createdAt: "2025-11-04T14:02:55Z"
    description: Backstage Operator
    operators.operatorframework.io/builder: operator-sdk-v1.37.0
    operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
  labels:

 ... (clipped 39 lines)

Solution Walkthrough:

Before:

# bundle/backstage.io/manifests/backstage-operator.clusterserviceversion.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  annotations:
    alm-examples: '[...]'
spec:
  customresourcedefinitions: {}
  description: |
    Backstage Operator
  displayName: Backstage Operator
  install:
    spec:
      deployments: []
    strategy: deployment
  ...

After:

# bundle/backstage.io/manifests/backstage-operator.clusterserviceversion.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  annotations:
    alm-examples: |-
      [
        { "apiVersion": "rhdh.redhat.com/v1alpha3", ... },
        { "apiVersion": "rhdh.redhat.com/v1alpha4", ... }
      ]
spec:
  customresourcedefinitions:
    owned:
    - { name: backstages.rhdh.redhat.com, version: v1alpha3, ... }
    - { name: backstages.rhdh.redhat.com, version: v1alpha4, ... }
  install:
    spec:
      clusterPermissions:
      - rules:
        ...
      deployments:
      - name: backstage-operator
        spec:
          ...
      permissions:
      - rules:
        ...
Suggestion importance[1-10]: 10

__

Why: The suggestion correctly identifies a critical issue where the community operator's ClusterServiceVersion (CSV) file is effectively emptied, which would break OLM-based deployments.

High
Possible issue
Fix upgrade test to validate migration

Revert the change in the upgrade test to create a v1alpha1 Custom Resource (CR)
instead of v1alpha3 to properly validate the migration path for older CR
versions after an operator upgrade.

tests/e2e/e2e_upgrade_test.go [55-64]

 			go func() {
 				defer stdin.Close()
 				_, _ = io.WriteString(stdin, fmt.Sprintf(`
-apiVersion: rhdh.redhat.com/v1alpha3
+apiVersion: rhdh.redhat.com/v1alpha1
 kind: Backstage
 metadata:
   name: my-backstage-app
   namespace: %s
 `, ns))
 			}()
  • Apply / Chat
Suggestion importance[1-10]: 10

__

Why: The suggestion correctly identifies a critical flaw in the E2E upgrade test, where changing the test to create a v1alpha3 CR instead of v1alpha1 prevents validation of the migration path for older CR versions, which is the main purpose of this PR.

High
  • Update

@rhdh-qodo-merge
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
The backstage.io bundle is broken

The ClusterServiceVersion (CSV) file for the backstage.io bundle is broken
because its install spec and customresourcedefinitions.owned sections have been
emptied. This will prevent the operator from installing correctly and appears to
be an accidental error.

Examples:

bundle/backstage.io/manifests/backstage-operator.clusterserviceversion.yaml [5-22]
    alm-examples: '[]'
    createdAt: "2025-11-04T14:02:55Z"
    description: Backstage Operator
    operators.operatorframework.io/builder: operator-sdk-v1.37.0
    operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
  labels:
    operatorframework.io/arch.amd64: supported
  name: backstage-operator.v0.9.0
spec:
  apiservicedefinitions: {}

 ... (clipped 8 lines)

Solution Walkthrough:

Before:

# bundle/backstage.io/manifests/backstage-operator.clusterserviceversion.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
spec:
  customresourcedefinitions:
    owned:
    - description: Backstage is the Schema...
      displayName: Red Hat Developer Hub
      kind: Backstage
      name: backstages.rhdh.redhat.com
      version: v1alpha1
    # ... other versions
  install:
    spec:
      clusterPermissions:
      - rules:
        # ... permissions
      deployments:
      - name: backstage-operator
        spec:
        # ... deployment spec

After:

# bundle/backstage.io/manifests/backstage-operator.clusterserviceversion.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  annotations:
    alm-examples: '[]'
spec:
  customresourcedefinitions: {}
  install:
    spec:
      deployments: []
    strategy: deployment
Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies a critical regression where the backstage.io bundle's CSV file is almost completely emptied, which would break operator installation.

High
  • More

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

⚠️ Files changed in bundle and installer generation!

Those changes to the operator bundle/installer manifests should have been pushed automatically to your PR branch.

NOTE: If the PR checks are stuck after this additional commit, manually close the PR and immediately reopen it to trigger the checks again.

@rhdh-qodo-merge
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

RHIDP-7198 - Partially compliant

Compliant requirements:

  • Ensure v1alpha1 and v1alpha2 are no longer used in upstream docs and examples.

Non-compliant requirements:

  • Remove v1alpha1 and v1alpha2 versions from the Operator code.

Requires further human verification:

  • All tests should still pass (CI run needed).
  • Confirm all references in docs and manifests across the repo are updated beyond the shown hunks.
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🔒 No security concerns identified
⚡ Recommended focus areas for review

Test Coverage

The test now references apiVersion v1alpha3, but there are no added tests verifying that v1alpha1 and v1alpha2 are rejected or migrated appropriately during upgrade paths. Consider adding or updating tests to ensure removal does not break upgrades from older CRs.

			go func() {
				defer stdin.Close()
				_, _ = io.WriteString(stdin, fmt.Sprintf(`
apiVersion: rhdh.redhat.com/v1alpha3
kind: Backstage
metadata:
  name: my-backstage-app
Metadata Change

The 'createdAt' timestamp was updated; ensure this is intentional and consistent across all CSVs and release processes to avoid accidental churn in OLM packaging.

categories: Developer Tools
certified: "true"
containerImage: registry.redhat.io/rhdh/rhdh-rhel9-operator:1.9
createdAt: "2025-11-04T14:28:03Z"
description: Red Hat Developer Hub is a Red Hat supported version of Backstage.
  It comes with pre-built plug-ins and configuration settings, supports use of
  an external database, and can help streamline the process of setting up a self-managed
📚 Focus areas based on broader codebase context

API Version Consistency

The test updates the CR to apiVersion rhdh.redhat.com/v1alpha3, while CRDs and manifests elsewhere standardize on v1alpha4. Consider aligning the test to the latest supported version to ensure upgrade coverage matches shipped CRDs. (Ref 1, Ref 2)

apiVersion: rhdh.redhat.com/v1alpha3
kind: Backstage

Reference reasoning: The referenced CRD and bundle manifests declare name: v1alpha4 as the available API version. Using v1alpha3 in tests may diverge from the supported version indicated by those manifests.

📄 References
  1. redhat-developer/rhdh-operator/config/crd/bases/rhdh.redhat.com_backstages.yaml [1194-1201]
  2. redhat-developer/rhdh-operator/bundle/backstage.io/manifests/rhdh.redhat.com_backstages.yaml [1194-1201]
  3. redhat-developer/rhdh-operator/bundle/rhdh/manifests/rhdh.redhat.com_backstages.yaml [1194-1201]
  4. redhat-developer/rhdh-operator/dist/rhdh/install.yaml [1206-1213]
  5. redhat-developer/rhdh-operator/dist/backstage.io/install.yaml [1206-1213]
  6. redhat-developer/rhdh-operator/dist/rhdh/install.yaml [1836-1917]
  7. redhat-developer/rhdh-operator/pkg/model/testdata/janus-deployment.yaml [1-35]
  8. redhat-developer/rhdh-operator/pkg/model/testdata/janus-deployment.yaml [36-56]

@rhdh-qodo-merge
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix broken end-to-end upgrade test

Revert the API version in the e2e upgrade test from v1alpha3 back to v1alpha1 to
ensure the test correctly validates the upgrade path from an older operator
version.

tests/e2e/e2e_upgrade_test.go [55-63]

 			go func() {
 				defer stdin.Close()
 				_, _ = io.WriteString(stdin, fmt.Sprintf(`
--apiVersion: rhdh.redhat.com/v1alpha1
-+apiVersion: rhdh.redhat.com/v1alpha3
+apiVersion: rhdh.redhat.com/v1alpha1
  kind: Backstage
  metadata:
    name: my-backstage-app

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 10

__

Why: The suggestion correctly identifies a critical flaw in the e2e upgrade test logic, which would likely fail by attempting to create a v1alpha3 CR with an older operator that does not support it, thus invalidating the upgrade test.

High
  • More

Copy link
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

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

Comment on lines -59 to -74
- description: Backstage is the Schema for the Red Hat Developer Hub backstages
API. It comes with pre-built plug-ins, configuration settings, and deployment
mechanisms, which can help streamline the process of setting up a self-managed
internal developer portal for adopters who are just starting out.
displayName: Red Hat Developer Hub
kind: Backstage
name: backstages.rhdh.redhat.com
version: v1alpha1
- description: Backstage is the Schema for the Red Hat Developer Hub backstages
API. It comes with pre-built plug-ins, configuration settings, and deployment
mechanisms, which can help streamline the process of setting up a self-managed
internal developer portal for adopters who are just starting out.
displayName: Red Hat Developer Hub
kind: Backstage
name: backstages.rhdh.redhat.com
version: v1alpha2
Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines -82 to -97
- description: Backstage is the Schema for the Red Hat Developer Hub backstages
API. It comes with pre-built plug-ins, configuration settings, and deployment
mechanisms, which can help streamline the process of setting up a self-managed
internal developer portal for adopters who are just starting out.
displayName: Red Hat Developer Hub
kind: Backstage
name: backstages.rhdh.redhat.com
version: v1alpha1
- description: Backstage is the Schema for the Red Hat Developer Hub backstages
API. It comes with pre-built plug-ins, configuration settings, and deployment
mechanisms, which can help streamline the process of setting up a self-managed
internal developer portal for adopters who are just starting out.
displayName: Red Hat Developer Hub
kind: Backstage
name: backstages.rhdh.redhat.com
version: v1alpha2
Copy link
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants