Skip to content

Disable ultimate features for public projects with no issues and no repo

What does this MR do and why?

Disable ultimate features for public projects with no issues and no repo

Query plan

https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/11126/commands/39866

Sample raw query
UPDATE "project_settings"
SET "legacy_open_source_license_available" = FALSE
WHERE "project_settings"."project_id" IN (SELECT "projects"."id"
                                          FROM "projects"
                                                   LEFT OUTER JOIN project_statistics ON project_statistics.project_id = projects.id
                                                   LEFT OUTER JOIN project_settings ON project_settings.project_id = projects.id
                                                   LEFT OUTER JOIN issues ON issues.project_id = projects.id
                                          WHERE "projects"."id" BETWEEN 10000 AND 15000
                                            AND "projects"."visibility_level" = 20
                                            AND "projects"."id" >= 10000
                                            AND "projects"."id" < 10200
                                            AND "project_statistics"."repository_size" = 0
                                            AND "project_settings"."legacy_open_source_license_available" = TRUE
                                          GROUP BY "projects"."id"
                                          HAVING (COUNT(issues.id) = 0))

Migration output

up

bin/rails db:migrate:up:main VERSION=20220722084543
WARNING: This version of GitLab depends on gitlab-shell 14.10.0, but you're running 14.9.0. Please update gitlab-shell.
main: == 20220722084543 ScheduleDisableLegacyOpenSourceLicenseForNoIssuesNoRepoProjects: migrating
main: == 20220722084543 ScheduleDisableLegacyOpenSourceLicenseForNoIssuesNoRepoProjects: migrated (0.0006s)

down

bin/rails db:migrate:down:main VERSION=20220722084543
WARNING: This version of GitLab depends on gitlab-shell 14.10.0, but you're running 14.9.0. Please update gitlab-shell.
main: == 20220722084543 ScheduleDisableLegacyOpenSourceLicenseForNoIssuesNoRepoProjects: reverting
main: == 20220722084543 ScheduleDisableLegacyOpenSourceLicenseForNoIssuesNoRepoProjects: reverted (0.0005s)

MR acceptance checklist

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

Closes #354153

Edited by Abdul Wadood

Merge request reports

Loading