Skip to content

Refactor the Ci::Minutes::Additional pack service and API

Vijay Hawoldar requested to merge vij-ci-minute-pack-array into master

What does this MR do?

We need to support the syncing of multiple CI minutes packs from our CustomersDot application to GitLab.

This MR seeks to achieve this by:

  1. Update the POST endpoint to accept an array of new packs
  2. Update the CreateService to create multiple packs

It's worth noting that this endpoint / service is an internal API and currently un-used as the feature is still in development.

An MR for the docs update can be found here: !67606 (merged)

Relates to customers-gitlab-com#2925 (closed)

How to setup and validate locally (strongly suggested)

curl --request POST \
  --url http://127.0.0.1:3000/api/v4/namespaces/:id/minutes \
  --header 'Content-Type: application/json' \
  --header 'PRIVATE-TOKEN: <your token>' \
  --data '{
        "packs": [
	  "number_of_minutes": 123,
	  "expires_at": "2022-01-01",
	  "purchase_xid": "123abc" 
        ]
  }'

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Vijay Hawoldar

Merge request reports