Skip to content

Add Ci::InstanceVariable schema and model

Marius Bobin requested to merge 14108-instance-level-ci-variables into master

What does this MR do?

related to #14108 (closed)

This is the first MR for adding global (instance-level) variables for CI builds.

This MR adds the model class and database migration.

VERSION=20200422091541 bin/rake db:migrate:up

== 20200422091541 CreateCiInstanceVariables: migrating ========================
-- table_exists?(:ci_instance_variables)
   -> 0.0004s
-- create_table(:ci_instance_variables)
   -> 0.0076s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE ci_instance_variables\nADD CONSTRAINT check_5aede12208\nCHECK ( char_length(key) <= 255 )\nNOT VALID;\n")
   -> 0.0005s
-- execute("SET statement_timeout TO 0")
   -> 0.0001s
-- execute("ALTER TABLE ci_instance_variables VALIDATE CONSTRAINT check_5aede12208;")
   -> 0.0004s
-- execute("RESET ALL")
   -> 0.0001s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE ci_instance_variables\nADD CONSTRAINT check_5ebd0515a0\nCHECK ( char_length(encrypted_value) <= 1024 )\nNOT VALID;\n")
   -> 0.0003s
-- execute("SET statement_timeout TO 0")
   -> 0.0001s
-- execute("ALTER TABLE ci_instance_variables VALIDATE CONSTRAINT check_5ebd0515a0;")
   -> 0.0004s
-- execute("RESET ALL")
   -> 0.0002s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE ci_instance_variables\nADD CONSTRAINT check_07a45a5bcb\nCHECK ( char_length(encrypted_value_iv) <= 255 )\nNOT VALID;\n")
   -> 0.0003s
-- execute("SET statement_timeout TO 0")
   -> 0.0002s
-- execute("ALTER TABLE ci_instance_variables VALIDATE CONSTRAINT check_07a45a5bcb;")
   -> 0.0004s
-- execute("RESET ALL")
   -> 0.0001s
== 20200422091541 CreateCiInstanceVariables: migrated (0.0201s) ===============

VERSION=20200422091541 bin/rake db:migrate:down

== 20200422091541 CreateCiInstanceVariables: reverting ========================
-- drop_table(:ci_instance_variables)
   -> 0.0034s
== 20200422091541 CreateCiInstanceVariables: reverted (0.0034s) ===============

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • 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 Yorick Peterse

Merge request reports