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

Evolve enrollment error handling sdk-294 #4186

Merged
merged 23 commits into from
Jun 17, 2021
Merged

Evolve enrollment error handling sdk-294 #4186

merged 23 commits into from
Jun 17, 2021

Conversation

dmose
Copy link
Member

@dmose dmose commented Jun 8, 2021

This changes the evolve_enrollments error handling to discard invalid records, rather than simplying blowing up and letting the error propagate up the stack.

It has an integration test for apply_updates. I thought about writing one for set_global_opt_out, but I'm not convinced it provides much additional information, at least as relevant to this patch. Which is to say that there shouldn't be errors that such a test would catch that this patch fixes and wouldn't already be caught by the apply_updates integration test.

Pull Request checklist

  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGES_UNRELEASED.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
    • /No breaking changes/
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due dilligence applied in selecting them.
    • /No new dependencies/

@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2021

Codecov Report

Merging #4186 (10c88f9) into main (52593e3) will increase coverage by 10.46%.
The diff coverage is 97.72%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #4186       +/-   ##
===========================================
+ Coverage   64.42%   74.89%   +10.46%     
===========================================
  Files          56       44       -12     
  Lines        4613     4015      -598     
===========================================
+ Hits         2972     3007       +35     
+ Misses       1641     1008      -633     
Impacted Files Coverage Δ
components/nimbus/src/lib.rs 60.55% <ø> (ø)
components/nimbus/tests/test_updates.rs 100.00% <ø> (ø)
components/nimbus/src/persistence.rs 95.75% <85.71%> (-0.24%) ⬇️
components/nimbus/src/enrollment.rs 97.36% <100.00%> (+0.06%) ⬆️
components/support/error/src/lib.rs 0.00% <0.00%> (ø)
components/viaduct/src/backend/ffi.rs 0.00% <0.00%> (ø)
...ort/rc_crypto/nss/nss_sys/src/bindings/seccomon.rs 0.00% <0.00%> (ø)
components/support/rc_crypto/nss/src/error.rs
components/support/rc_crypto/nss/src/pk11/types.rs
components/support/rc_crypto/nss/src/pk11/slot.rs
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52593e3...10c88f9. Read the comment docs.

@dmose dmose marked this pull request as draft June 9, 2021 00:03
@dmose dmose requested a review from travis79 June 15, 2021 01:57
@dmose dmose marked this pull request as ready for review June 15, 2021 01:58
Copy link
Member

@travis79 travis79 left a comment

Choose a reason for hiding this comment

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

Just a couple of nits, but this looks good to me!

) {
Ok(enrollment) => enrollment,
Err(e) => {
log::error!("evolve_enrollment(\n\tprev_exp: {:?}\n\t, next_exp: {:?}, \n\tprev_enrollment: {:?})\n\t returned an error: {}; dropping this record", prev_experiments.get(slug).copied(), Some(next_experiments.get(slug).copied()), prev_enrollment, e);
Copy link
Member

Choose a reason for hiding this comment

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

❤️

components/nimbus/src/enrollment.rs Show resolved Hide resolved
components/nimbus/src/persistence.rs Show resolved Hide resolved
components/nimbus/tests/common/mod.rs Outdated Show resolved Hide resolved
components/nimbus/tests/test_updates.rs Outdated Show resolved Hide resolved
@dmose dmose merged commit fea3d59 into main Jun 17, 2021
@dmose dmose deleted the errored-out-sdk branch June 17, 2021 01:06
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