Repository navigation
Releases: bogie-go/bogie
Release list
v0.2.3
A small release on top of v0.2.2: generated apps' tests no longer follow a development database URL, a scaffold PATCH fix, plus a code of conduct and a security policy.
Fixed: tests no longer follow a development database URL
If <APP>_DATABASE_URL was set in the shell (by export, direnv, .envrc or a .env loader), the test environment used it too. Two things followed from that: bogie test (make test) emptied every table in the development database, and bin/ci dropped the development database and rebuilt it empty. Generated apps now resolve the test database only from <APP>_TEST_DATABASE_URL, falling back to the local <app>_test database, and never read <APP>_DATABASE_URL in test. A new generated test, TestTestIgnoresTheSharedDatabaseURL, checks this. (#16)
Affected: apps generated by v0.1.0 through v0.2.2. The test branch of config.Load has read <APP>_DATABASE_URL since before v0.1.0. Apps whose shell never set <APP>_DATABASE_URL while running tests were not affected.
Breaking: a CI setup that points tests at a database through <APP>_DATABASE_URL must rename the variable. For example, MYAPP_DATABASE_URL=postgres://ci:ci@db:5432/myapp_test becomes MYAPP_TEST_DATABASE_URL=postgres://ci:ci@db:5432/myapp_test. If it isn't renamed, tests fall back to localhost:5440 and fail to connect, so nothing is lost.
Existing apps: the fix is in the app templates (config/config.go and config/config_test.go), not a generator, so bogie app:update run with v0.2.3 carries it. Commit your work, run bogie app:update, and resolve any conflict markers if you edited the test branch of config.Load. To patch by hand instead, add one line in config/config.go, in the case env == EnvTest: branch right after applyEnv: cfg.App.DatabaseURL = envOr("<APP>_TEST_DATABASE_URL", defaultDatabaseURL(EnvTest)). Until you do one or the other, don't run tests or bin/ci with <APP>_DATABASE_URL set.
Fixed
- Scaffold PATCH changes only the fields sent. In v0.2.2 and earlier, a scaffolded
Updatebound the request into an empty struct and saved every column, soPATCH /posts/:idwith{"title":"Edited"}blankedbody. The generatedUpdatenow loads the record, decodes the request over its current values, and saves the result, the same find-then-update a Rails scaffold does. Validation still runs on the whole record. The generated test gainsTestPostsUpdateChangesOnlyTheFieldsSentandTestPostsUpdateUnknownIs404. (#10) - The request log shows
path=/for the root, instead ofpath="". (#10)
Community
CODE_OF_CONDUCT.md(Contributor Covenant 2.1) andSECURITY.md. Report a vulnerability privately through GitHub. CONTRIBUTING links both. (#9)- The bug-report template no longer carries a dated version example. (#9,
373df90)
Also fixed
bogie serverandbogie workerstop the app they started on SIGTERM, instead of leaving it holding :8080. (#13)bogie helplists theauthenticationgenerator. (#14)- The generated
TestLoadDefaultsclears<APP>_TEST_DATABASE_URL, sobogie testpasses when you've exported it for your own Postgres. (#17)
Docs
- README Status: says v0.2.x, mentions live reload, and says
app:updatehas been exercised from v0.1.0 to v0.2.x. CONTRIBUTING says v0.2.x and Go 1.26+ for generated apps. (#12) - README and each generated app's README: how to use your own Postgres without Docker. (#18)
- The generated
docker-compose.ymlcomment lists every place that repeats the Postgres port. (#19)
Install / upgrade
go install github.com/bogie-go/bogie@latest # v0.2.3Go 1.26+ for generated apps (the CLI itself builds with 1.25), and Docker with Compose v2 for the local Postgres.
An existing app: commit your work, then run bogie app:update. That carries the request-log fix, which is a template change. The PATCH fix is in the scaffold generator, so app:update doesn't change controllers you already scaffolded. New scaffolds get it. For an existing one, change its Update to load the record first and bind the request over it. The diff in #10 shows the few lines.
Full Changelog: v0.2.2...v0.2.3
v0.2.2
v0.2.1
v0.2.0
What's Changed
- Say Go 1.26 for a generated app, and pin it in the template by @LynchzDEV in #5
- README: why Bogie exists, Go 1.26 + Docker, test database, demo GIF by @LynchzDEV in #6
Full Changelog: v0.1.0...v0.2.0
v0.1.0
What's Changed
- README: working quickstart, install prerequisites, why Bogie by @LynchzDEV in #1
- Add CONTRIBUTING.md and issue/PR templates by @LynchzDEV in #2
- Generated store tests: name the test database in the failure hint by @LynchzDEV in #4
- new: list make up and db:prepare in the Next steps by @LynchzDEV in #3
New Contributors
- @LynchzDEV made their first contribution in #1
Full Changelog: https://github.com/bogie-go/bogie/commits/v0.1.0