Add GroupImportState to group imports
What does this MR do?
This MR adds Group Import state created/started/finished/failed
in order to better understand group import's process.
It is going to be utilized in:
- Group Import API - similar to Import status for projects https://docs.gitlab.com/ee/api/project_import_export.html#import-status
- Group Import UI - again, similar to Projects, when importing a group, the UI is going to shown
Import In Progress
until import is complete
I've added it as a has-many association, however it's impossible to re-initiate the import into the same group, as the way import works - it always creates a brand new group from scratch and then restores relations into it. It's a has-many association for potential future adjustments. I've added unique index on group_id and state to prevent multiple imports with the same state.
Project Import on the other hand is a has-one association with project_import_state, where the same row is being altered https://gitlab.com/gitlab-org/gitlab/blob/georgekoltsov/add-group-import-state/app/models/project_import_state.rb#L56-56 and erasing history.
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