stable

Clone or download

Read-only

refactor: Split mapped field retrieval out of FreestyleMappingFactory

part of request #39022 Moving a card in Taskboard can have side effects No functional change. Unit, REST and DB integration tests should pass. Why? This series of refactorings has the goal to make it easy to write a "domain" API to find the current column of a given card. This requires us to know which field in the card's tracker is "mapped" (either freestyle or status semantic). We start by simplifying the freestyle mapping part. FreestyleMappingFactory did not have clear responsibilities. It is now split in two: FreestyleMappedFieldRetriever (that focuses on the mapped field), and the rest for values. The factory itself will be renamed later. Added interfaces before DB queries. Interfaces will allow us to make the DAO final and write stubs to replace it in unit tests. 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: I61881f00bf082fe074ac842d997a0779de59b8e5

Modified Files

Name
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/ArtifactMappedFieldValueRetriever.php +0 −5 Go to diff View file
A plugins/taskboard/include/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappedFieldRetriever.php +48 −0 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappingDao.php +10 −4 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappingFactory.php +1 −16 Go to diff View file
A plugins/taskboard/include/Column/FieldValuesToColumnMapping/Freestyle/SearchMappedField.php +34 −0 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/MappedFieldRetriever.php +4 −23 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/MappedValuesRetriever.php +0 −9 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/TrackerMappingPresenterBuilder.php +13 −2 Go to diff View file
M plugins/taskboard/include/REST/v1/CardRepresentationBuilder.php +14 −1 Go to diff View file
M plugins/taskboard/include/REST/v1/Cell/CardMappedFieldUpdater.php +15 −4 Go to diff View file
M plugins/taskboard/include/Tracker/TrackerPresenterCollectionBuilder.php +0 −11 Go to diff View file
M plugins/taskboard/include/taskboardPlugin.php +14 −1 Go to diff View file
M plugins/taskboard/tests/integration/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappingDaoTest.php +4 −3 Go to diff View file
A plugins/taskboard/tests/unit/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappedFieldRetrieverTest.php +85 −0 Go to diff View file
M plugins/taskboard/tests/unit/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappingFactoryTest.php +2 −68 Go to diff View file
A plugins/taskboard/tests/unit/Column/FieldValuesToColumnMapping/Freestyle/SearchMappedFieldStub.php +48 −0 Go to diff View file
M plugins/taskboard/tests/unit/Column/FieldValuesToColumnMapping/MappedFieldRetrieverTest.php +32 −24 Go to diff View file