Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab
GitLab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 34,922
    • Issues 34,922
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1,228
    • Merge Requests 1,228
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #251113

Closed
Open
Opened Sep 18, 2020 by Max Woolf@mwoolf🔵Developer

Refactor ComplianceFramework::FRAMEWORKS to ActiveRecord Model

This is one of the issues required to implement #231247 (closed) entirely.

Problem to solve

Currently, a project can have a compliance framework set in the form of ComplianceManagement::ComplianceFramework::ProjectSetting being associated to a Project.

The framework attribute on this object is a hard-coded set of common compliance frameworks defined in ComplianceManagement::ComplianceFramework::FRAMEWORKS.

To achieve the outcome in this issue, we need to refactor the backend to allow the ability for custom frameworks to be added. This needs to be backwards-compatible and not affect existing projects which may already have one of these pre-defined compliance frameworks associated with it.

Proposal

  1. Create a new ActiveRecord model to represent the custom "compliance framework labels" that will be created at the "root group" level.
  2. For each root group, create one "compliance framework label" record for each unique label name used by that group's projects (so there would be no more than 5 records created for each root group, because there were only 5 default labels).
  3. Replace the project_compliance_framework_settings.framework enum values with a foreign key relation to the newly-created "compliance framework label" record.

Note: This lays the foundation for the ability to create/update/delete labels, which will be implemented under #231247 (closed).

Edited Oct 01, 2020 by Dan Jensen
Assignee
Assign to
13.6
Milestone
13.6 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: gitlab-org/gitlab#251113