Skip to content

Releases: bogie-go/bogie

v0.2.3

Choose a tag to compare

@LynchzDEV LynchzDEV released this 13 Oct 04:25
b778f10

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 Update bound the request into an empty struct and saved every column, so PATCH /posts/:id with {"title":"Edited"} blanked body. The generated Update now 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 gains TestPostsUpdateChangesOnlyTheFieldsSent and TestPostsUpdateUnknownIs404. (#10)
  • The request log shows path=/ for the root, instead of path="". (#10)

Community

  • CODE_OF_CONDUCT.md (Contributor Covenant 2.1) and SECURITY.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 server and bogie worker stop the app they started on SIGTERM, instead of leaving it holding :8080. (#13)
  • bogie help lists the authentication generator. (#14)
  • The generated TestLoadDefaults clears <APP>_TEST_DATABASE_URL, so bogie test passes when you've exported it for your own Postgres. (#17)

Docs

  • README Status: says v0.2.x, mentions live reload, and says app:update has 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.yml comment lists every place that repeats the Postgres port. (#19)

Install / upgrade

go install github.com/bogie-go/bogie@latest    # v0.2.3

Go 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

Choose a tag to compare

@roonglit roonglit released this 06 Oct 10:15

Full Changelog: v0.2.1...v0.2.2

v0.2.1

Choose a tag to compare

@roonglit roonglit released this 06 Oct 06:27

Full Changelog: v0.2.0...v0.2.1

v0.2.0

Choose a tag to compare

@roonglit roonglit released this 06 Oct 05:43

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

Choose a tag to compare

@roonglit roonglit released this 03 Oct 07:32

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

Full Changelog: https://github.com/bogie-go/bogie/commits/v0.1.0