Fix what the full CI suite caught that local runs could not

Three failures, all real, none of them visible to the contract suites or to
golangci-lint.

DELETES STOPPED BEING VERSIONED ON EMBEDDED. The single-id route used to run
transactHonoringAutoCommit with a "bd: delete <id>" message, and that message
is what created the Dolt version commit. Routing the command onto
issueops.Deleter dropped it: the embedded deleter reaches its transaction
through withConn, which does a SQL commit and no version commit. So the rows
went and HEAD stood still — on every embedded delete, not only the routed one.
TestEmbeddedRoutedMutatingSiblingWritesCommitTargetHead/delete is what noticed,
because a routed sibling's HEAD is observable from the other repository.

Both delete paths now commit through commitPendingIfEmbedded, against the store
the rows were actually deleted from — for a prefix-routed id that is the TARGET
repository, not this workspace. Batch and off modes are still honored, because
maybeAutoCommitStore returns early unless auto-commit is on; the batch-mode
case is pinned separately and still passes.

This is also why the earlier issueOpsContext revert was right rather than lucky:
the role does not defer, so deferral has to be the front door's decision, and
that is exactly where the commit now lives.

THE SERVE CAPABILITY LIST was still the pre-programme four. Its own comment says
"the next operation to arrive stubbed still fails here" — it is designed to
fail when operations land, and it did. The file never conflicted, so the series
never saw it. Now the sixteen this build publishes.

A MERGE ARTIFACT MADE ONE TEST SELF-CONTRADICTORY: the reconciled output suite
required "Orphaned 1 issue(s)" in the prose and then asserted "Orphaned" was
absent, because my required-line survived in a non-conflicted region beside
main's no-orphan assertion. main's base fixture carries no orphans and its
orphan subtest copies it; the base is now orphan-free to match.

Not fixed here, and not ours: Check doc flags freshness fails on three docs
this series never touches, which crossed a 90-day review threshold. Open PRs
#5381 and #5384 fail the same check.
This commit is contained in:
CI Bot 2026-08-07 01:02:17 +00:00
commit e9acfac6eb
3 changed files with 51 additions and 6 deletions

View file

@ -153,6 +153,25 @@ Force: Delete and orphan dependents
commandDidWrite.Store(true)
// THE DELETE IS VERSIONED HERE. issueops.Deleter reaches its transaction
// through withConn, which does a SQL commit and no Dolt version commit, so
// nothing below the role advances HEAD. Before the role this route ran
// transactHonoringAutoCommit with a "bd: delete <id>" message, and that is
// what versioned the change; dropping it made embedded deletes unversioned
// and left a routed sibling's HEAD standing still.
//
// It commits the store the rows were actually deleted from, which for a
// prefix-routed id is the TARGET repository rather than this workspace.
// Batch and off modes are honored inside: maybeAutoCommitStore returns
// early unless auto-commit is on.
if err := commitPendingIfEmbedded(ctx, activeStore, actor, doltAutoCommitParams{
Command: "delete",
IssueIDs: []string{issueID},
MessageOverride: fmt.Sprintf("bd: delete %s", issueID),
}); err != nil {
WarnError("failed to commit: %v", err)
}
if jsonOutput {
// The single-issue keys, unchanged: `deleted` is the id rather than a
// list here, which is what every `bd delete <one-id> --json` parses.
@ -345,6 +364,24 @@ func deleteBatch(_ *cobra.Command, issueIDs []string, force bool, dryRun bool, c
commandDidWrite.Store(true)
// THE DELETE IS VERSIONED HERE. issueops.Deleter reaches its transaction
// through withConn, which does a SQL commit and no Dolt version commit, so
// nothing below the role advances HEAD. Before the role this route ran
// transactHonoringAutoCommit with a "bd: delete <id>" message, and that is
// what versioned the change; dropping it made embedded deletes unversioned
// and left a routed sibling's HEAD standing still.
//
// It commits the store the rows were actually deleted from, which for a
// prefix-routed id is the TARGET repository rather than this workspace.
// Batch and off modes are honored inside: maybeAutoCommitStore returns
// early unless auto-commit is on.
if err := commitPendingIfEmbedded(ctx, batchStore, actor, doltAutoCommitParams{
Command: "delete",
IssueIDs: resolvedIDs,
}); err != nil {
WarnError("failed to commit: %v", err)
}
if jsonOutput {
if err := outputJSON(map[string]interface{}{
"deleted": resolvedIDs,

View file

@ -178,7 +178,9 @@ func TestOutputDeleteProxiedPreviewExactContracts(t *testing.T) {
}
func TestRenderDeleteProxiedResultExactContracts(t *testing.T) {
res := issueops.DeleteResult{Deleted: 3, Dependencies: 4, Labels: 2, Events: 5, ReferencesUpdated: 1, Orphaned: []string{"bd-orphan"}}
// No orphans on the base result: the subtests below assert the WITHOUT-orphans
// contract, and the orphan case copies this and adds its own.
res := issueops.DeleteResult{Deleted: 3, Dependencies: 4, Labels: 2, Events: 5, ReferencesUpdated: 1}
t.Run("JSON includes the complete final aggregate", func(t *testing.T) {
in := &deleteInput{ids: []string{"bd-target", "bd-dependent"}, jsonOutput: true}
@ -213,7 +215,6 @@ func TestRenderDeleteProxiedResultExactContracts(t *testing.T) {
for _, required := range []string{
"Deleted 3 issue(s)", "Removed 4 dependency link(s)", "Removed 2 label(s)",
"Removed 5 event(s)", "Updated text references in 1 issue(s)",
"Orphaned 1 issue(s): bd-orphan",
} {
if !strings.Contains(out, required) {
t.Errorf("final prose missing %q:\n%s", required, out)

View file

@ -221,14 +221,21 @@ func TestProxiedServerServeLifecycle(t *testing.T) {
}
// The handshake advertises exactly what this build implements. A client
// that gates on capabilities is then correct without knowing which
// release it hit. With the read endpoints landed that is the whole v0
// vocabulary; the assertion is on the derived list, not on a count, so
// the next operation to arrive stubbed still fails here.
// release it hit. The assertion is on the derived list, not on a count,
// so the next operation to arrive stubbed still fails here — which is
// what it did when the facade programme took this from four operations
// to sixteen. Update it deliberately when you add one.
caps, ok := body["capabilities"].([]any)
if !ok {
t.Fatalf("capabilities = %#v, want an array", body["capabilities"])
}
want := []any{"issues.claim", "issues.get", "issues.list", "ready.list"}
want := []any{
"config.get", "config.list",
"dependencies.blocking", "dependencies.cycles", "dependencies.list", "dependencies.tree",
"issues.batchCreate", "issues.claim", "issues.delete", "issues.get", "issues.list",
"issues.query", "issues.sweep",
"ready.count", "ready.list", "stats.get",
}
if !reflect.DeepEqual(caps, want) {
t.Errorf("capabilities = %v, want %v", caps, want)
}