Skip to content

[admin][UBP] Grant free credits to users in admin dashboard #14591

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

Closed
jldec opened this issue Nov 10, 2022 · 19 comments · Fixed by #14594
Closed

[admin][UBP] Grant free credits to users in admin dashboard #14591

jldec opened this issue Nov 10, 2022 · 19 comments · Fixed by #14594
Assignees
Labels
feature: billing team: webapp Issue belongs to the WebApp team

Comments

@jldec
Copy link
Contributor

jldec commented Nov 10, 2022

Admins should be able to grant additional credits to users E.g. to unblock their usage if they had out-of-control prebuilds before switching to UBP.

Example here (internal)

@jldec
Copy link
Contributor Author

jldec commented Nov 10, 2022

A reasonable option would be to reset the clock on their free tier so that they start with a fresh 500 credits.

@svenefftinge
Copy link
Member

We should allow admins to do these things:

  • Add usage entries to adjust the current credit balance in both directions.
    • they need a special usage kind as well as a mandatory description and userId of the admin.
  • Adjust spending limit of cost-center
  • See usage

@jldec What is the order in which you want to see this in production?
@gtsiolis We need design input on how to switch between different admin areas per team detail (currently we have one page where we list the members).

@jldec
Copy link
Contributor Author

jldec commented Nov 11, 2022

@svenefftinge priorities from product side are:

  1. unblock users who hit their limit due to unforeseen reasons like runaway prebuilds - this is probably best done by adjusting the credit balance, but could also be done with a temporary usage limit bump.
  2. grant a permanent increase/decrease in free tier usage limit e.g. for open source maintainers.
  3. see current total usage, credit limit, next reset date
  4. see detailed usage (workspace sessions)

@svenefftinge
Copy link
Member

Unassigning myself, because we need input from @gitpod-io/product-design

@svenefftinge
Copy link
Member

Also see #14367

@svenefftinge svenefftinge changed the title [UBP] Grant free credits to users in admin dashboard [admin][UBP] Grant free credits to users in admin dashboard Nov 14, 2022
@svenefftinge svenefftinge self-assigned this Nov 14, 2022
@jldec
Copy link
Contributor Author

jldec commented Nov 15, 2022

From discussion with @gtsiolis

  • Action uses standard hypertext link in admin view to grant extra credits
  • Trigger modal form with action/cancel buttons
  • Requires a "reason" to be entered by the admin
  • Free tier, individual plans only
  • One time grant only - entered into ledger
  • Enter amount (typically 100 or 200)
  • Effect will be to reduce "Credits Used" (number should decrease after)
  • nice to have: don't allow granting more than current usage (avoid negative result)
  • future enhancement: show extra credit grant in the billing or usage view

Alternative approach (if easier):
Instead of subtracting from credits used, add to usage limit temporarily (reset at the end of the period)

NOTE: This credit grant mechanism may be suboptimal if the period is about to be reset, since unused free credits expire at the end of each cycle when the balance used goes back to 0.

@gtsiolis
Copy link
Contributor

Adding below some visuals to help with the implementation. Cc @svenefftinge @jldec

User (Data) User (Modal)
User User-1

FWIW:

Link Button Dropdown (Single Entry) Dropdown (Multiple Entries)
User-2 User-3 User-4

See design specs.

@jimmybrancaccio
Copy link

This looks super cool @gtsiolis! 🧡 The only suggestion I have is to show the full "audit log" entry instead of an excerpt. Perhaps make the log element or 'container' the same width as the 2 elements above it (balance used and cycle resets).

@gtsiolis
Copy link
Contributor

gtsiolis commented Nov 15, 2022

Thanks @jimmybrancaccio! 🏇

Indeed, surfacing all the information sounds better. I deliberately added this with the text delimiter as this could out of the scope of this iteration.

Alternatively, using a tooltip for the full note entry could be nice, as long as a user can hover and click any links inside the note. In any case, it could be interesting to also enforce a max character limit so that notes don't span much. This way we could surface all the note. Additionally, using a larger width for the dropdown could help.

Full log entries with more details could be later on surfaced in #11469.

@jimmybrancaccio
Copy link

@gtsiolis Tooltip would be great. Not having the full entry could make this somewhat pointless especially if the more useful information is at the end of the log entry which ends up getting truncated. If we do initially launch this with the log entry truncated we should make sure that anyone who leaves notes knows to put the important content first so it doesn't get truncated.

@gtsiolis
Copy link
Contributor

gtsiolis commented Nov 16, 2022

@jimmybrancaccio Thinking about this again, I'd a) avoid the tooltip, b) increase dropdown width, c) use scrollable fixed-height dropdown as we do with workspace changes so that all information can be accessed for the first iteration. 🛹

Additionally, we can let users be conscious about this field by adding a placeholder text to prompt them for a short note or restrict the max length of the note to scale better in the UI. Cc @jldec @svenefftinge

@svenefftinge
Copy link
Member

The credit notes would end up as a usage entry. So I propose we just show the whole usage data in a list.
WDYT of adding a tab on top of the workspaces list (members for teams) and add a tab "usage"?

@jldec
Copy link
Contributor Author

jldec commented Nov 17, 2022

@svenefftinge I agree with having a separate usage detail list view, but I would split that out and try to finish the credit adjust first.

I have created 2 issues for followup.

cc: @gtsiolis

@svenefftinge
Copy link
Member

Sure, I meant to say that I will not add the dropdown part that @gtsiolis and @jimmybrancaccio were talking about.

@gtsiolis
Copy link
Contributor

gtsiolis commented Nov 17, 2022

Sounds good, @svenefftinge!

The credit notes would end up as a usage entry.

Do we need any designs for this yet? We may also need to inform** admins that their submitted information on the note will be visible to team owners, or any other with access to team usage, right?

** by using the note placeholder or help text, or the alert on the modal.

@svenefftinge
Copy link
Member

Do we need any designs for this yet? We may also need to inform** admins that their submitted information on the note will be visible to team owners, or any other with access to team usage, right?

Yes & Yes! 😅

@gtsiolis
Copy link
Contributor

On it. ✋

@gtsiolis
Copy link
Contributor

gtsiolis commented Nov 17, 2022

I'm adding below another iteration of the designs taking into account the comment above in #14591 (comment). Feedback is welcome!

Cc @svenefftinge @jldec

Add Credits note (Diff: Rephrased 🅰️ alert and 🅱️ help text)
User

For surfacing this information, I tried adding the credit notes as a usage entry and include the whole information or a generic text.

Usage entry (full text) Usage entry (generic text)
UsageNote UsageNote-1

Alternatively, we could use the billing page as the single source of truth so that it's easier for users to understand why they may be seeing a difference in the balance used, etc.

Billing (link button) Billing (dropdown)
Team Plans Team Plans-1

@geropl geropl moved this from Scheduled to In Progress in 🍎 WebApp Team Nov 18, 2022
@jimmybrancaccio
Copy link

Looks great @gtsiolis! How would one see the credit notes for all time? I see it looks like the dropdown would only show the notes from the current billing cycle?

Repository owner moved this from In Progress to In Validation in 🍎 WebApp Team Nov 22, 2022
@svenefftinge svenefftinge moved this from In Validation to Done in 🍎 WebApp Team Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: billing team: webapp Issue belongs to the WebApp team
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants