Skip to content

feat(variable): [QOV-2445] add override_if_exists to VariableRequest - #1237

Open
Guimove wants to merge 1 commit into
mainfrom
feat/variable-override-if-exists
Open

Guimove wants to merge 1 commit into
mainfrom
feat/variable-override-if-exists

Conversation

@Guimove

@Guimove Guimove commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Jira: QOV-2445

Related changes:

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_exists is 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 createVariable description and declares the 409 response in the spec; no breaking change since the field defaults to the current behavior.

Written for commit 5bd95ab. Summary will update on new commits.

View guided diff Turn on auto-fix

Lets POST /variable create an override of a higher-scope variable with the same key instead of returning 409. Also documents the 409 on createVariable.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

View guided diff | Turn on auto-fix | Re-trigger cubic

@Guimove Guimove changed the title feat(variable): add override_if_exists to VariableRequest feat(variable): [QOV-2445] add override_if_exists to VariableRequest Oct 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants