Skip to content

Replace pages_migration_mark_as_not_deployed feature flag with env variable [RUN ALL RSPEC] [RUN AS-IF-FOSS]

What does this MR do?

Currently, we just report errors if we try to migrate pages project but pages public directory is absent on disk. And if this feature flag is set, we simply mark project as not deployed.

Most likely our users will want to set this feature flag to true, but FF isn't a very convenient way to do that.

So we're replacing it with the env variable, and running pages migration task looks like:

vlad @ gdk1 ➜  gitlab git:(295187-roll-out-pages_migration_mark_as_not_deployed-feature-flag) ✗  PAGES_MIGRATION_MARK_PROJECTS_AS_NOT_DEPLOYED=true ./bin/rake gitlab:pages:migrate_legacy_storage
I, [2021-03-09T17:20:53.428648 #2570977]  INFO -- : Starting to migrate legacy pages storage to zip deployments
I, [2021-03-09T17:20:53.470758 #2570977]  INFO -- : Waiting for threads to finish...
I, [2021-03-09T17:20:54.043687 #2570977]  INFO -- : project_id: 11 /home/vlad/gdk/gitlab/shared/pages/norbert/underscore has been migrated in 0.04 seconds: Invalid or missing public directory at /home/vlad/gdk/gitlab/shared/pages/norbert/underscore. Corrected project to be not deployed
I, [2021-03-09T17:20:54.053894 #2570977]  INFO -- : project_id: 1 /home/vlad/gdk/gitlab/shared/pages/gitlab-org/gitlab-test has been migrated in 0.03 seconds: Invalid or missing public 

...

I, [2021-03-09T17:20:54.591732 #2570977]  INFO -- : 34 projects are migrated successfully, 0 projects failed to be migrated
I, [2021-03-09T17:20:54.592259 #2570977]  INFO -- : A total of 34 projects were processed.
I, [2021-03-09T17:20:54.592325 #2570977]  INFO -- : - The 34 projects migrated successfully
I, [2021-03-09T17:20:54.592349 #2570977]  INFO -- : - The 0 projects failed to be migrated

I'm afraid of simply making this FF on by default or removing it because if you run pages migration task on an empty pages shared directory(e.g. you didn't configure NFS, but created directory) it may mark all projects as not deployed.

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #295187 (closed)

Edited by Kamil Trzciński

Merge request reports