Loading
Add Save and Remove mutation wiring to UserOverridesList
What does this MR do and why?
Wire up the Save button in UserOverridesList using the UpsertUserBudgetCapOverrides GraphQL mutation. Admins can now edit per-user AI credit cap overrides directly from the table and persist changes.
MR series
| # | MR | Status |
|---|---|---|
| 1 |
Add UserOverridesList component with data fetching and pagination |
|
| 2 | ||
| 3 | Add Save and Remove mutation wiring to UserOverridesList |
Screenshots or screen recordings
| Before | After |
|---|---|
| N/A | ![]() |
| N/A | ![]() |
How to set up and validate locally
Prerequisites: self-managed GitLab instance with the Credits Dashboard enabled.
- Enable SM instance.
- Open
/-/graphql-explorerand find some user Global IDs:
query {
users {
nodes {
id
name
username
}
}
}- Create a per-user cap override for the found users (you can use
gid://gitlab/User/1for admin):
mutation ($overrides: UpsertUserBudgetCapOverridesInput!) {
upsertUserBudgetCapOverrides(input: $overrides) {
userOverrides {
cap
capEnabled
user { username }
}
errors
}
}with variables:
{
"overrides": {
"overrides": [
{
"userId": "gid://gitlab/User/1",
"cap": 20,
"enabled": true
}
]
}
}- Open
http://localhost:3000/admin/gitlab_credits_dashboard/credit_caps. - Verify that override rows appear in the table with editable cap input and enabled toggle.
- Change the cap value or toggle, click Save, and verify:
- A success toast appears.
- The button shows a loading spinner while the request is in flight.
- Inputs are disabled during save.
- To test error handling, temporarily make the mutation return an error (e.g., edit input min=0 to min=-100 and pass a negative value) and verify an inline error alert appears beneath the row.
Alternatively, via Storybook:
- Start Storybook:
yarn storybook:start - Verify these stories work:
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
References
Edited by Kos Palchyk

