qqeasonchen opened a new pull request, #5320:
URL: https://github.com/apache/eventmesh/pull/5320
Closes #5298. Closes #5305 (minimum-viable part shipped in this same PR).
## What
Per #5298, the flat `org.apache.eventmesh.common.*` namespace is partitioned
into
**internal / public** sub-packages. The split is enforced by a minimum-viable
`:eventmesh-architecture-guard` module (issue #5305) shipped in this same PR.
## Renames
- `org.apache.eventmesh.common.utils` →
`org.apache.eventmesh.common.util` (hard switch)
- 9 top-level `common.*` classes moved into sub-packages:
- `AbstractComponent`, `ComponentLifeCycle` → `common.lifecycle`
- `MetricsConstants` → `common.metrics`
- `EventMeshDateFormat`, `Pair`, `ResetCountDownLatch`, `ThreadWrapper`
→ `common.internal`
- `EventMeshThreadFactory`, `ThreadPoolFactory` → `common.util`
- `common.EventMeshMessage` `@Deprecated(forRemoval=true)`; replaced by
`common.wire.EventMeshFrame` (runtime) or
`common.protocol.tcp.EventMeshMessage` (legacy TCP)
## New annotations (source markers)
- `org.apache.eventmesh.common.Public` — public API surface
- `org.apache.eventmesh.common.Internal` — internal-only types
## New `package-info.java` (16 files)
One per `common` sub-package, documenting:
- allowed inbound dependencies
- modules that may import them
- `@Public` / `@Internal` policy
## Cleanup
- Removed dead SPI:
`META-INF/services/org.apache.eventmesh.common.remote.payload.IPayload`
(references nonexistent `common.remote.*` classes — would throw
`ServiceConfigurationError` at runtime)
## Architecture guard (#5305 minimum viable)
- New `:eventmesh-architecture-guard` module
- ArchUnit 1.3.0 rules:
1. `ruleInternalHidden` — downstream modules may not import
`common.internal.*`
2. `ruleHttpProtocolHidden` — non-`protocol-plugin` modules may not
import `common.protocol.http.*`
3. `ruleGrpcProtocolHidden` — non-`protocol-plugin` modules may not
import `common.protocol.grpc.*`
4. `ruleTcpProtocolHidden` — non-`runtime` modules may not import
`common.protocol.tcp.*`
5. `ruleOldUtilsRenamed` — `common.utils.*` no longer exists
- WARN mode in 1.13.0 (so existing violations don't break the build);
FAIL-on-violation from 1.14.0
- New Gradle task: `./gradlew.bat architectureCheck`
## Diff stat
```
118 files changed, 941 insertions(+), 122 deletions(-)
```
## Test plan
- [x] `git diff --check` (no whitespace errors)
- [x] All 1178 base blobs rebuilt; 117 new blobs in `f83adc4a2`
- [ ] CI: Build (ubuntu + macOS), Analyze (java + go), CodeQL
- [ ] `./gradlew.bat :eventmesh-common:check :eventmesh-runtime:check
:eventmesh-architecture-guard:test`
- [ ] Manual: confirm `EventMeshMessage` consumers migrated to
`wire.EventMeshFrame` or `protocol.tcp.EventMeshMessage`
## Notes
- Follows the `common.utils` → `common.util` hard rename agreed in the
discussion on #5298 (no `tools` / `helper` / other intermediates).
- Architecture guard ships WARN-only in 1.13.0; the FAIL-on-violation
upgrade will land in 1.14.0 once downstream modules stop reaching into
`common.internal.*`.
- D2 (dead `IPayload` SPI file) is the only cleanup bundled in; no other
unrelated changes.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]