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

chore: select enabled environments on project creation #6869

Merged
merged 16 commits into from
Apr 18, 2024

Conversation

thomasheartman
Copy link
Contributor

This PR adds functionality to the createProject function to choose which environments should be enabled when you create a new project. The new environments property is optional and omitting it will make it work exactly as it does today.

The current implementation is fairly strict. We have some potential ideas to make it easier to work with, but we haven't agreed on any yet. Making it this strict means that we can always relax the rules later.

The rules are (codified in tests):

  • If environments is not provided, all non-deprecated environments are enabled
  • If environments is provided, only the environments listed are enabled, regardless of whether they're deprecated or not
  • If environments is provided and is an empty array, the service throws an error. The API should dilsallow that via the schema anyway, but this catches it in case it sneaks in some other way.
  • If environments is provided and contains one or more environments that don't exist, the service throws an error. While we could ignore them, that would lead to more complexity because we'd have to also check that the at least one of the environments is valid. It also leads to silent ignoring of errors, which may or may not be good for the user experience.

The API endpoint for this sits in enterprise, so no customer-facing changes are part of this.

Copy link

vercel bot commented Apr 16, 2024

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

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 17, 2024 6:50am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Apr 17, 2024 6:50am

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

View detailed results in CodeScene

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: FAILED

  • Declining Code Health: 1 findings(s) 🚩

View detailed results in CodeScene

src/lib/features/project/project-service.ts Outdated Show resolved Hide resolved
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: FAILED

  • Declining Code Health: 1 findings(s) 🚩

View detailed results in CodeScene

@thomasheartman
Copy link
Contributor Author

Oh, and the tests will fail until the flag has been added

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Improving Code Health: 2 findings(s) ✅

View detailed results in CodeScene

src/lib/features/project/project-service.ts Show resolved Hide resolved
src/lib/features/project/project-service.ts Show resolved Hide resolved
src/lib/features/project/project-service.ts Show resolved Hide resolved
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Improving Code Health: 2 findings(s) ✅

View detailed results in CodeScene

@thomasheartman thomasheartman merged commit bda5eda into main Apr 18, 2024
13 checks passed
@thomasheartman thomasheartman deleted the feat/allow-specifying-envs-on-creation branch April 18, 2024 11:48
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