~bigbes/sr-ht-dolt

ref: 0638c16f7ac54e5ab2e398ac748c28a1475ebb04 sr-ht-dolt/cmd/doltsrht-migrate/main.go -rw-r--r-- 5.6 KiB
0638c16f — Eugene Blikh 18 hours ago master
migrate: install the instance's masking before brant can log a DSN

brant reports a migration directory it cannot open with slog.Error("failed to
create provider", "datasource", a.DataSourceName, ...) -- the connection
string, password and all, at ERR level. A missing directory is what an installed
package is in until its first migration ships, so this is an ordinary path
rather than an exotic one.

This binary installed no slog handler at all, so that record went to Go's
built-in stderr handler and no mask list of any kind applied -- while the daemon
next door had been masking a DSN correctly for as long as this one had been
printing one. It now installs the same handler from the same policy, in a
logging.go named after cmd/doltsrht's. The verbosity comes from
DefaultsWithoutDebugFlag, because -d here is brant's --dialect and takes a value.

Half a fix without the ecore bump: "datasource" was not a spelling the mask list
knew until 9a4d2ed. Both halves are pinned by the first test this binary has had,
and removing either turns it red.

The log package goes with it. slog.SetDefault reroutes the std logger through the
installed handler at info level, so a log.Fatalf left behind would be silently
dropped by an operator's log-level=warn -- an error message swallowed by a
logging preference.

Not fixable from here: brant's cli.initLogger runs ahead of that record and under
--json replaces the installed handler with a plain JSON one of its own. Nothing
passes --json; the default branch leaves the handler alone.
2dfab043 — Eugene Blikh a month ago
rename module to sourcecraft.dev/bigbes/sr-ht-dolt; depend on sourcecraft sr-ht-core
e518fcb9 — Eugene Blikh a month ago
cmd: doltsrht and doltsrht-migrate binaries, module tidy