Skip to content

fix: .env variables pushed to the wrong project when deploy hits a name collision#9699

Open
nishantmonu51 wants to merge 1 commit into
mainfrom
deploy_env_fix
Open

fix: .env variables pushed to the wrong project when deploy hits a name collision#9699
nishantmonu51 wants to merge 1 commit into
mainfrom
deploy_env_fix

Conversation

@nishantmonu51

Copy link
Copy Markdown
Collaborator
  • When the requested project name already exists in the org, DeployProject retries CreateProject with a numeric suffix (e.g. my-projectmy-project-1), but the follow-up UpdateProjectVariables call still targeted the originally requested name.
  • As a result, the local .env (typically connector credentials) overwrote the variables of the unrelated pre-existing project, while the newly created project received no variables at all — so its deployment can't connect to its sources.
  • Fix: push the variables to the org/name returned by CreateProject (the project actually created), matching what RedeployProject already does.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

When the requested project name already exists in the org, CreateProject
retries with a numeric suffix (e.g. my-project-1), but the subsequent
UpdateProjectVariables call still targeted the originally requested name.
The local .env then overwrote the variables of the unrelated pre-existing
project, while the newly created project received no variables at all.

Use the org and name from the CreateProject response instead,
matching what RedeployProject already does.
@nishantmonu51

Copy link
Copy Markdown
Collaborator Author

@codex: review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: d05969019e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant