-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: Update user info every 24h and adds command with feature flag #193
Conversation
It starts storing `USER_FEATURE_FLAGS` existing feature flags
7a09af8
to
11c48d0
Compare
11c48d0
to
79d1d86
Compare
cmd/meroxa/builder/builder.go
Outdated
flagRequired := v.FeatureFlag() | ||
userFeatureFlags := global.Config.GetStringSlice(global.UserFeatureFlagsEnv) | ||
|
||
if !hasFeatureFlag(userFeatureFlags, flagRequired) { | ||
return fmt.Errorf("your account does not have access to the %q feature. Reach out to [email protected] for more information", flagRequired) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be moved outside of the PreRunE
function? I think we already have all the info at that point, don't we? If we do, then we could already detect if the feature flag is enabled and un-hide the command (cmd.Hidden = false
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context, @lovromazgon and I paired today to explore this option and we both agreed that the effort to make it work is currently not worth it. Maybe in a future iteration we'll revisit this.
Co-authored-by: Diana Doherty <[email protected]>
619d48b
to
c7011fc
Compare
Description of change
This pull-request adds the ability to create a CLI command that depends on a Meroxa User Feature Flag. These are returned by the API endpoint
/v1/users/me
and when that API endpoint is used inmeroxa whoami
we also make sure we update this information.To make sure user information is not stale, we'll start fetching this information every 24hours since last time was updated.
To demo the usage of feature flags, this pull-request also adds the
environment
command which could aliased asenv
orenvironment
.Fixes https://github.com/meroxa/product/issues/113
Depends on https://github.com/meroxa/meroxa-go/pull/53.Type of change
How was this tested?
Demo
Before this pull-request
After this pull-request
Without feature flag enabled
With feature flag enabled