stable
Clone or download
Part of story #35093 execute custom code as artifact post action The pipeline does exactly the same thing as REST route PUT /artifact/:id It uses the class PUTHandler which create a new changeset and trigger post actions. In this case the submitter is user forge_cce so the CCE pipeline is skipped *Testing:* First you need to compile the module: - `cd plugins/tracker_cce/wasm_module/post-action-add-comment` - `nix-shell` - `cargo build --target wasm32-wasi --release` Then you can upload it to the server for a new Tracker with just one field: Tracker administation > Workflow > Custom code execution Now go to your brand new tracker - Create/Update an artifact Logs show an error - Add fields `field_a`, `field_b`, `field_sum` - Create/Update an artifact The artifact has a new changeset submitted by forge__cce who add a comment and set value of `field_sum` - Set `field_a` and/or `field_b` value to a negative value Logs show an error Change-Id: Ia6201438b7fe2f4fcceadab89460538a2d748f96
Modified Files
Name | ||||
---|---|---|---|---|
M | plugins/tracker/include/Tracker/Artifact/PermissionsCache.php | +5 | −0 | Go to diff View file |
M | plugins/tracker/include/Tracker/FormElement/Tracker_FormElement.php | +4 | −0 | Go to diff View file |
M | plugins/tracker_cce/include/TrackerCCE/CustomCodeExecutionTask.php | +9 | −6 | Go to diff View file |
A | plugins/tracker_cce/include/TrackerCCE/WASM/ExecuteWASMResponse.php | +54 | −0 | Go to diff View file |
A | plugins/tracker_cce/include/TrackerCCE/WASM/WASMResponseExecutor.php | +36 | −0 | Go to diff View file |
M | plugins/tracker_cce/include/tracker_ccePlugin.php | +127 | −0 | Go to diff View file |
A | plugins/tracker_cce/tests/unit/Stub/WASM/WASMResponseExecutorStub.php | +62 | −0 | Go to diff View file |
M | plugins/tracker_cce/tests/unit/TrackerCCE/CustomCodeExecutionTaskTest.php | +27 | −1 | Go to diff View file |
M | src/common/User/CCEUser.php | +8 | −1 | Go to diff View file |