ref(managed): Implement Managed::zip function - #6174
Conversation
cd5bb4a to
10a6fe8
Compare
|
@Dav1dde Please take a look at this implementation for the zip function. Thanks! |
|
@pierceroberts you will have to fix the title, you can see the error
|
|
|
@olksdr I fixed the failing pipeline. I did add the log to the unreleased section. Let me know if I need to move that. Thanks! |
|
MIght be a flaky test in the integration test suit: If it passes, Should I create an issue for it? |
| - Use dedicated secret to sign upload URLs. ([#6132](https://github.com/getsentry/relay/pull/6132)) | ||
| - Inline small attachments instead of uploading to objectstore. ([#6165](https://github.com/getsentry/relay/pull/6165)) | ||
| - Retry 500 responses from objectstore. ([#6162](https://github.com/getsentry/relay/pull/6162)) | ||
| - Implement Managed::zip function. ([#6174](https://github.com/getsentry/relay/pull/6174)) |
There was a problem hiding this comment.
Can remove the changelog now, added the skip-changelog label
There was a problem hiding this comment.
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.
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.
There was a problem hiding this comment.
I went ahead and deleted this change log entry.
| ) -> 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
By dropping the helper, are you referring to the map function? or zip?
There was a problem hiding this comment.
I meant the fn envelope helper function, with zip + try_map I feel like we can inline it without having to go through that function.
There was a problem hiding this comment.
Alright I made this change would you like me to create another issue to remove the envelope function? Or would you still like to noodle on it?
|
Apologies, I was out on holiday and am getting ready to go back to work. I'll try to get working on this again. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 34504d8. Configure here.
|
@Dav1dde I am not sure what is up with the warden pipeline. But do these changes look good to you. Thanks! |
|
@pierceroberts ah sorry I missed the update on the PR, mind removing the Warden is failing because of missing security tokens for external PRs, I reported that but fine to ignore. |
|
@Dav1dde No worries! Are you good if we merge this and create a new PR to remove the envelope fn or you'd prefer to use this same PR? I can start that this week. |
|
Sounds like you'd prefer to do it in a separate PR^^, let's get this merged. |
|
Interesting somehow a lint is failing now |

Relates to #5985.
And implements: #6088
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.