beads/internal
ecuthiell 4e804885dd
test(credentials): make remaining credential-command fixtures native-Windows portable (#5748) (#5749)
* test(credentials): make command fixtures Windows-portable (#5748)

Replace POSIX-only credential test commands with a shared shell-portable protocol, exercise their intended failure and non-invocation semantics on native Windows, and add the focused required CI selector.

Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell

* test(ci): require each Windows credential fixture to pass

Include the standalone credentialcmd protocol test in the existing Windows
step. One package/test map drives both selection and exact terminal checks,
so missing, skipped, failed, or duplicate tests cannot report success.
Resolve native Go once and reuse it for the test invocation.

Bead: saa-cgh.66
Agent-Signature: unknown-model/unknown-reasoning

* test(ci): select the first Go application on PATH

Hosted Windows images can expose more than one Go application. Preserve
setup-go's PATH precedence, select one absolute application and reuse it.

Bead: saa-cgh.66
Agent-Signature: unknown-model/unknown-reasoning

* chore(bazel): sync BUILD.bazel srcs for the new credentialcmd test helper

Base landed the Bazel PR gates (#6881/#6887) after this PR was authored, so
the PR's new internal/testutil/credentialcmd package and internal/creds
testmain_test.go were never enumerated in any BUILD.bazel. Two already
enumerated test srcs (internal/creds/command_test.go and
internal/storage/dolt/gateway_credential_test.go) import the new package, so
`bazel build //internal/creds:all` fails GoCompilePkg without this.

Generated by `make bazel-sync` (gazelle); a second sync is a no-op. The
internal/storage/dolt version_staging_completeness_test.go srcs row is
pre-existing base drift that gazelle corrects in the same pass, not PR content.

* test(credentialcmd): pin the Windows gate's assertions and stop claiming foreign helpers

Maintainer review fixes for PR #5749, adoption iteration 1. The synthesis is
`approve` with no required changes; all four findings are minor or nit. A
maintainer bazel commit already exists on this branch, so the push was owed
regardless and none of these cost anything extra. No production code changes.

F1 — the new required Windows gate pinned its own wiring but almost none of its
assertions. The guard checked three package paths and one test name, so it
stayed green if someone dropped six of the nine test names from $expected,
deleted the `Action -in 'fail', 'skip'` throw, or deleted the exactly-one-PASS
loop -- leaving a required gate whose only real guarantee was "go test exited
0", which a fully skipped suite also satisfies. The pinned slice now carries all
nine test names plus both load-bearing guard tokens, keeping the file's existing
substring idiom.

F2 — the property the fixture exists for was unassertable end to end. Emit is
written to produce byte-exact stdout across sh and the Windows .cmd trampoline,
but parseCredential runs bytes.TrimSpace before every comparison, so every
existing assertion is blind to a trailing newline: a trampoline changed to
`echo %OUT%` would keep the whole suite green. TestCommandSourceRealShell now
wraps the existing credRunner package seam to capture the helper's stdout as the
shell produced it, and asserts it byte-exact. The real shell stays in the loop,
so this remains end-to-end rather than becoming a second in-process test.

F3 — Dispatch claimed any process where BEADS_TEST_CREDENTIAL_COMMAND_HELPER=1,
on the env alone and before inspecting argv, exiting 97 when the sentinel was
absent. command() arms that variable in the *parent* process and BEADS_-prefixed
variables reach every re-exec'd child through the integration allowlist, so the
first composition with a package that re-execs its own test binary -- which
internal/storage/dolt already does -- would have died with a wrong-subsystem
"missing protocol sentinel". Both gates are now required, and an env-armed
process without the sentinel falls through to its own TestMain.

The second half of that finding's prescription is deliberately NOT applied.
Adding BEADS_TEST_CREDENTIAL_COMMAND_HELPER to helperSubprocessSentinels reds
TestHelperSubprocessSentinelsAreComplete: that guard has a reverse-direction
control, and its regex looks for a literal os.Getenv("BEADS_..._HELPER") in
internal/storage/dolt's own test sources. This sentinel is read in
internal/testutil/credentialcmd, so the entry registers as a stale one. Measured,
not assumed -- the failure is "helperSubprocessSentinels lists
BEADS_TEST_CREDENTIAL_COMMAND_HELPER, but no test source reads it". With the
Dispatch gate fixed the entry also buys nothing: a dolt helper child already
carries its own sentinel, so isHelperSubprocess is true for it either way.

F4 — the exported constructors documented themselves as "returns a unique shell
command" while replacing PATH for the rest of the calling test, setting env vars
via t.Setenv (which bans t.Parallel), and silently rejecting an empty payload.
The shared contract is now stated once above the three of them, and Emit fails
fast with an explanation instead of letting the shell drop the empty payload
word and the helper exit 97. No caller passes an empty payload today.

Each fix was checked by reverting it and confirming its own pin reddens: the
dropped test name reds the guard by name; the trailing-newline wrong
implementation reds the new raw-stdout assertion while the sibling end-to-end
test stays green, which is the blindness the finding described; and reverting
the Dispatch gate reproduces `(97, true)`. `make bazel-sync` is a no-op -- every
edit landed in a file already enumerated in srcs.

---------

Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 18:30:25 -07:00
..
ado build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
atomicfile build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
audit build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
beads fix(beads): make an explicit BEADS_DIR authoritative during discovery (#6938) 2026-09-29 02:26:09 -07:00
ceiling test(bazel): fully green //..., tag taxonomy + docker lane, sharding, test sandbox ceiling (#6871) 2026-09-27 20:19:38 -07:00
compact build(bazel): integration-tag lane (--config=integration) matching main.yml (#6916) 2026-09-28 14:11:34 -07:00
config fix(config): name profile variables in path error (#5671) (#5676) 2026-09-30 15:40:49 -07:00
configfile Fix ResolveServerMode ambient port-var handling and the KillStaleServers regression it introduced (#5934) 2026-09-30 07:13:57 -07:00
creds test(credentials): make remaining credential-command fixtures native-Windows portable (#5748) (#5749) 2026-09-30 18:30:25 -07:00
debug build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
doltremote fix(doltremote): treat s3:// as a native Dolt remote scheme (#5948) 2026-09-29 06:28:57 -07:00
doltserver Fix ResolveServerMode ambient port-var handling and the KillStaleServers regression it introduced (#5934) 2026-09-30 07:13:57 -07:00
doltversion build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
eventsjournal build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
execenv test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
fdhygiene build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
formula fix(formula): substitute vars in step assignee, labels, and metadata (#5758) 2026-09-30 18:08:44 -07:00
git fix(init): use selected hook context in embedded initialization (#6464) 2026-09-29 16:54:33 -07:00
gitenv fix(hooks): identify the index context behind tracked-file refusals (#6457) 2026-09-27 18:07:43 -07:00
githooksenv test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
github build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
gitignore fix(worktree): preserve CRLF gitignore appends (#5677) 2026-09-30 01:46:12 -07:00
gitlab build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
gittraceenv test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
hooks build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
httpapi fix(status): disclose the counted rows bd list will not show (#5763) 2026-09-30 15:44:40 -07:00
idgen build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
jira cmd/bd: bd label rename <old> <new> (stacked on #6007) (#6009) 2026-09-29 17:02:35 -07:00
linear test(bazel): fully green //..., tag taxonomy + docker lane, sharding, test sandbox ceiling (#6871) 2026-09-27 20:19:38 -07:00
lockfile build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
memoryapi build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
metrics test(bazel): fully green //..., tag taxonomy + docker lane, sharding, test sandbox ceiling (#6871) 2026-09-27 20:19:38 -07:00
migration build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
molecules test(testutil): opt-in local dolt sql-server backend for Dolt-backed tests (#6891) 2026-09-28 04:06:49 -07:00
notion test(bazel): fully green //..., tag taxonomy + docker lane, sharding, test sandbox ceiling (#6871) 2026-09-27 20:19:38 -07:00
procid build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
query build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
recipes build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
remotecache fix(doltremote): treat s3:// as a native Dolt remote scheme (#5948) 2026-09-29 06:28:57 -07:00
routing test(bazel): fully green //..., tag taxonomy + docker lane, sharding, test sandbox ceiling (#6871) 2026-09-27 20:19:38 -07:00
storage test(credentials): make remaining credential-command fixtures native-Windows portable (#5748) (#5749) 2026-09-30 18:30:25 -07:00
telemetry cmd/bd: bd label rename <old> <new> (stacked on #6007) (#6009) 2026-09-29 17:02:35 -07:00
templates fix(prime): describe the memory split instead of prohibiting MEMORY.md (#6111) 2026-09-29 01:23:19 -07:00
testutil test(credentials): make remaining credential-command fixtures native-Windows portable (#5748) (#5749) 2026-09-30 18:30:25 -07:00
timeparsing build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
tracker ci(bazel): dolt-server lane on remote execution (replaces the docker lane) (#6898) 2026-09-28 05:17:36 -07:00
types fix(import): normalize optional timestamps to UTC on insert (#5771) 2026-09-30 16:00:03 -07:00
ui build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
uimd build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
utils fix(utils): refuse a bare jq/JS sentinel (null, undefined, empty) as an issue ID (#6215) 2026-09-29 17:15:45 -07:00
validation build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00
workapi fix(status): disclose the counted rows bd list will not show (#5763) 2026-09-30 15:44:40 -07:00
workspacegate test(bazel): fully green //..., tag taxonomy + docker lane, sharding, test sandbox ceiling (#6871) 2026-09-27 20:19:38 -07:00
worktreeremove build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00