Skip to content

Fix project name duplicates and missing project namespace ids

What does this MR do and why?

This MR fixes a few remaining projects(~600) without a project namespace after the project namespace backfilling MR !77371 (merged) The remaining projects did not get a corresponding project namespace because of an existing unique constraint on namespaces table "index_namespaces_name_parent_id_type" UNIQUE, btree (name, parent_id, type), which does not have a corresponding constraint on projects table, so creating a corresponding namespace record that would retain project name, path and namespace_id would fail.

Ideally it should not be possible to have projects with same name or path within same namespace as that at very least creates confusion and at worst makes all projects with duplicate path redirect to single project.

This MR fixes the projects with duplicate name by appending project#id to the name of the project and also fixes the duplicate path to correspond to the recorded routes#path that is enforced to be unique.

re #356779 (closed)

Requirement

  • this migration timestamp 20220324081709 should be after !82176 (merged) which is 20220322071127 As the migration relies on projects with project_namespace_id: null to fix the remaining failing projects without a project namespace

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

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

Edited by Alexandru Croitor

Merge request reports

Loading