Skip to content

Document how to verify the ThingsBoard compile-only surface - #121

Open
PDGGK wants to merge 1 commit into
apache:masterfrom
PDGGK:docs/verify-thingsboard-surface
Open

Document how to verify the ThingsBoard compile-only surface#121
PDGGK wants to merge 1 commit into
apache:masterfrom
PDGGK:docs/verify-thingsboard-surface

Conversation

@PDGGK

@PDGGK PDGGK commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Why

iotdb-thingsboard-table implements ThingsBoard storage SPIs but cannot depend on ThingsBoard at build time — neither org.thingsboard.common:data nor org.thingsboard:dao is published to Maven Central (numFound 0 for both). src/provided/java therefore carries a compile-only surface of the types the module touches, excluded from the built jar so the real ThingsBoard classpath supplies them at runtime.

That keeps the module buildable for everyone. Its one cost is that a hand-written surface can drift from the real interfaces and nothing in the default build would notice.

What this adds

A procedure for checking that it has not drifted: build the two ThingsBoard modules locally, swap the compile-only surface for the real artifacts, run the suite. It is deliberately not wired into the default build — doing so would require every contributor and every CI run to clone and build ThingsBoard first, which is the situation the compile-only surface exists to avoid.

Two things I tried to make it earn its place:

  • A control. A green build proves nothing on its own: if the compile-only sources are still on the source path, everything compiles exactly as before. The doc gives the check — Compiling 58 source files with the surface, 19 without — so a reader can catch the procedure silently not having taken effect.
  • The traps, written as traps. commons-lang3 must match the version ThingsBoard pins (3.18.0 for 4.3.1.2); with an older one, every test in a suite touching EntityType fails at static initialisation with NoClassDefFoundError, which looks like drift and is not. And verify runs apache-rat, so a file added while working through the procedure fails the build after the tests have passed.

Result recorded in the doc

Against ThingsBoard 4.3.1.2, with the compile-only surface removed and the real artifacts on the classpath: 190 unit tests and 57 container integration tests green, no drift — every type matched and all three implements clauses bound against the real interfaces.

This does not establish that ThingsBoard as a whole runs on this DAO; the doc says so explicitly.

Notes for review

Documentation only — one new file, no build or code changes, so no workflow approval is needed for this one. Both commands in it were run exactly as written, without skip flags, and apache-rat passes with the file in place.

The iotdb-thingsboard-table module implements ThingsBoard storage SPIs but
cannot depend on ThingsBoard at build time: neither org.thingsboard.common:data
nor org.thingsboard:dao is published to Maven Central. src/provided/java
therefore carries a compile-only surface of the types the module touches,
excluded from the built jar so the real classpath supplies them at runtime.

That keeps the module buildable for everyone, at the cost that the surface can
drift from the real interfaces with nothing in the default build noticing. This
adds the procedure for checking that it has not: build the two ThingsBoard
modules locally, swap the compile-only surface for the real artifacts, and run
the suite.

The procedure is deliberately not wired into the default build, since that would
require every contributor and every CI run to clone and build ThingsBoard first.

Includes a control for confirming the surface was actually removed -- a green
build proves nothing if the compile-only sources are still on the source path --
and records the result against ThingsBoard 4.3.1.2: 190 unit tests and 57
container integration tests green, no drift.

Signed-off-by: Zihan Dai <99155080+PDGGK@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant