Skip to content

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 21 Oct 16:10
· 83 commits to main since this release

Added

  • Admin operational dashboard (opt-in). admin.WithDashboard(admin.DashboardConfig{Status, Activity}) turns /admin/ into a page with database and migration status and recent request and job activity; without it, or with neither source set, the landing page is unchanged. The status comes from a function you supply (build it from tango.Status), and the activity from any observability.Snapshotter. A failing or panicking source marks only its own card "unavailable" and logs the cause; the error text never reaches the page. New in observability: Snapshotter and Snapshot (a read side that is separate from Recorder), NewWindow (an opt-in in-memory collector: the last 60 minutes in one-minute buckets, HTTP requests by status class and latency, job runs by outcome, nothing per route or job, reset on restart, labelled "this instance only"), and Multi (feed several recorders at once). It is a starting point for "is this instance healthy right now", not a metrics store; keep an external monitoring system for history, alerts and several instances.

  • MySQL 8.4 support. mysql://user:pass@host:3306/db in TANGO_DB_DSN selects the new db.MySQL dialect, with github.com/go-sql-driver/mysql as the driver. Migrations, Store, the admin, tango newproject --dialect=mysql and testdb (a fresh database per test; TANGO_TEST_DSN=mysql://…, testdb.MySQLOnly, testdb.NotMySQL) all work on it, and CI runs the suite on MySQL 8.4. Tables are InnoDB with the utf8mb4_bin collation; timestamps are DATETIME(6) in UTC; connections use READ COMMITTED unless the DSN sets another isolation level, and the default pool recycles a connection after five minutes. MariaDB is not supported. Differences to know: an unbounded string that is unique or indexed is VARCHAR(255) (a longer value returns a *db.ValueTooLongError), LIKE is case-sensitive, and a migration that fails part-way cannot roll back (the error names every applied step and writes no tracking row). See the setup guide. A project with a shell/main.go from before this release must copy the new databaseLabel from the shell guide before using MySQL, or tango shell prints the DSN's password.

  • Admin dark mode. Every admin page now follows the browser's light or dark preference, and signed-in staff can pick Light, Dark or System from the sidebar footer; the choice is kept in a tango_admin_theme cookie scoped to /admin/. The light theme is nearly unchanged: input, checkbox and secondary-button borders are a shade darker, and primary and danger buttons darken on hover, so they meet WCAG contrast. Colours are now semantic tokens (bg-surface, text-ink, border-line, the status family, and so on) generated from one palette table, with contrast tests over its pairs in both themes. Widgets that hard-code light colours stay light, so switch them to the token classes in the admin guide; the Markdown preview stays a white canvas in both themes. There is nothing to configure.

Changed

  • AccessLogger is free when its logger discards Info events. It used to wrap the response and build the event's attributes for every request and only then let the logger drop it (3 allocations a request). It now asks the logger first and calls the next handler directly. A logger that logs Info behaves as before; the level is read on every request, so a slog.LevelVar still takes effect at once.

  • Dependencies. go.mod now requires chi 5.5.0 (was 5.3.2), golang.org/x/crypto 0.58.0, x/sys 0.49.0, x/term 0.47.0 and modernc.org/sqlite 1.60.1, and adds github.com/go-sql-driver/mysql 1.10.1 for the MySQL dialect. A project that depends on tanGO is raised to at least these versions the next time it updates; run go mod tidy.

Documentation

  • Choosing MaxOpen. The configuration guide now explains how the size of the database pool shapes tail latency, with measured figures, and suggests starting near the database's CPU count.