Skip to content

Allow group import states to be created without job ID

Josianne Hyson requested to merge jh-drop_jid_null_constraint into master

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

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 🤖 GitLab Bot 🤖

Merge request reports

Loading