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: move enterprise check further left, prevent OSS from seeing CR usage #5431

Merged
merged 5 commits into from
Nov 27, 2023

Conversation

thomasheartman
Copy link
Contributor

@thomasheartman thomasheartman commented Nov 27, 2023

This PR checks that the unleash instance is an enterprise instance before fetching change request data. This is to prevent Change Request usage from preventing OSS users from deleting segments (when they don't have access to change requests).

This PR also does a little bit of refactoring (which we can remove if you want)

Copy link

vercel bot commented Nov 27, 2023

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

Name Status Preview Comments Updated (UTC)
unleash-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2023 1:06pm
unleash-monorepo-frontend 🛑 Canceled (Inspect) Nov 27, 2023 1:06pm

Copy link
Contributor Author

@thomasheartman thomasheartman Nov 27, 2023

Choose a reason for hiding this comment

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

This is just a refactor to remove duplication.

If we change the payload to always include changeRequestStrategies, we can remove the flag check entirely. For now, this flag check retains the previous shape of the object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only look up change request strategies if it's relevant. Meaning: only if the flag is enabled (for now) and if we're on an enterprise instance.

@thomasheartman thomasheartman marked this pull request as draft November 27, 2023 12:41
@thomasheartman thomasheartman changed the title [wip]: move enterprise check further left chore: move enterprise check further left, prevent OSS from seeing CR usage Nov 27, 2023
@thomasheartman thomasheartman marked this pull request as ready for review November 27, 2023 12:56
Copy link
Contributor

@andreas-unleash andreas-unleash left a comment

Choose a reason for hiding this comment

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

Nice!

@thomasheartman thomasheartman merged commit 1a75432 into main Nov 27, 2023
8 of 13 checks passed
@thomasheartman thomasheartman deleted the chore/restrict-cr-strategies-to-enterprise branch November 27, 2023 13:16
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.

2 participants