Repository navigation
httpSteps: run .http files as Synthetics steps, and export them as monitors - #43
Merged
Merged
Conversation
…nitors A monitor for an endpoint with no page, such as an MCP server, is a .http file. httpSteps runs one step per request on Playwright's request context, with the @expect and @readonly semantics and messages of Nullean.HttpFileParser, on a TypeScript subset of its parser that refuses what a monitor cannot run. The exporter writes a .http file that has @monitor to *.http.journey.ts, read-only like any other monitor. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mpdreamz
force-pushed
the
feature/http-steps
branch
from
November 10, 2026 13:28
bbb79ae to
9a36128
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
httpStepsto@nullean/journeys/synthetics, which runs a.httprequest file as a Synthetics journey with one step per request, and makesjourneys export-syntheticsexport.httpfiles that have@monitor.Stacked on #42: its base is that branch, so retarget to
mainonce #42 merges.Why
An endpoint with no page, such as the docs MCP server, has no journey to write. Its checks are already
.httpfiles fordotnet test(nullean/snapshots, with# @expectand# @readonlysince #48 and #49), and a monitor should run the same file.What
###names, file variables,{{ }}references (variables,$processEnv,$env,$secret,$guid,$uuid,$timestamp,$isoTimestamp,$randomInt, andname.response.body…andname.response.headers…),@readonly,@expect,@no-redirectand@timeout. Everything else (file bodies, environments,$datetime, JetBrains scripts, cURL, GraphQL) is refused with a reason and a line, with Nullean.HttpFileParser's wording.dotnet test. A 404 is a response.@expect status 200|2xx,header … ~ …andjson $.a[*].b equals|contains …give the .NET messages. A read-only run sends only GET, HEAD and OPTIONS, plus requests marked# @readonly.@tags,@requires,@monitor,@alertand@mutatesgo in the comments before the first request, using the journey grammar (MetadataBuilderis now exported fromparse.ts). Nullean.HttpFileParser reads them as plain comments, so the same file still runs indotnet test.*.http.journey.tswithhttpSteps({ request, step, params }, …), the same context embedding,readOnly: true, and an error when two sources would share a monitor id.docs/journeys/playwright.mddocuments it, including what is refused, andDECISIONS.mdrecords the choices.Verify
test/http.test.tscovers parsing, the refusals and every message, JSONPath, and running against a local server through Playwright's realrequestcontext: ordered requests, variables, a response value passed to the next request, expectations, read-only, run headers,@no-redirect.export-live.test.tsnow also runs an.httpmonitor under the real@elastic/syntheticsCLI, passing, and failing at the request whose@expectdoes not hold. I broke the read-only refusal, the status check,equalsand the response memory in turn, and each made a test fail.Not tested: a push to Kibana. Gaps: the .NET and TypeScript parsers are not yet run against shared fixtures; the TS tests restate the .NET messages. JSON numbers compare as JavaScript reads them (
1.0is1). Exported.httpmonitors still start a browser, because a Synthetics journey does.