stable

Clone or download

Read-only

feat: Skip redis dispatch if option is not enabled

part of story #26802 have smart commit with Tuleap Git How to test: - run forgeupgrade - enable the option on one of your repositories: UPDATE plugin_git SET allow_artifact_closure = 1 WHERE repository_id = ?; - Push a commit in that repository - You should see a debug line in git_syslog like the following: [debug] Dispatched a redis message to handle git push - if you disable the option, the line does not appear in the logs, which means the process is skipped. Notes: For now, the new "allow_artifact_closure" option is always disabled. It will allow developpers to enable it for test repositories without breaking anything for end-users. The UI and other ways of writing it will come in later contributions. Change-Id: I5da3fbaa5cc63ed2d52d3c002e4dbf3038aecef0

Modified Files

Name
M plugins/git/db/install.sql +1 −0 Go to diff View file
A plugins/git/db/mysql/updates/2022/202206021554_add_allow_artifact_closure.php +45 −0 Go to diff View file
M plugins/git/hooks/post-receive.php +3 −1 Go to diff View file
A plugins/git/include/Git/Repository/Settings/ArtifactClosure/VerifyArtifactClosureIsAllowed.php +28 −0 Go to diff View file
M plugins/git/include/GitDao.class.php +10 −1 Go to diff View file
A plugins/git/include/Hook/DispatchGitPushReception.php +28 −0 Go to diff View file
A plugins/git/include/Hook/GitPushReceptionDispatcher.php +37 −0 Go to diff View file
M plugins/git/include/Hook/PostReceive.php +19 −2 Go to diff View file
M plugins/git/tests/unit/Hook/PostReceiveTest.php +36 −5 Go to diff View file
A plugins/git/tests/unit/Stub/DispatchGitPushReceptionStub.php +45 −0 Go to diff View file
A plugins/git/tests/unit/Stub/VerifyArtifactClosureIsAllowedStub.php +47 −0 Go to diff View file