-
Josianne Hyson authored
In https://gitlab.com/gitlab-org/gitlab/-/merge_requests/31731 we are displaying the import status to the user. We need to be able to show the user that an import has been scheduled. As this happens asynchronously, the running of the job will likely happen after the request returns to the client. Currently our group import state is created in the job, but we need to create it before the job is triggered so that we can have an in progress import state when we return the HTTP request. If we create the import state after scheduling the job, we end up with a race condition between the job wanting to use the import state and the import state being created in the request. For this reason, we remove the requirement for the jid to be present. This also follows the same pattern that the ProjectImportState takes. This will also mean that if we fail to schedule an import job (no jid is returned) we can still mark the import as failed properly. MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33181 Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/211808
d352625b