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

Implement local environment flagging mechanism #58

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

toyamarinyon
Copy link
Contributor

@toyamarinyon toyamarinyon commented Oct 29, 2024

In the local environment, environment variables can be used to mimic the Vercel Toolbar.

Changes:

  • Add utility function to evaluate flags based on local environment
  • Replace hardcoded return values with calls to the new function
  • This enhancement allows better control of feature flags during development

- Add utility function to evaluate flags based on local environment
- Replace hardcoded return values with calls to the new function
- This enhancement allows better control of feature flags during development
@toyamarinyon toyamarinyon requested a review from shige as a code owner October 29, 2024 07:51
Copy link

vercel bot commented Oct 29, 2024

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

Name Status Preview Comments Updated (UTC)
giselle ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 29, 2024 7:53am

Copy link
Member

@shige shige left a comment

Choose a reason for hiding this comment

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

LGTM 👍


OTA

These feature flags work with the following environments.

  • preview
  • development

IMO

I thought that using the FLAG_ prefix might make the code for environment variables more readable, but I’ll leave it up to you since it's a matter of personal preference.

@toyamarinyon
Copy link
Contributor Author

I thought that using the FLAG_ prefix might make the code for environment variables more readable, but I’ll leave it up to you since it's a matter of personal preference.

I understand. In this case, I used the name of the environment variable aligned with the name of the variable in the code, but in the future, if there are any problems, I would be happy to add the suggested Prefix to the form.

https://github.com/route06inc/giselle/blob/a22c35997bd0b63b21e52160383716a7bf544dbd/flags.ts#L15-L65

@toyamarinyon toyamarinyon merged commit 1c443e9 into main Oct 29, 2024
9 checks passed
@toyamarinyon toyamarinyon deleted the set-default-flag-from-env branch October 29, 2024 08:43
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