Commit Graph
91 Commits
Author SHA1 Message Date
Pierre Tachoire d00e6e6e4f ci: enable cors 2026-09-07 09:43:26 +02:00
Karl Seguin 7d39a4fbaf http: handle redirects better
Our redirect handling was "optimized" to re-use the same easy connection, at the
cost of circumventing the entire pipeline. A redirect would not check the new
target's robots.txt, rate limit, CORS, Web Auth, ...

The new code simply restarts the pipeline (with a discriminator tag so that
things like CDP can tell the difference between a redirected request and a new
one).
2026-09-02 12:41:53 +08:00
Karl Seguin 857a8ea643 ci: enable bidi protocol for all e2e tests 2026-09-01 09:51:27 +08:00
Karl Seguin 731774ab67 ops: Allow serving both cdp and bidi on the same port
--protocol can now be specified multiple times. This just makes ops/dev easier
by only requiring 1 instance.
2026-08-31 22:45:15 +08:00
Karl Seguin 766c0d05d6 bidi: protocol selection CLI, start of [classic] WebDriver
In order to support Selenium the way people are used to, it looks  like we need
to support both WebDriver classic (WebDriver) and WebDriver BiDi (BiDi). Typical
scripts look like a mix of the two, e.g. using WebDriver to control the browser
and using BiDi  to receive notifications. This commit:

1 - adds a --protocol (cdp|webdriver) CLI argument to the `serve` command to
    enable one or the other protocol (defaulting to CDP)

2 - adds basic WebDriver endpoint to let a Selenium client connect. This
    implementation is hackish and sits on top of our simple Handshake handler.

The handshake handler is well past its original design. Serving /json/version
and /metrics from it was one thing. But Driving the entire browser session? This
will get a follow up PR.
2026-08-31 22:45:15 +08:00
Karl Seguin 313803c354 CI: Lower MAX_VmHWM to 24 (down from 28)
orderfile PRs (https://github.com/lightpanda-io/browser/pull/3271 and
https://github.com/lightpanda-io/browser/pull/3285) has dropped memory usage to
~23.6. Rather than hitting 28MB in 2-3 months time and not knowing how we got
there, I'd rather get slow/incremental notices.
2026-08-29 11:41:12 +08:00
Karl Seguin 585ed9b93c agent regression explictly load workers and iframes 2026-08-27 18:32:36 +08:00
Karl Seguin 7a6774a278 enable worker/iframe in 2nd e2e test 2026-08-27 17:27:31 +08:00
Karl Seguin db258bfec4 breaking: disable worker and iframe loading by default
By default, iframes and workers no longer loaded. Use `--load-resources iframe`
and `--load-resources worker` to restore the previous behavior. The disabling
makes resource loading more consistent.

To further make things more consistent, Config seems the following changes:

1. remove  `--timeout` from `serve` which does nothing but has printed a
   deprecation warning for a long time

2. added .deprecated field to CLI config flags which now logs the specified
   deprecated warning when used

3. `--log-filter-scopes` is deprecated in favor of `--log-scopes`

4. `--disable_subframes` is deprecated. Iframe loading is disabled by default,
    use `--load-resources iframe` to enable iframe loading

5. `--disable_workers` is deprecated. Worker loading is disabled by default,
    use `--load-resources worker` to enable worker loading

6. `--enable_external_stylesheets`  is deprecated. Stylesheets remain disabled
    by default. Use `--load-resources stylesheet` to enable loading external
    stylesheets

CLI log parameters now alter the logger behavior on parse. This helps minimze
the window where default log settings are in-play. It also means things like
this work:

```
./lightpanda --log-level fatal --disable_subframes --log-level warn
```

More seriously, there's now an optional `beforeParse` fired once the mode is
known. This is used by mcp to set the default log level to logfmt. Previously
this was done much later and could easily result in a mix of pretty and logfmt
logs.
2026-08-27 17:25:42 +08:00
Karl Seguin 98ff4b9b4d CI: bump timeout from 20 to 30 for e2e-test
Mimic's https://github.com/lightpanda-io/browser/pull/3294

I looked into this a little bit, and the main issue is that we build the binary
in releasefast twice: once for the snapshot and once for the browser itself.
Each build takes ~10 minutes.

The snapshot cache almost always misses (since any change to webapi/*
invalidates it). I don't see a great solution.
2026-08-27 13:54:30 +08:00
Karl Seguin ee1fd9207c mem: On linux CI builds, use an orderfile
CI build, for e2e-test and nightly now build with:
-Dorderfile/lightpanda.ld

This file informs the build on how to organize the code in the binary, grouping
hot code together so that we have to load less of the binary into memory.

lightpanda.ld will drift: we'll refactor our code, add new features, update
dependencies, update Zig, ... So it has to be re-generated. But we can do that
automatically in the CI (say, before the nightly build). That's for a follow up
PR.

This does not currently cover V8. V8 is being build with
`-no-unique-section-names`, so we don't get names that we can correctly
organize. The real win comes from doing this in V8, since a lot of V8 is cold.
This PR can land as-is, a zig-v8-fork PR will remove that flag, and then we can
have a follow up PR with an lightpanda.ld that includes the v8 symbols.

This is opt-in (via the -Dorderfile flag) because it adds ~20 seconds of
linking time.
2026-08-25 21:02:31 +08:00
Thibaud-Vdb cca00c022e ci: pin github actions to commit shas
Mutable tags like @v6 can be re-pointed by whoever controls the action,
so the next run executes code nobody here reviewed, with the job's
token and secrets. Pinning to the full commit sha freezes what runs.
Version tags are kept as comments so renovate or dependabot can still
track updates.

dtolnay/rust-toolchain is pinned to a master commit with the toolchain
moved to an explicit input, as its readme recommends for sha pinning.
2026-07-20 14:56:59 +02:00
Adrià Arrufat 52a8779f2a Merge branch 'main' into agent-regression 2026-07-07 11:43:12 +02:00
Adrià Arrufat bd95d9a610 test: consume agent regression suite from lightpanda-io/demo
The suite moved to the demo repo (machinery in agent/, targets the
existing public/ sites — lightpanda-io/demo#206). Delete the in-repo
copy and point the agent-deterministic job, agent-regression.yml, and
make test-agent at the demo checkout, passing the binary via LPD_PATH
(the same variable wptrunner uses) — same consumption model as
runner/integration/wpt.

Includes a temporary push trigger on agent-regression.yml to validate
the cross-repo wiring pre-merge; dropped before merging.
2026-07-03 09:59:29 +02:00
Adrià Arrufat f191410773 test: add agent regression suite
Two layers driven by test/agent/run.sh:

- deterministic: replay a golden PandaScript against frozen local HN
  fixtures and diff the returned JSON exactly against a golden file.
  No API key, no network; gates every PR via e2e-test.yml.

- live (GOOGLE_API_KEY): closed-form Q&A over a local fixture page
  (substring match), and a live Hacker News scrape saved with --save,
  replayed token-free and validated against a jq shape invariant.
  Runs nightly and on demand via agent-regression.yml.

The live output contract lives in cases/hn-live.task (prompt) +
schemas/hn-live.jq (invariant). Model pinned to gemini-3.5-flash in
run.sh; per-task timeouts and a $usage token ceiling guard runaway
loops. make test-agent for local runs.
2026-07-02 09:40:22 +02:00
Halil Durak 5e567adf1b ci: run serve command with TLS host verification disabled 2026-07-02 08:46:21 +03:00
Pierre Tachoire 41cff18e75 ci: save LP cache for integration tests 2026-06-08 10:56:26 +02:00
Pierre Tachoire d68f1a48ad ci: always enable cache with e2e test 2026-05-28 11:25:47 +02:00
Pierre Tachoire a15c04de4b ci: remove cdp logs from end to end tests 2026-05-19 17:32:13 +02:00
Adrià Arrufat 8981a6245c ci: tighten mcp-smoke jq assertions
Replace `grep '"id":N' | jq -e ...` with `jq -ec 'select(.id == N) | ...'`.
The grep form also matched `"id":10`, `"id":11`, ... and any tool description
containing that substring; numeric `select` is type-correct. `jq -e` still
fails the job when `select` produces no output (exit 4), so the smoke
semantics are preserved.

Also add `jq --version` up front so the job fails fast and loud if the
`ubuntu-latest` image ever stops shipping jq.
2026-05-17 10:43:03 +02:00
Pierre Tachoire 803e4303c2 Merge pull request #2481 from navidemad/ci-mcp-smoke
ci: smoke test the MCP stdio server
2026-05-17 10:39:18 +02:00
Karl Seguin a5c1068b85 Force kill lightpanda between steps to prevent "port already in-use" error in CI 2026-05-16 08:39:53 +08:00
Navid EMAD f08a1fef12 ci: smoke test the MCP stdio server
Sends initialize + notifications/initialized + tools/list over stdin
and asserts the JSON-RPC responses with jq. Catches regressions in
the agentic surface (./lightpanda mcp) without needing a node client.

Reuses the existing lightpanda-build-release artifact, so the new
job costs about a minute on top of zig-build-release.
2026-05-15 22:53:38 +02:00
Karl Seguin 2bcf9a22d5 Disable cache=true from e2e matrix
cache=true is problematic for a few reasons

1 - The current cache implementation is known to cause timing issues; i.e. it
    executes callbacks synchronously.

2 - Unlike something like robots.txt or proxy, cache tests need to be explicitly
    tested. The response has to include cache headers and the resource loaded
    again.
2026-05-13 17:52:46 +08:00
Pierre Tachoire ba28324a9e ci: save cdp logs by using cdpproxy 2026-04-30 12:35:30 +02:00
Pierre Tachoire ece2ec3753 ci: create a matrix for e2e tests 2026-04-28 09:31:54 +02:00
Karl Seguin a9e4ee41e3 Update go run ws/main.go to new go run runner/main.go -serve 2026-04-24 15:56:46 +08:00
Pierre Tachoire 36fcb0fd7f ci: use a longer timeout for e2e test
When we have to generate a snapshot, the build duration is longer.
2026-04-10 11:02:04 +02:00
Pierre Tachoire 90069f6ab8 ci: use a dedicated action for v8 snapshot 2026-04-10 10:13:27 +02:00
Pierre Tachoire ca78bd7786 ci: invalidate snapshot cache on src/browser/js/Snapshot.zig 2026-04-10 09:52:43 +02:00
Pierre Tachoire 075a660b2f ci: use cache for snapshots
Add a cache for v8 snapshot file.
Use a cache key for v8 snapshot with the last hash changing
src/browser/js/bridge.zig
eg. v8-snapshot-4dcb2c997e01e4367ca6118629fb4ac712f9692c
2026-04-10 09:26:32 +02:00
Karl Seguin 5c7a665d11 run e2e-test with pre-generated snapshot 2026-04-09 18:54:31 +08:00
Pierre Tachoire 7606528b37 ci: fix request interception proxy challenge 2026-03-30 15:32:38 +02:00
Pierre Tachoire e83b8aa36d ci: don't run wba test on PR
wba test requires secrets read to run.
But we don't want to exposes secrets on external contributions.
So it's easier to run it only after PR merged.
2026-03-25 16:55:45 +01:00
Pierre Tachoire 3a0cead03a Merge pull request #1917 from lightpanda-io/semantic-versioning
build: automate version resolution in build.zig
2026-03-25 08:46:04 +01:00
Karl Seguin 61dabdedec Support (and prefer) dash-separated command line arguments
--log_level -> --log-level

Underscored arguments are still supported for backwards compatibility.
2026-03-24 12:55:08 +08:00
Adrià Arrufat f1293b7346 Merge branch 'main' into semantic-versioning 2026-03-20 07:04:05 +09:00
Pierre Tachoire 59175437b5 wpt: force a wakeup of the wbauth server before the test 2026-03-19 09:40:47 +01:00
Pierre Tachoire e950384b9b ci: sleep 5s to wait node startup 2026-03-19 09:36:47 +01:00
Adrià Arrufat 2dbd32d120 build: automate version resolution in build.zig
Removes manual git flags from CI and build scripts.
Versioning is now automatically derived from git and build.zig.zon.

With this PR, we follow https://semver.org/
Logic:

1. Read the version from build.zig.zon
2. If it doesn't have a `.pre` field (i.e. dev/alpha/beta) it will use that
3. Otherwise it will get the info from git: hash and number of commits since last `.0` version
4. Then build the version: `0.3.0-dev.1493+0896edc3`

Note that, since the latest stable version is `0.2.6`.
The convention is to use `0.3.0-dev`, as:
- `0.2.6` < `0.3.0.dev` < `0.3.0`
2026-03-19 13:03:29 +09:00
Nikolay Govorov c0c4e26d63 removes artifacts of the past from CI 2026-03-17 14:24:22 +00:00
Pierre Tachoire 91a2441ed8 Merge pull request #1829 from salmanmkc/upgrade-github-actions-node24
Upgrade GitHub Actions for Node 24 compatibility
2026-03-16 12:19:22 +01:00
Pierre Tachoire dac456d98c ci: fix wba flaky test
Sometimes the GHA secret isn't dump in file correctly.
So this commit inject the value directly to the command line
2026-03-16 10:57:40 +01:00
Salman Muin Kayser Chishti bf6dbedbe4 Upgrade GitHub Actions for Node 24 compatibility
Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
2026-03-14 09:11:46 +00:00
Pierre Tachoire 0e48f317cb ci: add a longer sleep to wait for node start on wba test 2026-03-13 12:22:48 +01:00
Muki Kiboigo bf0be60b89 use new validator for e2e test 2026-03-12 09:04:13 -07:00
Muki Kiboigo 172481dd72 add e2e tests w/ web bot auth 2026-03-12 09:04:13 -07:00
Nikolay Govorov dc4b75070d Increases the memory limit on CI :/ 2026-02-18 09:23:37 +00:00
Pierre Tachoire 21f2eb664e ci: fix path 2026-02-12 15:44:28 +01:00
Pierre Tachoire c643fb8aac ci: fix var name 2026-02-12 12:07:15 +01:00