stable

Clone or download

Read-only

fix: ignore update of card already in its column

Closes request #39022 Moving a card in Taskboard can have side effects How to test: - Create a new Scrum project. The default "Bug" tracker will be used. - Go to the Bug tracker administration > Workflow > Transition rules. - Enable the transition rules. - Create a new Release artifact. - Add a new Bug artifact to the Release backlog, choose "To do" status. - Open a first browser tab to the Release taskboard. - Open a second browser tab to the same taskboard. - In the first tab, move the card to the "Done" column. - Open in a third browser tab the artifact view of the Bug card. => The Status value should be "Invalid". - In the second tab, without refreshing, move again the card to the "Done" column. => In the artifact view, after refreshing, the status value should still be "Invalid". => Before the fix, the status value would be "Wont fix". Why? When moving a card to a column where it already is, the update process of the card artifact is triggered. This can happen with concurrent updates (two people moving the same card to the same column). It may create an unwanted changeset, and may trigger unwanted workflow transition or post actions. Also, when multiple values map to a single column, it will cycle through the values and select the next value. Instead of doing the update, we should do nothing: the card is already in the given column, so there is nothing more to do. Also removed static build methods. The final, top-most endpoints should have the responsibility of instantiating everything, so that they can substitute interfaces with caches if needed. Instantiation should not be a responsibility of individual objects. Change-Id: I0e515dbdbdb57bd4b953c6dcef13d3c82ec18e8e

Modified Files

Name
M plugins/cardwall/include/Column.class.php +2 −2 Go to diff View file
A plugins/taskboard/include/Column/CardColumnFinder.php +84 −0 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/ArtifactMappedFieldValueRetriever.php +2 −2 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/EmptyMappedValues.php +5 −0 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/MappedValues.php +8 −3 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/MappedValuesInterface.php +2 −0 Go to diff View file
M plugins/taskboard/include/Column/MilestoneTrackerRetriever.php +1 −1 Go to diff View file
M plugins/taskboard/include/REST/v1/CardRepresentationBuilder.php +3 −3 Go to diff View file
M plugins/taskboard/include/REST/v1/Cell/CardMappedFieldUpdater.php +13 −143 Go to diff View file
M plugins/taskboard/include/REST/v1/Cell/CellPatcher.php +155 −2 Go to diff View file
A plugins/taskboard/tests/unit/Column/CardColumnFinderTest.php +178 −0 Go to diff View file
M plugins/taskboard/tests/unit/Column/FieldValuesToColumnMapping/ArtifactMappedFieldValueRetrieverTest.php +2 −13 Go to diff View file
M plugins/taskboard/tests/unit/Column/FieldValuesToColumnMapping/EmptyMappedValuesTest.php +5 −0 Go to diff View file
M plugins/taskboard/tests/unit/Column/FieldValuesToColumnMapping/MappedValuesTest.php +10 −0 Go to diff View file
M plugins/taskboard/tests/unit/REST/v1/Cell/CardMappedFieldUpdaterTest.php +145 −135 Go to diff View file