REPO_POLICIES.md now requires each main.go under cmd/ to be one call into internal/ or pkg/ (#206).
What cmd/pixad/main.go did (the command line and its --config flag, setting PIXA_CONFIG_PATH from that flag, ignoring SIGPIPE, starting the fx app) moves unchanged to Run in a new package, internal/app. main is now app.Run(Version).
Version stays in main, so the -X main.Version build flags in the Dockerfile and the Makefile do not change. Run passes it on to globals.Version before reading the command line, where main used to do this just before starting the server; nothing reads it in between, so pixad still logs the version first. Flags and exit codes do not change: status 1 for a command line that is not valid, and fx's Run for everything after that, as before.
The comment on globals.Version now names app.Run as what sets it.
Disclosures:
Judgement call: a new package, internal/app, as the plan suggested; none of the existing packages under internal/ covers starting the program.
No tests: the moved code had none, and it only reads os.Args and starts the server.
Left as is: a comment in internal/server/login_rate_limit_internal_test.go still says "the constructors cmd/pixad uses". That is still true, as pixad uses them through internal/app, and the repo's rules say not to edit existing tests without asking.
Model: opus-5-5
`REPO_POLICIES.md` now requires each `main.go` under `cmd/` to be one call into `internal/` or `pkg/` (https://git.eeqj.de/sneak/pixa/issues/206).
What `cmd/pixad/main.go` did (the command line and its `--config` flag, setting `PIXA_CONFIG_PATH` from that flag, ignoring `SIGPIPE`, starting the fx app) moves unchanged to `Run` in a new package, `internal/app`. `main` is now `app.Run(Version)`.
`Version` stays in `main`, so the `-X main.Version` build flags in the `Dockerfile` and the `Makefile` do not change. `Run` passes it on to `globals.Version` before reading the command line, where `main` used to do this just before starting the server; nothing reads it in between, so pixad still logs the version first. Flags and exit codes do not change: status 1 for a command line that is not valid, and fx's `Run` for everything after that, as before.
The comment on `globals.Version` now names `app.Run` as what sets it.
Disclosures:
- Judgement call: a new package, `internal/app`, as the plan suggested; none of the existing packages under `internal/` covers starting the program.
- No tests: the moved code had none, and it only reads `os.Args` and starts the server.
- Left as is: a comment in `internal/server/login_rate_limit_internal_test.go` still says "the constructors cmd/pixad uses". That is still true, as pixad uses them through `internal/app`, and the repo's rules say not to edit existing tests without asking.
Model: opus-5-5
PASS at PR head 8f65fd7b051e2b30697ff9a61202cd52eab2d475, rebased onto next at 23ec4026f65e4f689688769085f8cc1ec3e20765.
Disclosure: TODO.md conflicts with next only because both add an entry at the top of Completed Steps; I resolved it locally by keeping both entries.
Model: opus-5-5
**PASS** at PR head `8f65fd7b051e2b30697ff9a61202cd52eab2d475`, rebased onto `next` at `23ec4026f65e4f689688769085f8cc1ec3e20765`.
Disclosure: `TODO.md` conflicts with `next` only because both add an entry at the top of Completed Steps; I resolved it locally by keeping both entries.
Model: opus-5-5
cmd/pixad/main.go built the command line and its --config flag, set
PIXA_CONFIG_PATH from that flag, ignored SIGPIPE and started the fx
app. REPO_POLICIES.md now requires cmd/ to hold only one call into
internal/ or pkg/, so that code moves unchanged to Run in the new
internal/app package, and main calls app.Run(Version). Version stays
in main, so the -X main.Version build flags in the Dockerfile and the
Makefile do not change.
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.
REPO_POLICIES.mdnow requires eachmain.goundercmd/to be one call intointernal/orpkg/(#206).What
cmd/pixad/main.godid (the command line and its--configflag, settingPIXA_CONFIG_PATHfrom that flag, ignoringSIGPIPE, starting the fx app) moves unchanged toRunin a new package,internal/app.mainis nowapp.Run(Version).Versionstays inmain, so the-X main.Versionbuild flags in theDockerfileand theMakefiledo not change.Runpasses it on toglobals.Versionbefore reading the command line, wheremainused to do this just before starting the server; nothing reads it in between, so pixad still logs the version first. Flags and exit codes do not change: status 1 for a command line that is not valid, and fx'sRunfor everything after that, as before.The comment on
globals.Versionnow namesapp.Runas what sets it.Disclosures:
internal/app, as the plan suggested; none of the existing packages underinternal/covers starting the program.os.Argsand starts the server.internal/server/login_rate_limit_internal_test.gostill says "the constructors cmd/pixad uses". That is still true, as pixad uses them throughinternal/app, and the repo's rules say not to edit existing tests without asking.Model: opus-5-5
PASS at PR head
8f65fd7b051e2b30697ff9a61202cd52eab2d475, rebased ontonextat23ec4026f65e4f689688769085f8cc1ec3e20765.Disclosure:
TODO.mdconflicts withnextonly because both add an entry at the top of Completed Steps; I resolved it locally by keeping both entries.Model: opus-5-5
8f65fd7b05to63937ffdaf