Skip to content

ci: run build and the three test suites on every PR - #49

Merged
oreofeolurin merged 1 commit into
devfrom
ci/pr-checks
Aug 29, 2026
Merged

ci: run build and the three test suites on every PR#49
oreofeolurin merged 1 commit into
devfrom
ci/pr-checks

Conversation

@oreofeolurin

@oreofeolurin oreofeolurin commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Nothing gated pull requests in this repo. The only workflows were release.yml and docker-publish.yml, both tag-triggered — so a PR could be merged having been built and tested only on a contributor's machine. That is exactly the state the four currently-open PRs are in: mergeable=MERGEABLE, reviews=none, checks=0.

What runs

On pull_request and on pushes to dev/main:

Job What it catches
Web console npm run build runs tsc -b first, so a TypeScript error fails here instead of in the release build — the console is compiled into the Zig binary
Build zig build
test-unit / test-integration / test-e2e matrix, fail-fast: false so one failing suite doesn't mask the other two

The console is built once and passed to the Zig jobs as an artifact rather than rebuilt three times. PR runs cancel superseded in-flight runs; dev/main runs never cancel, since those are the record of what the branch did.

Note

No zig fmt --check gate. 12 files on dev are already unformatted, so the gate would fail every PR on day one — including PRs that don't touch those files. Two of them (src/cli/commands/server.zig, src/config/server.zig) are touched by #47 right now, so reformatting here would conflict with open work. It's a separate cleanup, best landed when nothing is in flight.

oreofeolurin added a commit that referenced this pull request Aug 29, 2026
* fix(linux): repair the Linux build (#50)

`flo` did not compile on Linux, and the next release tag would have failed:
release.yml runs `zig build --release=safe -Dtarget=<linux>`, which errors on
current dev.

Three Zig 0.16 API removals, all in Linux-only branches:

- `std.fs.openFileAbsolute` and `File.readAll` in host_stats.zig, which reads
  /proc. Replaced with `stdx.fs.readFile`, which also collapses open + readAll
  + close into one call.
- `std.posix.timerfd_create` / `timerfd_settime` in reactor.zig. Replaced with
  the raw `std.os.linux` syscalls, mapping errno the way stdx.net already does.

Zig analyses lazily, so a macOS host never compiles either branch — the code
could reference symbols that do not exist while every local build stayed green.
Same trap that previously hid the metrics exporter and util/http/response.zig
being dead code.

Worth noting `stdx.fs.openFileAbsolute` already existed. The stdx wrappers are
there exactly to track the std API this codebase targets; host_stats.zig
called std.fs directly and bypassed the convention.

Verified:

  zig build --release=safe -Dtarget=x86_64-linux    # fails on dev, passes here
  zig build --release=safe -Dtarget=aarch64-linux   # both release targets green

macOS build, test-unit and test-integration all still pass. Native Linux Debug
is covered by the CI in #49, which is what surfaced this.

* chore(): clean up stdx and comments
@oreofeolurin
oreofeolurin force-pushed the ci/pr-checks branch 2 times, most recently from 142adab to ff74348 Compare August 29, 2026 17:02
oreofeolurin added a commit that referenced this pull request Aug 29, 2026
…) (#53)

`listen_port = 0` means "bind an ephemeral port", so it is not a base to add an
offset to. The helpers added theirs unconditionally and produced ports 1
(metrics), 2 (dashboard), 500 (Raft) and 600 (gossip) — all privileged, all
refused on Linux without CAP_NET_BIND_SERVICE.

`Runtime: boot 2 shards and shutdown` uses `.listen_port = 0`, and both
metrics_enabled and dashboard_enabled default to true, so it tried to bind port
2 and failed. The metrics exporter hit it first but survived — it got graceful
bind-failure logging in #43; the dashboard has no such guard and failed the
whole runtime start.

An unresolved base now derives an unresolved port: the helpers return 0 when
listen_port is 0. An explicitly configured port still wins.

macOS permits bind(0.0.0.0, <low port>) where Linux does not, which is why
every local run passed. Second Linux-only failure found by the CI in #49,
after #50.

Also updates the ephemeral-port test added in #47, which asserted
effectiveRaftPort() == 500 — that pinned the buggy behaviour.
Nothing gated pull requests. The only workflows here were release.yml and
docker-publish.yml, both tag-triggered, so a PR could be merged having been
built and tested only on a contributor's machine.

Adds a CI workflow on pull_request and on pushes to dev/main:

- web console — `npm run build`, which runs `tsc -b` first, so a TypeScript
  error fails here rather than in the release build (the console is compiled
  into the Zig binary)
- build — `zig build`
- test-unit, test-integration, test-e2e — as a matrix with fail-fast off, so
  one failing suite does not mask the other two

The console is built once and handed to the Zig jobs as an artifact instead of
being rebuilt three times.

No `zig fmt --check` gate yet: 12 files on dev are already unformatted, so it
would fail every PR on day one, and two of them are touched by a PR currently
in flight. Reformatting is a separate cleanup, best landed when nothing is open.

Its first run already earned its keep: it caught that the Linux build was
broken and that the next release tag would have failed (#50, fixed in #51).
@oreofeolurin
oreofeolurin merged commit ddfc2cb into dev Aug 29, 2026
4 of 5 checks passed
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