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

Feature flags: Add a way to subscribe to feature flag changes #2992

Merged
merged 13 commits into from
Feb 19, 2024

Conversation

philipp-spiess
Copy link
Contributor

@philipp-spiess philipp-spiess commented Feb 1, 2024

Adds a new method to the feature flag provider in order to subscribe to changes for a specific prefix and subscribes the autocomplete codebase to all cody.autocomplete changes. When triggered, it will re-initialize just like when settings are changed.

The main motivation is that we want to be able to change experiment rollouts without having to wait for days until all users have reloaded the VS Code extension.

Test plan

@philipp-spiess
Copy link
Contributor Author

This has been much more involved than I initially thought. There's still some kind of race condition in there that I don't fully understand. I think I'll refactor the feature flag provider to not mix "undefined" feature flags with the preloaded feature flag object but instead cache them in a different object. 😓 cc @valerybugakov if you have any input

@valerybugakov
Copy link
Member

not mix "undefined" feature flags with the preloaded feature flag object but instead cache them in a different object

Yes, please! Based on our recent discussion this part is tricky to reason about. Making it more transparent and robust would be great.

@philipp-spiess philipp-spiess changed the title Add a way to subscribe to feature flag changes Feature flags: Add a way to subscribe to feature flag changes Feb 15, 2024
@philipp-spiess philipp-spiess requested review from valerybugakov and a team February 15, 2024 13:29
@philipp-spiess philipp-spiess marked this pull request as ready for review February 15, 2024 13:30
@philipp-spiess
Copy link
Contributor Author

@valerybugakov This is ready for review now, I addressed the point I mentioned above

Copy link
Contributor

@umpox umpox left a comment

Choose a reason for hiding this comment

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

Looks good! and v helpful for future experiments. Thanks for adding the tests

@@ -6,6 +6,15 @@ This is a log of all notable changes to Cody for VS Code. [Unreleased] changes a

### Added

- Chat: Display Cody icon in the editor title of the chat panels when `cody.editorTitleCommandIcon` is enabled. [pull/2937](https://github.com/sourcegraph/cody/pull/2937)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a bad merge, needs updating!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ouch, ty!

@philipp-spiess philipp-spiess merged commit beaaa38 into main Feb 19, 2024
16 checks passed
@philipp-spiess philipp-spiess deleted the ps/subscribe-to-feature-flag-changes branch February 19, 2024 14:39
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.

3 participants