Skip to content

Calculate and return days remaining in get signup response #432

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 37 commits into from
Jul 4, 2024

Conversation

sbryzak
Copy link
Contributor

@sbryzak sbryzak commented May 15, 2024

If the UserSignup.Status.ScheduledDeactivationTimestamp property is set, then use it to calculate the number of days remaining in the user's trial and return that value in the get signup response.

e2e tests: codeready-toolchain/toolchain-e2e#995

Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.14%. Comparing base (644e2e8) to head (ab70570).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #432      +/-   ##
==========================================
+ Coverage   78.10%   78.14%   +0.03%     
==========================================
  Files          41       41              
  Lines        2677     2681       +4     
==========================================
+ Hits         2091     2095       +4     
  Misses        491      491              
  Partials       95       95              
Flag Coverage Δ
unittests 78.14% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@MatousJobanek MatousJobanek left a comment

Choose a reason for hiding this comment

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

I haven't seen any PR for the changes in toolchain-e2e, could you please create one?

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
11.6% 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.

Looks good to me but I would get rid of the DaysRamaining thing and let the UI calculate it from the EndDate if needed.

@sbryzak
Copy link
Contributor Author

sbryzak commented Jun 27, 2024

DaysRemaining is now removed.

Copy link
Contributor

@MatousJobanek MatousJobanek left a comment

Choose a reason for hiding this comment

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

I don't see any unit test that would verify the case when the ScheduledDeactivationTimestamp/ProvisionedTime is not set - we need to make sure that the empty string is returned in this case.
Sorry if I missed it somewhere.

@sbryzak
Copy link
Contributor Author

sbryzak commented Jul 2, 2024

Added check to existing test to ensure StartDate / EndDate are now blank when user is not active.

Copy link
Contributor

@MatousJobanek MatousJobanek left a comment

Choose a reason for hiding this comment

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

Nice 👍 Thanks for the extra changes 🙏

Copy link

openshift-ci bot commented Jul 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, MatousJobanek, sbryzak

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [MatousJobanek,alexeykazakov,sbryzak]

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

@sbryzak sbryzak merged commit e7507a5 into codeready-toolchain:master Jul 4, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants