stable

Clone or download

Read-only

Closes request #32319: Create WASM module to check Tuleap tag format

At the moment of writing, the two tags format that are accepted for Tuleap are: 1) X.Y (Ex: https://tuleap.net/plugins/git/tuleap/tuleap/stable?a=tag&h=14.9) 2) @tuleap/<package_name>_A.B.C (Ex: https://tuleap.net/plugins/git/tuleap/tuleap/stable?a=tag&h=%40tuleap%2Fproject-sidebar_2.2.1) The created module checks that only tags of the above format are accepted. It will be used as a pre-receive hook on tuleap.net. How to build: - cd tools/utils/pre-receive-check-stable-tags - nix-shell - cargo build --target wasm32-wasi --release - cargo test --release How to test: - install wasmtime-cli - wasmtime target/wasm32-wasi/release/pre-receive-check-stable-tags.wasm < example/valid.json - It must return: {"rejection_message":null} - wasmtime target/wasm32-wasi/release/pre-receive-check-stable-tags.wasm < example/invalid.json - It must return: {"rejection_message":"the following tags [\"refs/tags/14\", \"refs/tags/@tuleap/project-sidebar_2.2\"] do not respect either of the imposed patern: X.Y or @tuleap/<package_name>_A.B.C"} Change-Id: I4a9582663b4b5b54c4842eec19101133fe742fe4

Modified Files

Name
A tools/utils/pre-receive-check-stable-tags/Cargo.lock +122 −0 Go to diff View file
A tools/utils/pre-receive-check-stable-tags/Cargo.toml +9 −0 Go to diff View file
A tools/utils/pre-receive-check-stable-tags/example/invalid.json +16 −0 Go to diff View file
A tools/utils/pre-receive-check-stable-tags/example/valid.json +16 −0 Go to diff View file
A tools/utils/pre-receive-check-stable-tags/shell.nix +10 −0 Go to diff View file
A tools/utils/pre-receive-check-stable-tags/src/main.rs +131 −0 Go to diff View file
A tools/utils/pre-receive-check-stable-tags/src/wire.rs +36 −0 Go to diff View file