Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ftw-holds-no-driver-source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ftw": patch
---

Driver source is no longer committed here. `drivers/*.lua` is gitignored and fetched from the pinned device-drivers commit with `make drivers`.
6 changes: 6 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ jobs:
with:
ref: ${{ needs.tag.outputs.version }}

# drivers/ is gitignored and fetched from the commit pinned in
# drivers/BUNDLED_SOURCE.json. The image copies it, so it has to exist
# in the build context before buildx runs.
- name: Fetch the bundled drivers
run: make drivers

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/release-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ jobs:
go-version: '1.26'
cache-dependency-path: go/go.sum

# drivers/ is gitignored and fetched from the commit pinned in
# drivers/BUNDLED_SOURCE.json. Both the tarballs and the image carry it,
# so it has to exist before either is built.
- name: Fetch the bundled drivers
run: make drivers

- name: Build
env:
GOOS: ${{ matrix.goos }}
Expand Down Expand Up @@ -236,6 +242,10 @@ jobs:
with:
ref: ${{ needs.meta.outputs.tag }}

# drivers/ is gitignored and fetched from the pin; the image copies it.
- name: Fetch the bundled drivers
run: make drivers

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ jobs:
- name: Vet
working-directory: go
run: go vet ./...
# drivers/ is gitignored and fetched from the pin, so a checkout alone
# leaves it empty. Anything that loads a driver needs this first.
- name: Fetch the bundled drivers
run: make drivers

- name: Test
working-directory: go
run: go test -count=1 ./...
Expand Down Expand Up @@ -227,11 +232,16 @@ jobs:
with:
go-version: '1.26'
cache-dependency-path: go/go.sum
# drivers/ is gitignored and fetched from the pin, so a checkout alone
# leaves it empty. Anything that loads a driver needs this first.
- name: Fetch the bundled drivers
run: make drivers

# drivers/ is a snapshot of srcfl/device-drivers, not a source. Hand-
# editing a file here made this a second source of truth and the two
# drifted: a Sungrow fix landed upstream while the bundled copy kept the
# bug that took a customer's inverter offline.
- name: Bundled drivers match the pinned device-drivers commit
- name: No driver source is committed here
run: bash scripts/sync-bundled-drivers.sh --check
- name: Validate publication
working-directory: go
Expand Down Expand Up @@ -389,6 +399,11 @@ jobs:
with:
go-version: '1.26'
cache-dependency-path: go/go.sum
# drivers/ is gitignored and fetched from the pin, so a checkout alone
# leaves it empty. Anything that loads a driver needs this first.
- name: Fetch the bundled drivers
run: make drivers

- run: make e2e

test:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@ deploy/secrets/*
# Goalbuddy renders local review boards; keep the markdown/state, not the
# generated static board assets.
docs/**/.goalbuddy-board/

# Bundled drivers are fetched from srcfl/device-drivers at the commit pinned
# in drivers/BUNDLED_SOURCE.json, never authored here. Run `make drivers`.
drivers/*.lua
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ container-boundary-test:
optimizer/.venv/.installed: optimizer/pyproject.toml
$(MAKE) optimizer-install

e2e:
e2e: drivers-present
cd go && FTW_E2E=1 go test ./test/e2e -v -timeout 180s

driver-repository-validate:
driver-repository-validate: drivers-present
cd go && go run ./cmd/ftw-driver-repository publish -unsigned -drivers ../drivers -output ../dist/driver-repository -base-url https://example.invalid/releases/download/drivers-local -repository https://github.com/srcfl/ftw

DRIVER_BASE ?= origin/master
Expand Down Expand Up @@ -187,7 +187,7 @@ build-windows-amd64:

# ---- Release archives ----

release: build-arm64 build-amd64 build-windows-amd64
release: drivers-present build-arm64 build-amd64 build-windows-amd64
@mkdir -p release
@# Per-arch staging dirs ship ftw and its compatibility alias.
@for arch in arm64 amd64; do \
Expand Down
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,21 @@ The local catalog is generated from `DRIVER` metadata. The public
[`srcfl/device-drivers`](https://github.com/srcfl/device-drivers) repo is the
editable source and FTW's default signed driver channel.

[`drivers/*.lua`](drivers/) is FTW's offline recovery set, and it is a
**generated snapshot** of that repository at the commit pinned in
[`drivers/BUNDLED_SOURCE.json`](drivers/BUNDLED_SOURCE.json). It exists because
startup is deliberately local: a gateway boots and runs without the network, so
a remote refresh must never block it. Editing a `.lua` file here is not a way to
change a driver — fix it upstream, move the pin, and run `make drivers`.
CI fails if the two drift.

A fresh clone gets the files from git today. `make drivers` fetches the same
bytes from the pin, and CI proves the two agree on every pull request by
throwing the committed copies away and rebuilding from the pin alone. That is
the groundwork for dropping them from git entirely, so this repository holds no
driver source at all.
**This repository holds no driver source.** `drivers/*.lua` is gitignored and
fetched from that repository at the commit pinned in
[`drivers/BUNDLED_SOURCE.json`](drivers/BUNDLED_SOURCE.json):

```bash
make drivers
```
Comment on lines +52 to +54

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fetch bundled drivers in make dev

On a fresh clone, the documented local-development sequence still goes directly from git clone to make dev, but that target has neither a drivers nor drivers-present prerequisite. Because config.local.example.yaml references drivers/ferroamp.lua and drivers/sungrow.lua, both files are absent after this change and the simulator drivers cannot load, leaving the advertised development stack without telemetry; wire this fetch or at least the presence guard into make dev.

AGENTS.md reference: AGENTS.md:L89-L95

Useful? React with 👍 / 👎.


The files still ship. FTW's offline recovery set exists because startup is
deliberately local — a gateway boots and runs without the network, so a remote
refresh must never block it — so the image, the release tarballs and the tests
all read `drivers/`. They are simply fetched rather than committed, which is
why a driver cannot be edited here at all. There is no file to open a pull
request against; fix it upstream and move the pin. CI fails if one is
committed.

Moving the pin is a driver release. `make driver-versions-across-pin` compares
the drivers at the old pin against the drivers at the new one and fails when a
Expand Down
2 changes: 1 addition & 1 deletion drivers/BUNDLED_SOURCE.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"for coverage. Run scripts/sync-bundled-drivers.sh to update."
],
"repository": "srcfl/device-drivers",
"commit": "edb32ffed2f1225da160cc51c0cce8fe8e0adfd9",
"commit": "a4d0205d5f4439f0994b2b708a4d69a7a0c20023",
"source_dir": "drivers/lua",
"drivers": [
"ambibox_v2x", "ctek", "ctek_hybrid", "ctek_v2", "deye", "easee_cloud",
Expand Down
212 changes: 0 additions & 212 deletions drivers/ambibox_v2x.lua

This file was deleted.

Loading