-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[usage] Use workspaceClass displayName in Usage view #14327
Conversation
started the job as gitpod-build-lau-credits-info-13362.2 because the annotations in the pull request description changed |
@@ -81,6 +90,10 @@ function UsageView({ attributionId }: UsageViewProps) { | |||
return "Prebuild"; | |||
}; | |||
|
|||
const getDisplayName = (workspaceClass: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should show the workspaceClass
as a fallback when the workspace class is no longer defined. The usage records go very far back in time so it's possible a class no longer exists when we're looking at usage history.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
57ebff1
to
d8b9fe1
Compare
/hold for Q |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this fixes the issue, it does result in reliance on the supportedClasses
call. This is not a problem in itself, but if someone wanted to consume the API, and get all of the data, they wouldn't now have the display name populated.
It would be nice to also extend the UsageRecords response to include the supported class there. This would involve populating it when we read out the usage records from the DB, or even populating those in the DB at the time of usage record creation.
Is it possible to maybe show the ID as a tooltip of the workspace class? Or somehow show both the WorkspaceClassID and the WorkspaceClassName? We use the ID in other places so I expect it should remain accessible somehow. CC @gtsiolis
Thanks for the 👍🏼 @easyCZ!
These are good nudges and also invites a bigger question for me: what consistency would we like to show the user? As you correctly linked the Meanwhile I will unhold as this decision is not a blocker for the PR, and we can have follow-up issues from here. /unhold |
Thanks for the ping @easyCZ! 🏓 Some thoughts:
|
Description
This uses the
displayName
instead of theid
Note: This shows `Default` because it's using the preview env config.
Related Issue(s)
Relates #13362
How to test
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide