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

fix: disallow empty list of envs and invalid env names in advanced playground #4060

Merged
merged 3 commits into from
Jun 22, 2023

Conversation

thomasheartman
Copy link
Contributor

This PR changes the OpenAPI schema for the advanced playground to not accept empty lists of environments and to not accept environment names that don't match the env name pattern we use.

The pattern is the same as the one we use for controlling environment names on creation.

However, there is a (small) chance that these may get out of sync later, so we could do something to only define this pattern once (and import it in the enterprise package), but that may be more work than is necessary, and I'd suggest we do that later.

I've also added a minLength to the string items although it isn't strictly necessary. It's primarily to give the users better feedback if the name is empty.

@vercel
Copy link

vercel bot commented Jun 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend 🛑 Canceled (Inspect) Jun 22, 2023 8:20am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Jun 22, 2023 8:20am

@thomasheartman thomasheartman changed the title fix: disallow empty list of envs and whitespace-only env names in advanced playground fix: disallow empty list of envs and invalid env names in advanced playground Jun 22, 2023
Copy link
Contributor

@kwasniew kwasniew left a comment

Choose a reason for hiding this comment

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

Thanks for finding and fixing it!

@thomasheartman thomasheartman enabled auto-merge (squash) June 22, 2023 08:16
@thomasheartman thomasheartman merged commit 3fb00b2 into main Jun 22, 2023
15 of 16 checks passed
@thomasheartman thomasheartman deleted the fix/playground-env-length branch June 22, 2023 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants