Repository navigation
Validate user actions before applying anything - #318
Open
TeunHuijben wants to merge 2 commits into
Open
TeunHuijben wants to merge 2 commits into
TeunHuijben wants to merge 2 commits into
Conversation
…hat are not recorded in the (future) log
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #318 +/- ##
==========================================
+ Coverage 94.36% 94.45% +0.09%
==========================================
Files 64 64
Lines 3883 3929 +46
==========================================
+ Hits 3664 3711 +47
+ Misses 219 218 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
This is something we need in order to have a consistent change/history log in nTE. A re-applyable history log only works when every recorded action was as it did, and every change is reported in the changelog. Which is currently not the case, because some (User)Actions make changes to the graph, and later hit an error before addin things to the undo/redo history and thereby history log.
So the two things this PR ensures:
🤖:
Some user actions could fail halfway: they changed the graph, then raised, and nothing went into the undo history, so the change could not be undone.
UserAddEdge,UserDeleteEdge,UserAddNode,UserSetDivision,UserDeleteNodes,UserUpdateNodesAttrs,UserUpdateSegmentation).ActionGroupundoes the steps it already applied.AddNode.validate_attributesis shared byAddNodeandUserAddNode.UserAddNodeno longer changes the caller'sattributesdict.Behaviour changes:
UserDeleteNodesignores duplicate ids.UserUpdateNodesAttrsraisesInvalidActionErrorfor unknown nodes.UserUpdateSegmentationraisesInvalidActionErrorwhen the painted-over node is not in the solution.Known issue, not fixed here: undoing a merge restores the pixels but leaves the mask's bounding box too large (marked xfail).