Add Ci::InstanceVariable schema and model
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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