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

Do not compare preparation states in non-test code. #1879

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

branlwyd
Copy link
Member

@branlwyd branlwyd commented Sep 2, 2023

This required a few updates to non-test code:

  • The aggregation job creator used equality checks to determine if a given report aggregation was in state START. These are easily replaced by a call to matches!, which does not require PartialEq + Eq.

  • Checking if a repeated aggregation job PUT matched the preexisting aggregation job checked if the report aggregations were equal. This is replaced by populating the last request hash for initialization requests (as well as continuation requests) and checking if the aggregation job is equal; since the aggregation job carries both the round number as well as the request hash, this should suffice to check that the requests are equal. As a bonus, we no longer need to read the preexisting report aggregations.

This required a few updates to non-test code:

* The aggregation job creator used equality checks to determine if a
  given report aggregation was in state `START`. These are easily
  replaced by a call to `matches!`, which does not require `PartialEq +
  Eq`.

* Checking if a repeated aggregation job `PUT` matched the preexisting
  aggregation job checked if the report aggregations were equal. This is
  replaced by populating the last request hash for initialization
  requests (as well as continuation requests) and checking if the
  aggregation job is equal; since the aggregation job carries both the
  round number as well as the request hash, this should suffice to check
  that the requests are equal. As a bonus, we no longer need to read the
  preexisting report aggregations.
@branlwyd branlwyd requested a review from a team as a code owner September 2, 2023 00:20
@branlwyd branlwyd added the allow-changed-migrations Override the ci-migrations check to allow migrations that have changed. label Sep 2, 2023
@branlwyd
Copy link
Member Author

branlwyd commented Sep 6, 2023

(removing resolution of divviup/libprio-rs#722 as that issue is for libprio-rs, and we should do the work to remove comparability of relevant types from libprio-rs before counting that issue done. this is just the application-level change allowing the libprio-rs change to be made.)

@branlwyd branlwyd merged commit 577888c into main Sep 6, 2023
6 of 7 checks passed
@branlwyd branlwyd deleted the bran/no-comparing-preparation-states branch September 6, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
allow-changed-migrations Override the ci-migrations check to allow migrations that have changed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants