Skip to content

Update legacy_open_source_license_available in before_update hook

What does this MR do and why?

legacy_open_source_license_available should be false for all the non-public projects.

In !88310 (merged), I missed some places where we need to set legacy_open_source_license_available to false. Whenever the project visibility changes we need to update the legacy_open_source_license_available to false. The project visibility could also get changed when the group/project is being transferred to another group that has a lower visibility level.

After this MR, if we don't have more non-public projects with legacy_open_source_license_available = true I'll reschedule the migration created in !88310 (merged) which should resolve https://gitlab.com/gitlab-org/gitlab/-/issues/353225#note_1016339139.

How to set up and validate locally

  1. Create a public project and set its legacy_open_source_license_available = true;
p = Project.find(<project-id>)
p.project_setting.legacy_open_source_license_available = true
p.save
  1. legacy_open_source_license_available should be changed to false when any of the following is done:
    • Project visibility is changed.
    • Public project is transferred to an internal or private group.
    • The public group containing the public project is transferred to an internal or private group.
  2. To transfer a project/group go to its settings and expand the advanced section and select the namespace where it has to be transferred.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #353225

Merge request reports

Loading