Skip to content

Rename requirement state `archived` to `closed`

charlie ablett requested to merge 323779-archived-to-closed into master

What does this MR do?

Renames Requirement state archive to close in preparation for when Requirement becomes an Issue type.

In the GraphQL API, ARCHIVE is still an alias for searching and updating requirements.

Screenshots (strongly suggested)

Name Before After
Categories image image
Button & Tooltip image image
Successful close image image
Error on close image image

Updated queries

You can now use either CLOSED or ARCHIVED as requirement states on query/mutation input.

Searching by requirement state

query {
  project(fullPath: "group/project_path") {
    requirements(state: CLOSED) {
      nodes {
        title
        state
      }
    }
  }
}

Result will be

{
  "data": {
    "project": {
      "requirements": {
        "nodes": [
          {
            "title": "Ut enim ad minim veniam",
            "state": "CLOSED"
          }
        ]
      }
    }
  }
}

Updating

Using ARCHIVED this time:

mutation {
  updateRequirement(input: 
    { projectPath: "group/project_path",
      iid: "1", state: ARCHIVED }) {
    errors
    requirement {
      iid
      state
    }
  }
}

will result in

{
  "data": {
    "updateRequirement": {
      "errors": [],
      "requirement": {
        "iid": "1",
        "state": "CLOSED"
      }
    }
  }
}

The alias isn't 100%, since it will only ever return CLOSED. But for searching (as above), creating or updating, you can provide ARCHIVED.

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • 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 #323779 (closed)

Edited by charlie ablett

Merge request reports

Loading