-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add configcat plugin to proxy #12756
Conversation
bfa739d
to
084e14a
Compare
084e14a
to
1eeb694
Compare
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.
Looks awesome, nice work! Left a couple of comments but these are non-blocking (adding hold if you do want to go for them). Feel free to land when you're ready.
/hold
|
||
// fetchConfigCatConfig with different config version. i.e. config_v5.json | ||
func (c *ConfigCat) fetchConfigCatConfig(configVersion string) ([]byte, error) { | ||
b, err, _ := sg.Do(fmt.Sprintf("fetch_%s", configVersion), func() (interface{}, error) { |
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.
Nice use of singleflight!
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.
Shame golang/go#53427 has not yet landed, would make retrieval of the result nicer.
1eeb694
to
f3dae22
Compare
f3dae22
to
be5c727
Compare
Follow up ops PR https://github.com/gitpod-io/ops/pull/4464 |
|
||
var ( | ||
DefaultConfig = []byte("{}") | ||
pathRegex = regexp.MustCompile(`^/configcat/configuration-files/gitpod/config_v\d+\.json$`) |
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.
In gitpod-desktop we use both keys production and non-production for testing, having gitpod
harcoded only maps to one key at a time, maybe better to send the configcat key dinamically?
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.
I've thought about this before, we could
- Create a new preview env to do this test. But it does make the steps more complicated
- Change
baseUrl
when creating configcat client and sdkKey if we want to connect to non-product env?
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.
yeah neither of those are nice 😞
- option 1 is definitely a no-no for me
- option 2, so we would use the configcat cdn as we do right now, correct?
cc @akosyakov thoughts?
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.
- Use product env in
vscode-desktop
is not harmful because configcat is calculating locally. - If we bring non-product env to product gitpod, it will fetch non-product data every minute, but it's not need to do so
- Option 2 (change code if needed) can be a solution, i.e. use staging Gitpod as
baseUrl
which is using non-product SDK key
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.
Concurrent r/w cache map will make some data update delay for around 1 min (pollDuration), but it's not harmful. We can change it to |
For other projects that want to use configcat Thanks for recommending @easyCZ provided: Point to a domain which is closest to your "type of install" [1]
configcat Added in PR description |
c49f6db
to
9af1736
Compare
Rebased to squash commits. Going to unhold it |
/unhold |
Description
Bring ConfigCat
config.json
file toproxy
For other projects that want to use configcat
Thanks for recommending @easyCZ provided: Point to a domain which is closest to your "type of install" [1]
gitpod.io
gitpod-staging
configcat
baseUrl
should be<host>/configcat
Related Issue(s)
Fixes #12739
How to test
CURL
SDK
Release Notes
Documentation
Werft options: