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:
- Check out the branch for this MR to your local machine
- Ensure you have an Ultimate license available on your GDK
- Create a new group and project
- In the project, go to Build > Test cases
- Click on the "New test case" button
- Create a new test case
- Verify no regressions occur and test case will currently save as non-confidential
Creating a Test Case via GraphQL:
- Check out the branch for this MR to your local machine
- Login as a member with reporter access or above for the project you previously created
- Go to
http://<your gdk url>/-/graphql-explorer
- Add the following for the mutation:
mutation createTestCase($createTestCaseInput: CreateTestCaseInput!) {
createTestCase(input: $createTestCaseInput) {
errors
testCase {
confidential
}
}
}
- 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"
}
}
- Click the execute "play button" to send the mutation
- 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))
- Now login as a user who is not a project member or is a guest of the project
- 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.
-
I have evaluated the MR acceptance checklist for this MR.