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

(VDB-1046) Add command to extract diffs #27

Merged
merged 1 commit into from
Jan 23, 2020

Conversation

rmulhol
Copy link

@rmulhol rmulhol commented Jan 15, 2020

  • Isolate diff extraction from transformers etc

Notes:

  • expanded and then broke down the storage package to avoid import cycles (e.g. datastore importing storage and vice versa). Not a huge fan of having a package named types since it overloads geth, but also not wanting to go down too deep a rabbit hole until we're restructuring things more broadly.
  • Note that the package changes are breaking for the transformers and will require a corresponding PR to point at staging.
  • making this feature useful probably depends on some sort of mechanism for identifying which raw diffs still need to be transformed, but I'm thinking that can be handled with a separate story to transformer diffs in an isolated command.

- Isolate diff extraction from transformers etc
Copy link

@Gslaughl Gslaughl left a comment

Choose a reason for hiding this comment

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

Looks great, solid refactoring! :shipit:

@@ -20,9 +20,9 @@ import (
"math/rand"

"github.com/ethereum/go-ethereum/common"
storage_factory "github.com/makerdao/vulcanizedb/libraries/shared/factories/storage"
"github.com/makerdao/vulcanizedb/libraries/shared/factories/storage"

Choose a reason for hiding this comment

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

🎉

err := extractor.ExtractDiffs()

Expect(err).To(HaveOccurred())
Expect(err).To(MatchError(fakes.FakeError))

Choose a reason for hiding this comment

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

Tiny nitpick, but do we need both of these assertions?

Copy link
Author

Choose a reason for hiding this comment

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

We probably don't need both, but I'm a fan because of the clearer failure message (expected err to have occurred, got none vs expected nil to equal "Failed"). Not super wedded to this, but I think I'd opt for a more comprehensive approach if we decide to minimize our assertions throughout the test suites

Choose a reason for hiding this comment

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

Nice, yeah I agree that isn't a very good test failure if the error didn't occur. Especially if we're using this pattern elsewhere I def have no problem leaving it like this

}

type StorageQueue struct {
type queue struct {

Choose a reason for hiding this comment

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

💡

Copy link

@elizabethengelman elizabethengelman left a comment

Choose a reason for hiding this comment

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

this looks awesome, super excited to get this included 🦖

@rmulhol rmulhol merged commit 2120ecb into staging Jan 23, 2020
@rmulhol rmulhol deleted the vdb-1046-extract-diffs-cmd branch January 23, 2020 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants