Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secrets and Environment collision #2326

Open
kgartland-rstudio opened this issue Sep 30, 2024 · 1 comment · May be fixed by #2338
Open

Secrets and Environment collision #2326

kgartland-rstudio opened this issue Sep 30, 2024 · 1 comment · May be fixed by #2338
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kgartland-rstudio
Copy link
Collaborator

kgartland-rstudio commented Sep 30, 2024

If I have a config that includes both a Secret an Environment Variable with the same name, Secret wins. If I then go to redeploy the Environment variable will win because we clear out the Secret after the initial deployment.

This could lead to some confusion. Can we add some validation to ensure Secrets and Environment cannot contain the same name?

Example config:

# Configuration file generated by Posit Publisher.
# Please review and modify as needed. See the documentation for more options:
# https://github.com/posit-dev/publisher/blob/main/docs/configuration.md
'$schema' = 'https://cdn.posit.co/publisher/schemas/posit-publishing-schema-v3.json'
type = 'python-fastapi'
entrypoint = 'simple.py'
validate = true
files = [
  '/simple.py',
  '/requirements.txt'
]
title = 'fastapi-simple'
secrets = ['secret1', 'secret2', 'secret3']

[environment]
secret3="environment"

[python]
version = '3.11.4'
package_file = 'requirements.txt'
package_manager = 'pip'
@kgartland-rstudio kgartland-rstudio added the enhancement New feature or request label Sep 30, 2024
@kgartland-rstudio kgartland-rstudio changed the title If Secrets and Environment collision Secrets and Environment collision Sep 30, 2024
@kgartland-rstudio kgartland-rstudio added bug Something isn't working and removed enhancement New feature or request labels Sep 30, 2024
@dotNomad dotNomad added this to the v1.2.0 milestone Sep 30, 2024
@dotNomad dotNomad self-assigned this Oct 1, 2024
@dotNomad
Copy link
Collaborator

dotNomad commented Oct 1, 2024

I'm thinking a combination of two changes could be very helpful here:

  1. When using the UI, change the add behavior to prevent adding a secret with the same name as an environment variable, or visa versa.

  2. When the selected Configuration has Secret / Env Var collision show a warning and potentially disable the deploy button (look to other behavior to keep it consistent).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants