-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Add environment document endpoint #150
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
Open
rolodato
wants to merge
8
commits into
main
Choose a base branch
from
feat/serve-env-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a381b3d
add environment-document endpoint
rolodato 8c6bb9c
nit
rolodato 2a91b59
remove prints
rolodato c1fba53
separate environment document test cases
rolodato f5bae61
Abstract environment-document into service, make args explicit
rolodato bb36b68
Merge branch 'main' into feat/serve-env-doc
rolodato 6033eb3
lint
rolodato 2a47f01
Merge branch 'main' into feat/serve-env-doc
rolodato File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 guess some alternatives to this loop would be:
Of these 2, probably the 2nd option is the better option, but it does require a non-trivial amount of effort. I think, based on that, I'm happy with the for loop as a concept for now, but I think we should abstract it to the environment service layer and create some method like
get_client_key_from_server_key(server_key: str)
. I guess then, we might as well just extend theget_environment
method to check if the key starts with"ser."
.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 kept the same caching behaviour and moved this to
get_environment
in the service layer.I'm not a fan of checking for server/client keys by looking at the
ser.
prefix, so I madeget_environment
require explicitly namedclient_side_key
orserver_side_key
arguments.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.
While I tend to agree that it's not the neatest way of differentiation, I don't really see any actual issues with it. The issue with the approach that you've taken is that we might end up in a scenario where an application, pointing to the edge proxy, has a local evaluation and remote evaluation client running. They might though, share the same key from some environment variable. The remote evaluation client will thus fail, because it's expecting the key to be a client-side key.
Maybe this is unnecessary complication, but in opening up one endpoint to the server key, we may need to consider opening them all up.
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 just re-read the above, and it took me a while to understand again what my point was, so here's an example application to demonstrate the issue that I'm talking about.
Obviously this is an over simplification, but I suspect that this is often a valid use case, where people care about certain flags being updated sooner than others, so they set a longer refresh interval on their local evaluation client, and then use a remove evaluation client for anything more sensitive. Obviously this is further complicated by the fact that we're talking about the edge proxy here, which has it's own refresh interval, but I still think this is a valid concern.