Import SPDX licenses on a newly installed GitLab environment

Release notes

Problem to solve

we have a cron job 'ImportSoftwareLicensesWorker' that runs weekly for license compliance to get the SPDX catalog up to date.

if a user immediately runs and tries to use license compliance after install, they run into a poor experience (some licenses won't be identified.

Proposal

We need to import licenses after the installation of GitLab instance is completed. For production, development and test environment we should use 3 different approaches:

  • Step 0: Extract importing logic from Worker to Service

  • Step 1, Development: call this new Service in dev fixtures by adding a new fixture to db/fixtures/development

  • Step 2, Production: call this new Service in production fixtures by adding a new fixture to db/fixtures/production

  • Step 3, Test: if possible, run this service before the test for the license compliance feature. It's not recommended to import licenses before all tests because it will slow them down.

Edited by Tetiana Chupryna