Allow group import states to be created without job ID
What does this MR do?
This is part of !31731 (merged) but needs to be deployed first as the code in that MR relies the null constraint being removed.
We need to remove this constraint as there is the state where the import has been created
, but not yet scheduled
so we do not have a jid
yet. When the import is created, we want to be able to show a loading screen to the user and we cannot rely on the job creating the record in time as this is performed async.
rails db:migrate:up VERSION=20200526142550
== 20200526142550 DropNullConstraintOnGroupImportStateJid: migrating ==========
-- change_column_null(:group_import_states, :jid, true)
-> 0.0009s
== 20200526142550 DropNullConstraintOnGroupImportStateJid: migrated (0.0009s) =
rails db:migrate:down VERSION=20200526142550
== 20200526142550 DropNullConstraintOnGroupImportStateJid: reverting ==========
== 20200526142550 DropNullConstraintOnGroupImportStateJid: reverted (0.0000s) =
Database Labs
Result of running in #database-labs
exec ALTER TABLE "group_import_states" ALTER COLUMN "jid" DROP NOT NULL;
The query has been executed. Duration: 49.000 ms (edited)
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