stable

Clone or download

Read-only

refactor: Extract cache out of ProgramAdapter

part of request #39352 Program add to top backlog post-action should ignore Teams No functional change. The number of DB queries to check that a user can access a Program should stay the same. Why? Caches should leverage interfaces. By making a cache implement the same interface and "wrap" the real implementation, we can substitute it everywhere it's needed. It also splits responsibilities: managing a cache is not the same as "doing the actual stuff". It's also much easier to unit test when no cache is involved. This also inlines a bypass parameter that was always null. Change-Id: Ie0c06a8dd063a1b4718b8dd8860f9e94a701d886

Modified Files

Name
M plugins/program_management/include/Adapter/Program/Backlog/AsynchronousCreation/IterationCreationProcessorBuilder.php +3 −3 Go to diff View file
M plugins/program_management/include/Adapter/Program/Backlog/AsynchronousCreation/ProgramIncrementCreationProcessorBuilder.php +3 −3 Go to diff View file
A plugins/program_management/include/Adapter/Program/Plan/CachedProgramBuilder.php +91 −0 Go to diff View file
M plugins/program_management/include/Adapter/Program/Plan/ProgramAdapter.php +7 −50 Go to diff View file
M plugins/program_management/include/Domain/Program/Admin/Configuration/ProgramAdmin.php +2 −3 Go to diff View file
M plugins/program_management/include/Domain/Program/Plan/ProjectIsAProgramOrUsedInPlanChecker.php +1 −2 Go to diff View file
M plugins/program_management/include/Domain/Program/ProgramIdentifier.php +3 −4 Go to diff View file
M plugins/program_management/include/REST/v1/ProgramIncrementResource.php +2 −2 Go to diff View file
M plugins/program_management/include/REST/v1/ProjectResource.php +7 −8 Go to diff View file
M plugins/program_management/include/program_managementPlugin.php +18 −24 Go to diff View file
A plugins/program_management/tests/unit/Adapter/Program/Plan/CachedProgramBuilderTest.php +85 −0 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Plan/ProgramAdapterTest.php +49 −36 Go to diff View file
M plugins/program_management/tests/unit/Tests/Stub/ProjectIsAProgramOrUsedInPlanCheckerStub.php +1 −2 Go to diff View file
M plugins/program_management/tests/unit/Tests/Stub/VerifyIsProjectAProgramOrUsedInPlanStub.php +5 −0 Go to diff View file
M tests/lib/Stubs/CheckProjectAccessStub.php +12 −15 Go to diff View file