Skip to content

Expose max_seats_used_changed_at attribute in namespace API

sameer shaik requested to merge add-maxseatschange into master

What does this MR do and why?

The attribute max_seats_used_changed_at, was added to the GitlabSubscription model with this MR - However, it was not exposed yet.

This MR exposes the max_seats_used_changed_at attribute in the namespace API, which helps users and support engineers to query the namespace details using API instead of using console for troubleshooting.

Screenshots or screen recordings

Before:

API: https://gitlab.com/api/v4/namespaces/NAMESPACE

{"id":5134392,"name":"NAMESPACE","path":"NAMESPACE","kind":"group","full_path":"NAMESPACE","parent_id":null,"avatar_url":"/uploads/-/system/group/avatar/78478347/faculty.png","web_url":"https://gitlab.com/groups/NAMESPACE","members_count_with_descendants":181,"shared_runners_minutes_limit":400,"extra_shared_runners_minutes_limit":167878,"additional_purchased_storage_size":0,"additional_purchased_storage_ends_on":null,"billable_members_count":213,"seats_in_use":213,"max_seats_used":213,"plan":"premium","trial_ends_on":null,"trial":false}

After:

It shows the max_seats_used_changed_at attribute:

{"id":178,"name":"NAMESPACE","path":"NAMESPACE","kind":"group","full_path":"NAMESPACE","parent_id":null,"avatar_url":null,"web_url":"http://localhost:3000/groups/NAMESPACE","members_count_with_descendants":2,"shared_runners_minutes_limit":null,"extra_shared_runners_minutes_limit":null,"additional_purchased_storage_size":0,"additional_purchased_storage_ends_on":null,"billable_members_count":2,"seats_in_use":2,"max_seats_used":2,"max_seats_used_changed_at":"2023-02-13T12:00:02.000Z","plan":"premium_trial","trial_ends_on":null,"trial":false}

How to set up and validate locally

Test this API: https://gitlab.com/api/v4/namespaces/NAMESPACE and notice that the max_seats_used_changed_at is not included in the response.

  1. Checkout this feature branch
  2. Test the https://gitlab.com/api/v4/namespaces/NAMESPACE
  3. The response includes max_seats_used_changed_at

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by sameer shaik

Merge request reports