Track jira import progress as in a separate data structure
Currently we are reusing
ProjectImportState to track import progress of Jira import. However it is also used by mirroring functionality. So if we would have a Jira imported project with moirroring enabled we would have situations where Jira import page would show up as in progress when actually mirroring is in progress.
We have a hacky way to prevent that, by storing a force-import: true flag when Jira import is triggered, but should rather have a separate way of tracking import progress per each Jira import.
We can also make this relationship as a one to many one
project to many
jira_imports and store import related information, like stats, and metadata: who ran the import, datetime, finished at, etc.
|project_id||integer||FK to gitlab
|status||integer||to track the import status, we can go with [scheduled, started, finished, failed] for starters|
|jid||string||the id of the sidekiq job running the import|
|jira_project_key||string||the jira project key the import is pulling from|
|jira_project_id||integer||while the key can theoretically change, the id is immutable|
|jira_project_name||string||basically for nice UI/UX|
|user_id||integer||Fk to gitlab users table, denoting the user that triggered the import|
|label_id||integer||Fk to gitlab labels table, so that we track which label was used to mark the imported issues|
|created_at||datetime||when the import was started/triggered|
|updated_at||datetime||when the import was started/triggered|
|finished_at||datetime||when import finished|
|total_issue_count||integer||total count of issues to be imported|
|imported_issues_count||integer||number of issues successfully imported|
|failed_to_import_count||integer||number of issues known to have failed to be imported|