Skip to content

feat: add new registration-service config param for ui canary deployement #476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api/v1alpha1/docs/apiref.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2124,6 +2124,14 @@ Consumed by host operator and set as env var on registration-service deployment
| *`registrationServiceURL`* __string__ | RegistrationServiceURL is the URL used to a ccess the registration service + | |
| *`replicas`* __integer__ | Replicas specifies the number of replicas to use for the registration service deployment + | |
| *`verification`* __xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-registrationserviceverificationconfig[$$RegistrationServiceVerificationConfig$$]__ | Keeps parameters necessary for the registration service verification config + | |
| *`uiCanaryDeploymentWeight`* __integer__ | UICanaryDeploymentWeight specifies the threshold of users that will be using the new UI. +
This configuration option is just a temporary solution for rolling out our new RHDH based UI using canary deployment strategy. +
Once we switch all our users to the new UI this will be removed. +
How this works: +
- backend returns a weight +
- old UI assigns a sticky random number for each user +
- if the user has a number within the weight returned from the backend than user get's redirect to to new UI +
- if the user has a number above the weight they keep using the current UI + | |
|===


Expand Down
12 changes: 12 additions & 0 deletions api/v1alpha1/toolchainconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,18 @@ type RegistrationServiceConfig struct {
// Keeps parameters necessary for the registration service verification config
// +optional
Verification RegistrationServiceVerificationConfig `json:"verification,omitempty"`

// UICanaryDeploymentWeight specifies the threshold of users that will be using the new UI.
// This configuration option is just a temporary solution for rolling out our new RHDH based UI using canary deployment strategy.
// Once we switch all our users to the new UI this will be removed.
// How this works:
// - backend returns a weight
// - old UI assigns a sticky random number for each user
// - if the user has a number within the weight returned from the backend than user get's redirect to to new UI
// - if the user has a number above the weight they keep using the current UI
//
// +optional
Copy link
Contributor

Choose a reason for hiding this comment

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

just a detail, but you can add a validation of the input

Suggested change
// +optional
// +optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=10
// +kubebuilder:default=10

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, tbh I'm not sure what range we want to use.

I though about 1 - 100.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added the range (0 - 100 ) , but not the default, since that is defined in the registration service helper function.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, 1-100 is preferable IMO.

UICanaryDeploymentWeight *int `json:"uiCanaryDeploymentWeight,omitempty"`
}

// RegistrationServiceAnalyticsConfig contains the subset of registration service configuration parameters related to analytics
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions api/v1alpha1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading