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

feat(flags): dynamic cohort matching in rust #25776

Merged
merged 41 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ca431b5
unifying some types
dmarticus Oct 15, 2024
e89f169
in progress but not done yet
dmarticus Oct 15, 2024
4f20e07
Merge branch 'master' into feat/static-cohorts-rust
dmarticus Oct 23, 2024
ed00224
oh lol right let's actually ship
dmarticus Oct 23, 2024
fb8aab8
or default
dmarticus Oct 23, 2024
899a99c
Merge branch 'master' into feat/dynamic-cohorts-rust
dmarticus Oct 24, 2024
896c31a
Merge branch 'master' into feat/dynamic-cohorts-rust
dmarticus Oct 24, 2024
eeea8cc
let's goooo
dmarticus Oct 24, 2024
d02baec
Merge branch 'feat/dynamic-cohorts-rust' of github.com:PostHog/postho…
dmarticus Oct 24, 2024
39dad2d
Merge branch 'master' into feat/dynamic-cohorts-rust
dmarticus Oct 24, 2024
db8cd8d
modeled the data correctly this time :sweat:
dmarticus Oct 24, 2024
43cda76
clippy my frickin GUY
dmarticus Oct 24, 2024
8d2ab85
some light renaming
dmarticus Oct 25, 2024
9ccf479
yeah
dmarticus Oct 25, 2024
797adbe
remove printlns
dmarticus Oct 25, 2024
71def67
add note about not handling groups
dmarticus Oct 28, 2024
27af814
saving a working version that supports caching, since this is the rig…
dmarticus Oct 29, 2024
4c49bc4
new life
dmarticus Oct 30, 2024
d4af2f0
clippy u dawg
dmarticus Oct 30, 2024
870f719
traverse the dependency graph post-cache access
dmarticus Oct 31, 2024
57d9885
cleaning up
dmarticus Oct 31, 2024
9eb0f18
adding more tests
dmarticus Oct 31, 2024
3cfc590
test for the cohort cache
dmarticus Oct 31, 2024
3e8e5d2
a few things
dmarticus Oct 31, 2024
3528b31
Merge branch 'master' into feat/dynamic-cohorts-rust
dmarticus Oct 31, 2024
77059f3
Merge branch 'master' into feat/dynamic-cohorts-rust
dmarticus Nov 1, 2024
09317c4
use global cohort cache
dmarticus Nov 1, 2024
43e8692
less yapping
dmarticus Nov 1, 2024
3a65683
appeasing the linter
dmarticus Nov 2, 2024
a5812e6
that should do it
dmarticus Nov 2, 2024
fd52b24
clean up
dmarticus Nov 4, 2024
59f7c10
rename
dmarticus Nov 4, 2024
8066aff
bit more
dmarticus Nov 4, 2024
4d5ecd9
collapse condition
dmarticus Nov 4, 2024
4012ebe
Merge branch 'master' into feat/dynamic-cohorts-rust
dmarticus Nov 4, 2024
8ededb1
resolve conflicts
dmarticus Nov 6, 2024
fe37b04
working on it
dmarticus Nov 7, 2024
bc38940
Merge branch 'feat/dynamic-cohorts-rust' of github.com:PostHog/postho…
dmarticus Nov 7, 2024
41d3db3
not this either
dmarticus Nov 7, 2024
0a409f4
docs
dmarticus Nov 7, 2024
0dd1c0b
Merge branch 'master' into feat/dynamic-cohorts-rust
dmarticus Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rust/feature-flags/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ pub enum FlagError {
TimeoutError,
#[error("No group type mappings")]
NoGroupTypeMappings,
#[error("Invalid cohort id")]
InvalidCohortId,
}

impl IntoResponse for FlagError {
Expand Down Expand Up @@ -194,6 +196,10 @@ impl IntoResponse for FlagError {
"The requested row was not found in the database. Please try again later or contact support if the problem persists.".to_string(),
)
}
FlagError::InvalidCohortId => {
tracing::error!("Invalid cohort id: {:?}", self);
(StatusCode::BAD_REQUEST, "Invalid cohort id".to_string())
}
}
.into_response()
}
Expand Down
Loading
Loading