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

CloudCredential Model: Fix CC expiry display #13184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m-ildefons
Copy link
Contributor

@m-ildefons m-ildefons commented Jan 23, 2025

Fix CloudCredential expiry date not being displayed if it's more than a week in the future.
In this case, the behavior was the same as if there wasn't an expiry date at all. This was confusing to users.
Fix it by always displaying the expiry date for CloudCredentials if it's set.

Summary

Fixes #13186

Occurred changes and/or fixed issues

Technical notes summary

This fix changes the model such that if an expiration-timestamp is set, expireData will always return an object. It will only return null, if there is no expiration-timestamp set at all, which can be the case for CloudCredential objects for infrastructure providers other than Harvester.

Areas or cases that should be tested

Cloud Credential List

Case 1)
Cloud Credentials for non-Harvester infrastructure providers should be correctly displayed without an expiration date, if they don't have an expiration date

Case 2)
Cloud Credentials for Harvester should be correctly displayed with their expiration date clearly visible regardless of when the expiration date is

Case 3)
Cloud Credentials for Harvester should be displayed with a info/highlighting if the expiration date is within the next 7 days

Case 4)
Cloud Credentials for Harvester should be displayed with an warning/highlighting if the expiration date is in the past

Areas which could experience regressions

Cloud Credential List

Screenshot/Video

Screenshot at 2025-01-23 13-08-50

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

Fix CloudCredential expiry date not being displayed if it's more than a
week in the future.
In this case, the behavior was the same as if there wasn't an expiry
date at all. This was confusing to users.
Fix it by always displaying the expiry date for CloudCredentials if it's
set.

Signed-off-by: Moritz Röhrich <moritz.rohrich@suse.com>
Copy link
Member

@richard-cox richard-cox left a comment

Choose a reason for hiding this comment

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

As per slack conversation.

  • This is probably a bug, rather than expected for other reasons, but i'd like to double check
  • There's a much better (safer, less impacting) fix where the formatter alone is updated. This reduces possible regressions and also makes review and testing (automation / manual) easier

Checklist needs filling out.

We should probably look into this when addressing non-expiring harv creds

@richard-cox richard-cox added this to the v2.12.0 milestone Jan 23, 2025
@m-ildefons
Copy link
Contributor Author

I agree, we need to look into this some more and make sure changing the model does not introduce a regression elsewhere, but I'm not convinced that a fix to the formatter alone is going to cut it.
The model conflates CloudCredentials that don't have an expiration date at all with CloudCredentials that are not expired and not about to expire.

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.

CloudCredential Expiry date is not shown
2 participants