feat(variable): [QOV-2445] add override_if_exists to VariableRequest
Jira: QOV-2445
Related changes:
- q-core: https://gitlab.com/qovery/backend/q-core/-/merge_requests/4207
- OpenAPI: https://github.com/Qovery/qovery-openapi-spec/pull/1237
- Console: https://github.com/Qovery/console/pull/3141
- CLI: https://github.com/Qovery/qovery-cli/pull/747
Repo: qovery-openapi-spec
Adds an optional override_if_exists boolean (nullable, default false) to VariableRequest, the body of POST /variable.
Today, creating a variable whose key already exists at the project or environment scope returns 409, and the caller has to create an OVERRIDE variable separately. With override_if_exists: true, the API creates the override instead. The usual override rules still apply: same secret kind, the target must be a value or file variable, and the new variable must sit at a strictly lower scope. The implementation lands in q-core.
The createVariable description now mentions the 409 and the flag, and the operation lists a 409 response, which q-core already returns but the spec did not declare.
No breaking change: the field is optional and defaults to the current behavior.
Testing: spectral 6.5.1 with the built-in spectral:oas ruleset gives 0 errors and the same 244 warnings as main. npm test cannot run because the Stoplight ruleset that .spectral.mjs imports returns 404.
Summary by cubic
Adds an optional override_if_exists flag to VariableRequest so POST /variable can create an override of a higher-scope variable instead of returning 409.
- When
override_if_existsis true and a variable with the same key exists at a project or environment scope, the API creates the override rather than failing with 409; the usual override rules apply (same secret kind, value or file target, strictly lower scope). - Updates the
createVariabledescription and declares the409response in the spec; no breaking change since the field defaults to the current behavior.