Convert metamask to LAVA @artifact_processor (4-report split + fixes)#1576
Merged
Conversation
Splits the single get_metamask (four ArtifactHtmlReports from persist-root
JSON) into one processor per table: metamaskWallets, metamaskContacts,
metamaskTransactions, metamaskBrowser. Context form; shared _load_metamask loader.
Fixes carried in the conversion:
- Reserved-word trap: Transactions headers 'From'/'To' (sanitize to the SQL
reserved words from/to) renamed to 'From Address'/'To Address'.
- Timestamp correctness: import/transaction times were naive
datetime.fromtimestamp (machine-local). Now convert_unix_ts_to_utc (UTC).
- Removed the spurious 'for i in json_object' loop that re-emitted every row
once per top-level engine key (duplicate rows).
- Fixed the Browser report's swapped columns (data was (url, name) under
headers ('Name','URL')).
- Hardened with .get() lookups so missing controllers/keys no longer KeyError.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modernizes MetaMask (
persist-rootJSON store) to the LAVA pipeline. Four reports → four processors per the multi-report rule.Split
get_metamask(fourArtifactHtmlReports) →metamaskWallets,metamaskContacts,metamaskTransactions,metamaskBrowser(context form; shared_load_metamaskloader parses the nestedengine/browserJSON once per call).Bugs fixed during conversion
From/Toheaders sanitize to the SQL reserved wordsfrom/to(the same class of bug as the earlierValuescrash) — renamed toFrom Address/To Address.datetime.fromtimestamp(renders in the processing machine's local tz). Nowconvert_unix_ts_to_utc→ proper UTC.for i in json_object:loop that re-emitted every row once per top-level engine key.(url, name)under headers('Name','URL')— now aligned..get()so a missing controller/section no longer raisesKeyError.Validation
get_metamask.