stable

Clone or download

Read-only

refactor: introduce NeverThrow and Fault lib

part of story #26802 have smart commit with Tuleap Git No functional change expected in GitLab artifact closure. Notes: This introduces Fault base class for error handling, alongside the union type Ok|Err. Fault is meant to represent non-fatal "errors", such as "the user does not have permission to do something". Ok|Err allows us to easily chain multiple operations that could fail. Change-Id: I8210a753584a4f889cd18b148e7a700576318a1a

Modified Files

Name
A adr/0012-faults-over-exceptions.md +134 −0 Go to diff View file
A adr/0013-neverthrow.md +123 −0 Go to diff View file
M adr/index.md +2 −0 Go to diff View file
M lib/frontend/fault/README.md +3 −1 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostPush/PostPushCommitArtifactUpdater.php +20 −4 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostPush/PostPushWebhookCloseArtifactHandler.php +5 −1 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostPush/PostPushCommitArtifactUpdaterTest.php +13 −6 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostPush/PostPushWebhookCloseArtifactHandlerTest.php +3 −1 Go to diff View file
A src/common/NeverThrow/Err.php +98 −0 Go to diff View file
A src/common/NeverThrow/Fault.php +83 −0 Go to diff View file
A src/common/NeverThrow/IResult.php +137 −0 Go to diff View file
A src/common/NeverThrow/Ok.php +96 −0 Go to diff View file
A src/common/NeverThrow/README.md +397 −0 Go to diff View file
A src/common/NeverThrow/Result.php +77 −0 Go to diff View file
M tests/psalm/psalm.xml +1 −0 Go to diff View file
A tests/unit/common/NeverThrow/ErrTest.php +127 −0 Go to diff View file
A tests/unit/common/NeverThrow/FaultTest.php +90 −0 Go to diff View file
A tests/unit/common/NeverThrow/OkTest.php +127 −0 Go to diff View file
A tests/unit/common/NeverThrow/ResultTest.php +40 −0 Go to diff View file
A tests/unit/common/NeverThrow/Tests/CustomErrorType.php +33 −0 Go to diff View file
A tests/unit/common/NeverThrow/Tests/CustomValueType.php +33 −0 Go to diff View file
A tests/unit/common/NeverThrow/TypeTest.php +266 −0 Go to diff View file