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

refactor(orm)!: refactor hooks into validate and write hooks #11185

Merged
merged 8 commits into from
Feb 25, 2022

Conversation

aaronc
Copy link
Member

@aaronc aaronc commented Feb 14, 2022

Description

Based on the issues uncovered in #11156, this separates hooks into validate and write hooks (proper write hooks didn't actually exist before). Write hooks are only called at the end of writing a batch of changes to the store and can't return an error.

In the .golden tests you can now see more clearly the boundaries between the start and end of write operations


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@codecov
Copy link

codecov bot commented Feb 14, 2022

Codecov Report

Merging #11185 (f6dc232) into master (4de7d40) will increase coverage by 0.15%.
The diff coverage is 87.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11185      +/-   ##
==========================================
+ Coverage   65.99%   66.14%   +0.15%     
==========================================
  Files         696      706      +10     
  Lines       71185    72523    +1338     
==========================================
+ Hits        46977    47969     +992     
- Misses      21309    21566     +257     
- Partials     2899     2988      +89     
Impacted Files Coverage Δ
orm/model/ormtable/backend.go 74.00% <54.54%> (-3.28%) ⬇️
orm/model/ormtable/auto_increment.go 54.83% <75.00%> (ø)
crypto/types/compact_bit_array.go 78.45% <100.00%> (+0.11%) ⬆️
orm/model/ormtable/batch.go 69.56% <100.00%> (+1.87%) ⬆️
orm/model/ormtable/primary_key.go 48.57% <100.00%> (+1.51%) ⬆️
orm/model/ormtable/singleton.go 46.96% <100.00%> (ø)
orm/model/ormtable/table_impl.go 56.55% <100.00%> (+1.34%) ⬆️
db/rocksdb/batch.go 67.56% <0.00%> (ø)
db/adapter.go 0.00% <0.00%> (ø)
db/prefix/prefix.go 42.20% <0.00%> (ø)
... and 8 more

Copy link
Contributor

@technicallyty technicallyty left a comment

Choose a reason for hiding this comment

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

lgtm

@blushi blushi self-assigned this Feb 24, 2022
@aaronc
Copy link
Member Author

aaronc commented Feb 24, 2022

Would be great to get one more review here

@tac0turtle tac0turtle merged commit 57b4613 into master Feb 25, 2022
@tac0turtle tac0turtle deleted the aaronc/orm-refactor-hooks branch February 25, 2022 13:54
@aaronc aaronc mentioned this pull request Feb 25, 2022
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants