Skip to content

Add new table: ci_minutes_additional_packs

Vijay Hawoldar requested to merge vij-add-ci-minutes-table into master

What does this MR do?

As part of &5715, we are implementing the foundation for a new way to provision CI minute purchases and improve the synchronization (and expiry) of those purchases between CustomersDot and GitLab.

This is step 1 of the process: adding a new table (and associated model) to track the data within GitLab. (customers-gitlab-com#2924 (closed))

For now, this new table and model will be unused.

The proposal that discusses the approach being taken here can be found documented here: https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/staging/doc/ci_minutes/provisioning_proposal.md#proposal

Database info

DB migration
bin/rails db:migrate

== 20210526135911 CreateCiMinutesAdditionalPacks: migrating ===================
-- create_table(:ci_minutes_additional_packs, {:if_not_exists=>true})
-- quote_column_name(:purchase_xid)
   -> 0.0000s
   -> 0.0128s
-- quote_table_name("check_d7ef254af0")
   -> 0.0000s
-- quote_table_name(:ci_minutes_additional_packs)
   -> 0.0000s
-- execute("ALTER TABLE \"ci_minutes_additional_packs\"\nADD CONSTRAINT \"check_d7ef254af0\" CHECK (char_length(\"purchase_xid\") <= 32)\n")
   -> 0.0013s
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:ci_minutes_additional_packs, [:namespace_id, :purchase_xid], {:name=>"index_ci_minutes_additional_packs_on_namespace_id_purchase_xid", :algorithm=>:concurrently})
   -> 0.0019s
-- execute("SET statement_timeout TO 0")
   -> 0.0005s
-- add_index(:ci_minutes_additional_packs, [:namespace_id, :purchase_xid], {:name=>"index_ci_minutes_additional_packs_on_namespace_id_purchase_xid", :algorithm=>:concurrently})
   -> 0.0021s
-- execute("RESET ALL")
   -> 0.0005s
== 20210526135911 CreateCiMinutesAdditionalPacks: migrated (0.0298s) ==========
DB rollback
bin/rails db:rollback

== 20210526135911 CreateCiMinutesAdditionalPacks: reverting ===================
-- drop_table(:ci_minutes_additional_packs)
   -> 0.0046s
== 20210526135911 CreateCiMinutesAdditionalPacks: reverted (0.0171s) ==========

Screenshots (strongly suggested)

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