-
Notifications
You must be signed in to change notification settings - Fork 120
ref(managed): Implement Managed::zip function #6174
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -619,12 +619,11 @@ fn envelope( | |
| meta: RequestMeta, | ||
| managed_err: Managed<(DataCategory, usize)>, | ||
| ) -> Result<Managed<Box<Envelope>>, BadStoreRequest> { | ||
| let event_id = common::event_id_from_items(&items) | ||
| .reject2(&items, &managed_err)? | ||
| let merged = Managed::zip(managed_err, items); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be simplified to: Managed::zip(managed_err, items).try_map(|(_, items), _| {
let event_id = common::event_id_from_items(&items)?.unwrap_or_default();
let envelope = Envelope::from_request(Some(event_id), meta).with_items(items);
Ok::<_, BadStoreRequest>(Box::new(envelope))
})Which then we might as well inline and we can drop the helper.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By dropping the helper, are you referring to the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant the |
||
| let event_id = common::event_id_from_items(&merged.as_ref().1) | ||
| .reject(&merged)? | ||
| .unwrap_or_else(EventId::new); | ||
| let envelope = items.map(|items, records| { | ||
| managed_err.accept(|_| ()); // There will be an envelope with (DataCategory::Error, 1) now | ||
| records.modify_by(DataCategory::Error, 1); | ||
| let envelope = merged.map(|(_, items), _| { | ||
| Box::new(Envelope::from_request(Some(event_id), meta).with_items(items)) | ||
| }); | ||
| Ok(envelope) | ||
|
Dav1dde marked this conversation as resolved.
|
||
|
|
||
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.
Can remove the changelog now, added the skip-changelog label
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.
Okay I did fix the pipeline. What is the standard here? So I can do it right next time.
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.
Rule of thumb, If it has customer observable impact -> Fix/Feature, if it has any visible impact -> Internal. If it is a non trivial refactor which should not have any impact -> Internal, everything else -> No Changelog.