Add description optional field for Ci::Variable
Ref: #409641 (closed)
What does this MR do and why?
This MR adds a description (optional) field allowing users to better describe the use of a given key.
This field is available at the Project and Group Ci::Variable
level.
Screenshots or screen recordings
How to set up and validate locally
- Generate a PAT
http://gdk.test:3000/-/profile/personal_access_tokens
- Create a new variable with a description
curl --request POST --header "PRIVATE-TOKEN: <PERSONAL_ACCESS_TOKEN>" "http://gdk.test:3000/api/v4/projects/<PROJECT_ID>/variables" --form "key=NEW_VARIABLE" --form "value=new value" --form "description=description"
- Verify the variable has been created correctly
REST API
curl --header "PRIVATE-TOKEN: <PERSONAL_ACCESS_TOKEN>" "http://gdk.test:3000/api/v4/projects/<PROJECT_ID>/variables/NEW_VARIABLE"
GraphQL API
query {
project(fullPath: "namespace1/project-1") {
ciVariables {
nodes {
key
value
description
}
}
}
}
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.
Edited by Max Orefice