-
Notifications
You must be signed in to change notification settings - Fork 166
Report unmapped fields in integrity checks + delete Package.isWithheld and withheldReason #8414
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
Conversation
…d and withheldReason.
app/lib/shared/integrity.dart
Outdated
| if (_unmappedFields.isNotEmpty) { | ||
| for (final field in _unmappedFields) { | ||
| if (_knownUnmappedFields.contains(field)) continue; | ||
| yield 'Unmapped field found: $field.'; |
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.
Can we report more? Like give some entity with this field, and the entitty type
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.
We are reporting EntityType.fieldName here. I'm not sure if we need to have a full entity identifier, as these fields are typically unused, but maybe we could report one id for each of the reported entries? That way we can store it in a Map and only keep the first one?
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.
Implemented this, PTAL.
app/lib/shared/integrity.dart
Outdated
| final DatastoreDB _db; | ||
| final int _concurrency; | ||
|
|
||
| static const _knownUnmappedFields = { |
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.
Please document the scope of this (is it only about packages?)
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.
renamed + done.
app/lib/shared/integrity.dart
Outdated
| 'Package.isWithheld', | ||
| 'Package.withheldReason', | ||
| }; | ||
| final _unmappedFields = <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.
Just to make sure, do we create a new IntegrityChecker for each run?
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.
Yes, this is a one-off object on each run.
Note: isBlocked could also be removed, but to be on the safe side I'd do that in the release after the current one.
#8336