Skip to content

Draft: Project model should require organization

What does this MR do and why?

As per #443857, we're:

  • removing the default organization on the Project level,
  • adding NOT NULL constraint on the organization_id

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before

> project = Project.new
=> #<Project id: >>
> project.organization
=> #<Organizations::Organization:0x000000029971e5d0 id: 1, ..., name: "Default", path: "default", visibility_level: 20>

After

> project = Project.new
=> #<Project id: >>
> project.organization
=> nil
> project.valid?
=> false

How to set up and validate locally

  1. Checkout the branch
  2. Run migrations
  3. Verify that
    • project doesn't have default organization, and
    • project requires organization to be explicitly defined! 🎉

Related to #443857

Edited by Bojan Marjanovic

Merge request reports