•  
     
    story #31077 deploy a WebAssembly module to validate incoming references as a pre-receive hook
Summary
Git administrator
deploy a WebAssembly module to validate incoming references as a pre-receive hook

new references pushed to a git repository can be validated on the spot by custom code (in the form of a WebAssembly module)

This is the continuation of story #28845, it consist of doing the same actions as the tuleap git:pre-receive-analyze command, but instead of performing the reference analysis retroactively, to do it right away when new references are pushed, like a Git pre-receive hook

  • a git pre-receive hook installed on every git repository is in charge of calling PHP code to check if a WASM module is setup for the repository where a push is happening, if that's the case it executes the WASM module
  • when a WASM module is executed, it either exits without any output with the exit code 0 if everything is expected or with a message and an exit code 1 if the objects should be rejected
  • If no module is setup for a repository the pre-receive hook systematically return 0 to accept the incoming changes
  • there is no way to upload a WASM module at this time, the files must be put at a specific path on the filesystem (/var/lib/tuleap/untrusted-code/git/pre-receive-hook/<repo-id>.wasm)
  • when all of the above is functional, the tuleap git:pre-receive-analyze is removed as this feature supersedes the command
Empty
Empty
Status
SCM/Git
Done
Development
  • [ ] Does it involves User Interface? 
  • [ ] Are there any mockups?
  • [ ] Are permissions checked?
  • [ ] Does it need Javascript development?
  • [ ] Does it need a forge upgrade bucket?
  • [ ] Does it need to execute things in system events?
  • [ ] Does it impact project creation (templates)?
  • [ ] Is it exploratory?
Empty
Details
#31077
Thomas Piras (tpiras)
2023-06-14 14:47
2023-02-17 10:22
32682

References
Referencing story #31077

Git commit

tuleap/tuleap/stable

Centralize gitolite hooks deployment inside site-deploy:gitolite3-hooks cmd c44db8d8b0
Fix deployment of the gitolite post-receive hook 5a410e1934
Deploy a new pre-receive hook inside every git repository 1dbf56c8f6
Package the Wasmtime lib wrapper b95fbd0a4c
Global pre-receive hook executes WASM module to determine if incoming push should be accepted a5d8e55aeb
Separate concerns between what is related to the WASM call and the pre-receive logic daec7b0c51
Disable Wamstime features not needed in Tuleap context aaf2b263d6
Add Clippy to wasmtime-wrapper-lib packaging process ac60ae3993
Add logging and monitoring for git:pre-receive b93c8c68a1
Add logging and monitoring for git:pre-receive 72a861e347
Fix gitolite-admin repository being impacted by our pre-receive hook 7d0d135812
Do not filter protected git references 8a50dbb333
Preload FFI bindings during startup 8336544ba8
Use a temporary dir with a fallback to /tmp when checking preload file b3bc86e4be
Reverse the feature flag for the git:pre-receive command 0371fc7799

Follow-ups

User avatar
Thomas Gerbet (tgerbet)2023-06-14 14:47

Closing this as all the points listed in the acceptance criteria have been dealt with. A new user story can be created to add the ability the repositories content in read only.


  • Status changed from On going to Done