Skip to content

Do not create requirements with deprecated attributes

What does this MR do and why?

This is part of stage IV of the plan to deprecate old requirements.

Now that all requirements are work items and only acts as a proxy to keep API endpoints and iids backward compatible, we can stop saving values to not used columns on the requirements table. To do that we can remove RequirementsManagement::CreateRequirementService and replace it with Issues::CreateService where we also create the proxy requirement object inside a transaction. There are a couple of places that were still using CreateRequirementService, both should be deprecated soon but we still need them because of our deprecation policy:

  • Graphql mutation CreateRequirement
  • RequirementsManagement::ImportCsvService

Minor changes were needed to specs because the current behavior did not change.

related to #361990 (closed)

How to set up and validate locally

Testing the old Graphql endpoint

  1. Make sure you have EE ultimate license on your localhost
  2. Create a requirement using the old GraphQL endpoint, for example:
mutation OldCreateRequirement {
  createRequirement(input: {
    projectPath: "flightjs/Flight",
    title: "Created from old endpoint",
    description:"any description"
  }) {
    requirement {
      title
      description
    }
  }
}
  1. Open rails console and check if RequirementsManagement::Requirement.last does not have title and description saved in database

Testing the CSV import

  1. Go to requirements page
  2. Create some requirements and export them as CSV
  3. Import that same file from previous step in a new project

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 Felipe Artur

Merge request reports