posit-dev / publisher

MIT License
6 stars 1 forks source link

Show error and disable deployment when environment and secrets have duplicates #2338

Closed dotNomad closed 1 month ago

dotNomad commented 2 months ago

This PR adds a new error that disables deployment - similar to a missing credential error in style - when there are names shared in Environment and Secrets in the selected Configuration.

Preview ![CleanShot 2024-10-01 at 16 15 42@2x](https://github.com/user-attachments/assets/ca031207-58b6-4660-8a40-538c185f9b64) ![CleanShot 2024-10-01 at 16 15 30@2x](https://github.com/user-attachments/assets/30ab36c8-72fb-41a4-b50b-8314633fe03c)

The duplicated names are present in the error to make it easier to resolve, along with a link to edit the configuration similar to other errors.

Intent

Resolves #2326

Type of Change

sagerb commented 2 months ago

@dotNomad The work you've done here definitely overlaps/conflicts with the work in https://github.com/posit-dev/publisher/pull/2331. We should discuss how we'll move forward and resolve this.

Issue has been resolved!

dotNomad commented 1 month ago

We should discuss how we'll move forward and resolve this.

We could merge this prior since it is a relatively simpler change, and componentize it with the other work.

kgartland-rstudio commented 1 month ago

Verified the proper warning is shown if a Secret/Env Var collision occurs within the config. Deployment button remains active and deploys properly even if you forgo the warning.

Verified an error message is thrown when adding a Secret where an already-existing Environment Variable.

Tested on:

Screenshot 2024-10-07 at 11 14 39 AM Screenshot 2024-10-07 at 11 16 08 AM