sneak on #283 (comment): "immediately begin the fx work on a branch using the recommended config. let's land it on next asap."
The recommended option, from the architecture review on that issue (the ### fx section): fx with providers in internal/sww.
The other packages keep their Params of plain values and import neither fx nor, where they do not today, config.
internal/sww holds one small function per part that turns the settings into that part's Params and builds it, as newAlertQueue and newRemoteLogSender already do. fx calls them in dependency order.
Each background loop is one lifecycle hook, registered where its part is built.
This replaces newServer, loadStateFiles, the inBackground list and both serve functions.
The review's catches apply: fx's own event log goes through slog (stdout carries JSON lines only); RunDiscriminator(ctx, params) int (or its renamed form) stays as the entry the tests call, using fx's Start and Stop, not its signal handling; stop order is the reverse of start, so the last state write stays last; types fx resolves by (func() time.Time, io.Writer) get named types of their own.
Definition of done: go.uber.org/fx wires every daemon as above; behaviour is unchanged (every existing test passes unmodified apart from construction); fx appears only in internal/sww and the cmd/ entry points; make check passes; the PR body is under 250 words. If this is more than one PR can carry, the worker says so on this issue instead of starting.
Model: opus-5-5
sneak on https://git.eeqj.de/sneak/smallwebwaf/issues/283#issuecomment-183071: "immediately begin the fx work on a branch using the recommended config. let's land it on next asap."
The recommended option, from the architecture review on that issue (the `### fx` section): **fx with providers in `internal/sww`**.
- The other packages keep their `Params` of plain values and import neither fx nor, where they do not today, `config`.
- `internal/sww` holds one small function per part that turns the settings into that part's `Params` and builds it, as `newAlertQueue` and `newRemoteLogSender` already do. fx calls them in dependency order.
- Each background loop is one lifecycle hook, registered where its part is built.
- This replaces `newServer`, `loadStateFiles`, the `inBackground` list and both serve functions.
- The review's catches apply: fx's own event log goes through `slog` (stdout carries JSON lines only); `RunDiscriminator(ctx, params) int` (or its renamed form) stays as the entry the tests call, using fx's `Start` and `Stop`, not its signal handling; stop order is the reverse of start, so the last state write stays last; types fx resolves by (`func() time.Time`, `io.Writer`) get named types of their own.
Definition of done: `go.uber.org/fx` wires every daemon as above; behaviour is unchanged (every existing test passes unmodified apart from construction); fx appears only in `internal/sww` and the `cmd/` entry points; `make check` passes; the PR body is under 250 words. If this is more than one PR can carry, the worker says so on this issue instead of starting.
Model: opus-5-5
fx builds and runs both daemons from providers in internal/sww. One serve hook and one run function replace both serve functions.
Judgement call: the nine parts waf.New builds stay in internal/waf. Moving them is the review's separate proposal "The parts are built in two places".
Deviations, each explained in the PR body:
the alert queue's and the lists' loops are registered with the state files, so that they end before the last write;
the remote log sender stays outside fx.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/smallwebwaf/pulls/421, branch `issue-414-fx-wiring`.
- fx builds and runs both daemons from providers in `internal/sww`. One `serve` hook and one `run` function replace both serve functions.
- Judgement call: the nine parts `waf.New` builds stay in `internal/waf`. Moving them is the review's separate proposal "The parts are built in two places".
- Deviations, each explained in the PR body:
- the alert queue's and the lists' loops are registered with the state files, so that they end before the last write;
- the remote log sender stays outside fx.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
sneak on #283 (comment): "immediately begin the fx work on a branch using the recommended config. let's land it on next asap."
The recommended option, from the architecture review on that issue (the
### fxsection): fx with providers ininternal/sww.Paramsof plain values and import neither fx nor, where they do not today,config.internal/swwholds one small function per part that turns the settings into that part'sParamsand builds it, asnewAlertQueueandnewRemoteLogSenderalready do. fx calls them in dependency order.newServer,loadStateFiles, theinBackgroundlist and both serve functions.slog(stdout carries JSON lines only);RunDiscriminator(ctx, params) int(or its renamed form) stays as the entry the tests call, using fx'sStartandStop, not its signal handling; stop order is the reverse of start, so the last state write stays last; types fx resolves by (func() time.Time,io.Writer) get named types of their own.Definition of done:
go.uber.org/fxwires every daemon as above; behaviour is unchanged (every existing test passes unmodified apart from construction); fx appears only ininternal/swwand thecmd/entry points;make checkpasses; the PR body is under 250 words. If this is more than one PR can carry, the worker says so on this issue instead of starting.Model: opus-5-5
Built in #421, branch
issue-414-fx-wiring.internal/sww. Oneservehook and onerunfunction replace both serve functions.waf.Newbuilds stay ininternal/waf. Moving them is the review's separate proposal "The parts are built in two places".Model: opus-5-5