Rake task to migrate authentications log to job token allowlist
As part of Provide mechanism to migrate authentications lo... (#478540 - closed), I've created this issue to determine the functional requirements of the rake task to migrate authentications log to job token allowlist.
From the linked issue:
The rake task would be used to enforce the opt-in logic described above for all projects without enabled allowlist. The targeted persona for this is GitLab admin. The script can optionally take in input a range of project ids if we want to batch it or run it in chunks. It writes to a log file that can be used to understand where we were at, in case it fails.
However, since the script filters out projects with enabled allowlist, it means it's idempotent and we can restart it if it fails.
It can potentially take in input a list of projects to ignore, if any of them is problematic to auto-populate. This list could alternatively be read from a file (to support many entries). Problematic projects can be handled separately, manually or by having Support working directly with the customer.
Based on these notes, I've derived the following requirements:
- The rake task is intended to be run instance-wide by administrators.
- It will take two optional input parameters:
only_project_ids, andexclude_project_ids.only_project_idswill only run the migration for projects in the given list of ids.exclude_project_idswill run the migration for all projects except those in the given list of ids.
- If neither parameters is supplied, it will run for all projects that do not have allowlist enforcement enabled.
- If both params (
only_project_idsandexclude_project_ids) are supplied the task will fail to start and raise an error. - Once a project has been migrated, it will enable enforcement for that project.
- It should write to the terminal and a log file to document each action it takes, and log any exceptions if it fails.
- If a project fails to migrate, all the changes will be rolled back and a log entry will be written to indicate that the project failed to migrate.
@fabiopitino @jocelynjane @shampton any suggestions or changes to list of requirements?