Skip to content

Add Confidential Attribute to CreateTestCase Mutation

What does this MR do and why?

Relates to #422117 (closed)

As part of &11229 (closed), we will be adding support for creating and editing confidential test cases in the UI.

While test cases will be migrated to the work items framework mid-next year, this is an interim solution to help enable the Quality team to manage test cases within a single source of truth for ongoing confidential projects.

This MR updates the CreateTestCase GraphQL mutation to accept a confidential attribute, which will eventually be used by Add Confidentiality Checkbox to New Test Case Form (#422121 - closed). This mutation is currently used by the frontend when creating new test cases in a project. The underlying service used by this mutation is Issues::CreateService, which already supports confidentiality.

How to set up and validate locally

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

Creating a Test Case via UI:

  1. Check out the branch for this MR to your local machine
  2. Ensure you have an Ultimate license available on your GDK
  3. Create a new group and project
  4. In the project, go to Build > Test cases
  5. Click on the "New test case" button
  6. Create a new test case
  7. Verify no regressions occur and test case will currently save as non-confidential

Creating a Test Case via GraphQL:

  1. Check out the branch for this MR to your local machine
  2. Login as a member with reporter access or above for the project you previously created
  3. Go to http://<your gdk url>/-/graphql-explorer
  4. Add the following for the mutation:
mutation createTestCase($createTestCaseInput: CreateTestCaseInput!) {
  createTestCase(input: $createTestCaseInput) {
    errors
    testCase {
      confidential
    }
  }
}
  1. Add the following for the query variables:
{
  "createTestCaseInput": {
    "projectPath": "<full path of your project, ex: group-a/project-a>",
    "confidential": true,
    "description": "Test confidentiality",
    "title": "Confidential Test"
  }
}
  1. Click the execute "play button" to send the mutation
  2. Check in your project test cases and verify you have a confidential test case (please note, the confidential icon next to the test case title will be added in #422119 (closed))
  3. Now login as a user who is not a project member or is a guest of the project
  4. Attempt to view the test case, verify you are taken to a 404 page

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 Valerie Burton

Merge request reports