Skip to content

feat: COR_HTTP_SERVER=builtin — a broker with no HTTP library - #67

Merged
kzangeli merged 2 commits into
mainfrom
feat/corhttp-builtin-backend
Sep 5, 2026
Merged

feat: COR_HTTP_SERVER=builtin — a broker with no HTTP library#67
kzangeli merged 2 commits into
mainfrom
feat/corhttp-builtin-backend

Conversation

@kzangeli

@kzangeli kzangeli commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #66, which is where the switch was plumbed. Base retargets to
main automatically when #66 merges. Needs corRest#8 (and, for the nightly's
builtin legs only, corLibs#7).

ldd coraine | grep microhttpd     # mhd:     one line
                                  # builtin: nothing
functests ETSI
mhd 641/641
builtin 640/640 1046/1046

Plus 147/147 E:0 L:0 F:0 valgrind over the notification/subscription/distop
cases under builtin.

--version gains a httpServer: line

Not folded into features: above it. Those are booleans answering is this
capability in the build
; this is a choice between two implementations of a
capability that is always in it — a feature name whose "off" would mean nothing.
It is also read differently, which is the part that matters: the harness
registers -httpServer with the tag HTTPSERVER, so a test says
REQUIRE_HTTPSERVER: mhd and means one current value out of alternatives,
where REQUIRE_FEATURE: A B means A and B. Detected from the binary, and
NONE when it cannot be asked, so a failed detection makes the marker inert
instead of filtering out every test carrying one.

Exactly one test needs it: the built-in server has no TLS, so the HTTPS
notification receiver cannot be raised against it. The broker's own side —
notifying an https endpoint — is the client stack and is the same in both.

Three steps of query_entities_scope that had never tested what they said

Steps 08, 16 and 20 send the NGSI-LD single-level scope wildcard,
scopeQ=/Madrid/+/ParqueNorte, and each expected []. A query string is
form-encoded in practice, so a raw + on the wire is a space to any server
that reads it: the broker was asked for a middle level consisting of one space,
matched nothing, and answered 200 with an empty array. Three green steps
asserting that the wildcard does not work. Percent-encoded (%2B) both servers
hand the broker the + the spec means, and the steps now assert the matches
their own comments always claimed.

Step 16 then also matches E4: /Madrid/%2B/# covers /Madrid/Districts,
because # matches its own level and not only the levels below it.

The nightly runs both servers

A PR builds one — mhd, the default — so nothing on a PR would notice builtin
rotting, and doubling a two-minute check to answer a question that changes once
a month is the wrong trade. COR_HTTP_SERVER is now a matrix axis on the two
nightly jobs that answer it: valgrind (4 shards × 2 servers — a valgrind run
is a functional run too, so one matrix covers passes and leaks) and etsi
(2 servers — the six TPs the built-in server first failed were query strings the
functional suite never sends).

🤖 Generated with Claude Code

https://claude.ai/code/session_01TGatXwrHx1CreL49sCuS37

kzangeli and others added 2 commits September 5, 2026 21:45
    ldd coraine | grep microhttpd     # mhd:     one line
                                      # builtin: nothing

`builtin` was refused at configure time because the backend it selected did not
exist. It exists now (corRest, corHttp), so the refusal goes and libcorHttp.a
joins the link — after libcorRest.a, since that is what calls into it.

    full build (mhd)      641 tests, 641 passed
    built-in              640 tests, 640 passed
    ETSI, built-in       1046 TPs,  1046 passed

`coraine --version` gains a `httpServer:` line. NOT folded into `features:`
above it: those are booleans answering "is this capability in the build", and
this is a choice between two implementations of a capability that is always in
it — a feature name whose "off" meant nothing. It is also READ differently, and
that is the part that matters here: the harness registers `-httpServer` with the
tag HTTPSERVER, so a test file says `REQUIRE_HTTPSERVER: mhd` and means "one
current value out of alternatives", where `REQUIRE_FEATURE: A B` means "A and
B". Detected from the binary like COR_TEST_FEATURES, and NONE when the binary
cannot be asked, so a failed detection makes the marker inert instead of
filtering out every test that carries one. GET /build already reports the same
thing to a running broker; this line is what answers before one has started.

Exactly one test needs the marker: the built-in server has no TLS, so the HTTPS
notification receiver cannot be raised against it. The broker's own side —
notifying an https endpoint — is the client stack and is the same in both.

⭐ AND THREE STEPS OF query_entities_scope THAT HAD NEVER TESTED WHAT THEY SAID.

Steps 08, 16 and 20 send the NGSI-LD single-level scope wildcard,
`scopeQ=/Madrid/+/ParqueNorte`, and each expected `[]`. A query string is
form-encoded in practice — urlencode/quote_plus is what every HTTP client
library produces — so a raw `+` on the wire is a SPACE to any server that reads
it: the broker was asked for a middle level consisting of one space, matched
nothing, and answered 200 with an empty array. Three green steps asserting that
the wildcard does not work. Percent-encoded, `%2B`, both servers hand the broker
the `+` the spec means, and the steps now assert the matches their own comments
have always claimed.

Step 16 turns out to match E4 as well: `/Madrid/%2B/#` covers `/Madrid/Districts`
because `#` matches its own level and not only levels below it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TGatXwrHx1CreL49sCuS37
A pull request builds ONE of them — `mhd`, the default — so nothing on a PR
would notice `builtin` rotting. Doubling the two-minute PR check to answer a
question that changes once a month is the wrong trade; the nightly is where the
slow half already lives.

So `COR_HTTP_SERVER` becomes a matrix axis on the two jobs that answer it:

  valgrind    4 shards x 2 servers. A valgrind run is a FUNCTIONAL run as well -
              it fails on an output mismatch exactly as the plain suite does - so
              one matrix answers both "does it still pass" and "does it still
              leak". Which is the pairing that matters here: the built-in server
              arrived with a use-after-the-connection-moved-on and a deadlock.

  etsi        2 servers. A conformance claim is about the DEPLOYMENT, and the
              HTTP server is part of the deployment. The six TPs the built-in one
              first failed were all query strings the functional suite never
              sends — `q=name=="Eiffel Tower"`, form-encoded, with the space on
              the wire as a `+` — so the functional suite could not have caught
              them, and did not.

COR_HTTP_SERVER goes on `make di`, which passes it down to corRest's own make as
well as to cmake. Setting it on one side only links a broker against a corRest
compiled the other way, and nothing reports that. `coraine --version` is echoed
after the build so the job's log says which server it actually got.

Artifact names carry the leg (`etsi-results-builtin`, `valgrind-builtin-1-156`):
two jobs uploading one artifact name is a conflict whose winner is whichever
finished last.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TGatXwrHx1CreL49sCuS37
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 coraine | 🛠️ Build #34410939 | 📁 Comparing e3b628d against latest (91fb0b2)

  🔍 Preview build  

1 file changed
± building.html

Base automatically changed from feat/conditional-compilation-subscriptions to main September 5, 2026 20:46
@kzangeli
kzangeli merged commit f0e7e14 into main Sep 5, 2026
8 checks passed
@kzangeli
kzangeli deleted the feat/corhttp-builtin-backend branch September 5, 2026 20:46
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