yangjj-iso opened a new pull request, #7567:
URL: https://github.com/apache/shenyu/pull/7567
Fixes #7563.
The WASM modules expose host imports and lifecycle templates but lack a
versioned in-repository contract and a reference plugin exercised through a
running gateway. Missing optional exports also throw in Chicory instead of
returning the empty Optional expected by the templates.
This change documents host ABI v1, distinguishes adapter-specific
serialization/error policies from the abstract runtime, and defines a concrete
versioned request profile. A Spring Boot gateway test registers a Java adapter
and real Wasm token-gate guest, sends HTTP requests, and verifies selector/rule
delivery, request fields, guest decisions, chain behavior, configuration
updates/deletes and concurrent request isolation. Compiled failure fixtures
cover missing exports, traps, invalid memory and incompatible result versions;
lifecycle tests cover required metadata/discovery hooks and invalid export
kinds. All WAT sources and reproducible fixture build commands are included.
Export lookup now checks the module's export names before asking Chicory for
a function. Missing hooks remain optional, while invalid export kinds and
initializer failures propagate.
Validation (Java 17, Chicory 1.7.3):
- 37 WASM tests passed, including the existing 24 Rust/TinyGo tests and 13
new gateway/lifecycle tests.
- Both changed modules passed Checkstyle and Apache RAT.
- All 11 new fixture binaries reproduced identically with WABT 1.0.42.
```sh
./mvnw -B -ntp -pl
shenyu-plugin/shenyu-plugin-wasm-api,shenyu-plugin/shenyu-plugin-wasm-base \
-am test -Dtest='*Wasm*Test' -Dsurefire.failIfNoSpecifiedTests=false \
-DskipRemoteResources=true -Djacoco.skip=true
./mvnw -B -ntp -pl
shenyu-plugin/shenyu-plugin-wasm-api,shenyu-plugin/shenyu-plugin-wasm-base \
checkstyle:check apache-rat:check
make -C shenyu-plugin/shenyu-plugin-wasm-base/src/test/wasm-gateway build
```
The test uses the same gateway starter as shenyu-bootstrap on a random HTTP
port. Configuration enters through the gateway-side subscriber; Admin
persistence and remote synchronization transports are outside its scope.
- [x] Read the contribution guidelines.
- [x] Submit test cases backing the changes.
- [ ] Full-repository `./mvnw clean install -Dmaven.javadoc.skip=true`
(validation scoped to the affected modules and their dependencies).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]