stable

Clone or download

Read-only

refactor: Extract isLinkKeyUsed from addReverseLinks

If we want to extract `addReverseLinks` outside of REST namespace, we have to remove REST specific bits. Call to isLinkKeyUsed should be moved because it is based on the analysis of the REST representation of the payload. Note to future us: Before, when one wanted to update an artficat link via REST, she would have to use the property `links` of the representation, with the list of artifact id to link (only Forward links were possible). In order to avoid a breaking change in the REST definition, we introduced `all_links` so that Tuleap can handle both Forward and Backward links. To avoid conflicts, it is not possible to use both `links` and `all_links` at the same time. Therefore if the property `links` is present in the payload, then it means that we can check the presence of `links` before adding a reverse link. No functional changes. Part of request #36805: Kanban item not found when creating a card in Kanban Change-Id: Ied5b363023812bac2e07f58108f5ce937a83e5b6

Modified Files

Name
M plugins/tracker/include/REST/Artifact/ArtifactCreator.php +6 −5 Go to diff View file
M plugins/tracker/tests/unit/REST/Artifact/ArtifactCreatorTest.php +34 −0 Go to diff View file