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
Add a structure hash to FeatureInspector #5949
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #5949 +/- ##
==========================================
+ Coverage 26.97% 27.34% +0.37%
==========================================
Files 377 379 +2
Lines 47881 48145 +264
==========================================
+ Hits 12916 13166 +250
- Misses 34965 34979 +14 ☔ View full report in Codecov by Sentry. |
79cd3ac
to
48bc961
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic! 🚀
@@ -66,6 +66,12 @@ impl FmlFeatureInspector { | |||
pub fn get_errors(&self, string: String) -> Option<Vec<FmlEditorError>> { | |||
self.get_first_error(string).map(|e| vec![e]) | |||
} | |||
|
|||
pub fn get_structure_hash(&self) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely agree that "structure" isn't as clear as I'd like it to be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Schema" does seem like a good alternative, since we use "definition" in other places
Relates to EXP-3938.
According to The Big O of Code Reviews, this is a O(n) change.
This PR adds:
TypeQuery
utility for getting allTypeRef
s that aFeatureDef
uses, including recursively looking atObjectDef
s. This is useful in multiple places, so good to pull this out.Sha256Hasher
, compatible withstd:hash:Hash
StructureHasher
that uses the structure of the feature (and embedded Objects).It exposes
get_structure_hash()
to theFeatureInspector
, available to python.Pull Request checklist
[ci full]
to the PR title.Branch builds: add
[firefox-android: branch-name]
to the PR title.