Skip to content
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

Sandbox 554 #404

Merged
merged 8 commits into from
Mar 15, 2024
Merged

Sandbox 554 #404

merged 8 commits into from
Mar 15, 2024

Conversation

sbryzak
Copy link
Contributor

@sbryzak sbryzak commented Mar 12, 2024

Description

Introduce a new property to the UserSignup.Status which stores the timestamp of the user's deactivation. Related PR: codeready-toolchain/registration-service#411

Checks

  1. Did you run make generate target? yes

  2. Did make generate change anything in other projects (host-operator, member-operator)? yes

  3. In case of new CRD, did you the following? n/a

  4. In case other projects are changed, please provides PR links.

// after the expiry of their trial and based on the term specific by their UserTier. This property may be used as
// a convenience to determine the amount of time an account has left before deactivation, without requiring a separate
// lookup for the UserTier and subsequent calculation. It is managed by the Deactivation controller in the host operator.
DeactivationTimestamp string `json:"deactivationTimestamp,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't it be stored in one of the status.conditions, instead? We already add a status condition when a user is activated or banned, so why using something different for deactivations?

Copy link
Contributor

Choose a reason for hiding this comment

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

ah never mind, this is the expected time of deactivation, not the actual one (ie, after the user was deactivated).

Copy link
Contributor

Choose a reason for hiding this comment

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

so this field will need to be updated when a user is moved to another tier.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's maybe rename it to ExpectedTimeOfDeactivation or something like that to make it clear.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, could you please explain why you decided to use string? what is the expected format/content?
Why don't you use metav1.Time as we use in conditions?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @MatousJobanek. Something like ExpectedTimeOfDeactivation with metav1.Time type would look better.

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 renamed it to ScheduledDeactivationTimestamp, and also modified the type to use metav1.Time instead of a string to bring it inline with the rest of the API (before I saw these comments, so at least we were all on the same page ;).

Copy link
Contributor

@mfrancisc mfrancisc left a comment

Choose a reason for hiding this comment

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

LGTM

I have one small comment

api/v1alpha1/usersignup_types.go Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Mar 15, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@alexeykazakov alexeykazakov left a comment

Choose a reason for hiding this comment

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

👍

@sbryzak sbryzak merged commit d61ff49 into codeready-toolchain:master Mar 15, 2024
3 checks passed
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.

5 participants