stable

Clone or download

Read-only

feat: add a localized cache for closed artifacts

part of request #27896 Smart commit is not smart enough How to test: When you push two commits with closing references for the same artifact, only the first one will try to close it. There will be only one follow-up comment by Tracker workflow manager. Notes: A new cache is added to work around two other inline caches. There is an inline cache in \Tracker_ArtifactFactory::getArtifactById(), so we always get the same Artifact object for a given ID. There is another one for the artifact's status in Artifact::getStatus(). When combined, it means we get twice the same Artifact object and it always answers "true" for Artifact::isOpen(). This means that if we handle two commits with closing references to the same artifact in the same process, the code will try to close the artifact twice because it always thinks the artifact is open, because the status is cached. The new cache works around that by skipping artifacts that we know we have already closed. Change-Id: I00678d7136c05e3581fc78d380a3c9841e15b0e5

Modified Files

Name
M plugins/tracker/include/Tracker/Artifact/Closure/ArtifactClosingReferencesHandler.php +5 −0 Go to diff View file
A plugins/tracker/include/Tracker/Artifact/Closure/ArtifactWasClosedCache.php +41 −0 Go to diff View file
M plugins/tracker/include/trackerPlugin.php +2 −0 Go to diff View file
M plugins/tracker/tests/unit/Artifact/Closure/ArtifactClosingReferencesHandlerTest.php +20 −1 Go to diff View file
A plugins/tracker/tests/unit/Artifact/Closure/ArtifactWasClosedCacheTest.php +57 −0 Go to diff View file