This repository has been archived by the owner on Sep 14, 2020. It is now read-only.
Fix on-field handler selection when a field is longer/equal to a diff #340
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.
What do these changes do?
Fix an issue with not calling the field-handlers if the change is too big/generic (regression).
Description
This issue was once fixed in #191. Since then, the handler selection was moved to other functions and places, and that logic was not reproduced.
The issue happens when there is a handler for a field, and a diff is too big and generic, not specific to sub-fields. For example:
And the diff is:
This can happen when the labels are added to an object which previously had no labels. If it had any other labels, it is all fine, since the diff becomes specific only to the new labels:
This PR fixes that issue for on-field handler selection. The same or similar-purpose code already exists in
kopf.structs.diffs.reduce_iter()
.Issues/PRs
Type of changes
Checklist
CONTRIBUTORS.txt