Repository navigation
Conversation
Application, container, cronjob, lifecycle, helm and environment env create commands get a --override-if-exists flag that sets override_if_exists on POST /variable: when the key already exists at a higher scope, q-core creates an override instead of returning 409. CreateVariable errors now include the API's problem detail instead of the bare status line, so a 409 says which scope holds the key.
Guimove
marked this pull request as ready for review
October 22, 2026 09:58
Contributor
There was a problem hiding this comment.
1 issue found across 10 files
Confidence score: 5/5
- In
utils/env_var.go,CreateServiceExternalSecretstill hides API details, so conflicts don’t show which scope holds the key. ReturnwithAPIErrorDetail(err)for thisCreateVariablecall.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="utils/env_var.go">
<violation number="1" location="utils/env_var.go:210">
P2: `CreateServiceExternalSecret` still hides the API problem detail, so conflicts from external-secret creation do not identify the scope holding the key. Return `withAPIErrorDetail(err)` for this `CreateVariable` call as well.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Astach
approved these changes
Oct 22, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: QOV-2445
Related changes:
Adds
--override-if-existstoenv createfor application, container, cronjob, lifecycle, helm and environment. When set, the CLI sendsoverride_if_exists: trueon POST /variable (Qovery/qovery-openapi-spec#1237). If the key already exists at a higher scope (project or environment), q-core creates an override of it instead of returning 409. Projectenv createdoesn't get the flag, since nothing sits above a project. The field is only sent when the flag is set, so default requests are unchanged.CreateVariableerrors now include thedetailof the API's problem response. Before, a 409 printed only409 Conflict. Now it shows q-core's message naming the scope that holds the key.Blocked on the client bump. This needs
go get -u github.com/qovery/qovery-client-goonce Qovery/qovery-openapi-spec#1237 merges and the Go client is regenerated. CI fails until then (SetOverrideIfExistsis undefined in the published client).Tested: generated the Go client from the spec PR with openapi-generator 7.6.0 (the CI version), pointed go.mod at it with a temporary replace (not committed), then ran
go build ./...,go vet -tags testing ./...andgo test ./cmd/ ./utils/(270 passed). Checked the--helpoutput for application and environment.Summary by cubic
Adds
--override-if-existsto the application, container, cronjob, lifecycle, helm, and environmentenv createcommands so a variable whose key already exists at a higher scope creates an override instead of returning 409. The field is only sent when the flag is set; the projectenv createcommand is unchanged since nothing sits above a project.Variable and external secret creation errors now include the API's problem detail, so a 409 names the scope that already holds the key instead of showing only
409 Conflict.Blocked on a Go client regeneration: CI currently fails until
github.com/qovery/qovery-client-goships theSetOverrideIfExistsmethod.Written for commit 44d95e0. Summary will update on new commits.