-
Notifications
You must be signed in to change notification settings - Fork 93
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(schema): Allow integers as username #3328
Conversation
let user = Annotated::new(User { | ||
username: Annotated::new("42".to_string().into()), | ||
..User::default() | ||
}); | ||
|
||
assert_eq!(user, Annotated::from_json(input).unwrap()); | ||
assert_eq!(output, user.to_json().unwrap()); |
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.
imo the round trip is enough
assert_eq!( Annotated::from_json(input).unwrap().to_json().unwrap(), r#"{"username":"42"}"#)
Can also maybe just use insta here to assert the output?
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 copy-pasted the existing tests around this, would like to keep them as similar as possible.
@@ -9,6 +9,7 @@ | |||
- Extract op and description while converting opentelemetry spans to sentry spans. ([#3287](https://github.com/getsentry/relay/pull/3287)) | |||
- Drop `event_id` and `remote_addr` from all outcomes. ([#3319](https://github.com/getsentry/relay/pull/3319)) | |||
- Support for AI token metrics ([#3250](https://github.com/getsentry/relay/pull/3250)) | |||
- Accept integers in `event.user.username`. ([#3328](https://github.com/getsentry/relay/pull/3328)) |
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.
nit: floats are also accepted in LenientString
- Accept integers in `event.user.username`. ([#3328](https://github.com/getsentry/relay/pull/3328)) | |
- Accept numbers in `event.user.username`. ([#3328](https://github.com/getsentry/relay/pull/3328)) |
* master: ref(cardinality): Pipeline Redis script invocations (#3321) ref(normalization): Remove StoreProcessor (#3097) feat(cardinality): Implement name based cardinality limits (#3313) instr(kafka): Tag existing metrics with variant (#3352) instr(kafka): More broker stats (#3349) instr(kafka): Improve produce error handling (#3351) feat(schema): Allow integers as username (#3328)
The django integration sends integers as usernames if the underlying
User
model returns an integer forget_username()
(see issue).Fixes getsentry/sentry#67601.