fix(EnsureAllMetadata): prevent ping-pong when two databases map to same rig#3221
Closed
baumgold wants to merge 9 commits intogastownhall:mainfrom
Closed
fix(EnsureAllMetadata): prevent ping-pong when two databases map to same rig#3221baumgold wants to merge 9 commits intogastownhall:mainfrom
baumgold wants to merge 9 commits intogastownhall:mainfrom
Conversation
❌ 3 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
added 2 commits
March 24, 2026 13:14
…ame rig (gt-cn4) When a rig has two Dolt databases (e.g., 'gastown' and 'gt' both mapping to the gastown rig via routes.jsonl), EnsureAllMetadata previously called EnsureMetadata for each database independently. Each call overwrote the other's dolt_database value, producing alternating correcting warnings in 'gt up' output. Fix: group databases by rig before processing. For rigs with multiple databases, read the rig's existing metadata.json — if it already points to one of the valid databases, keep it (stable, no rewrite). Only when no stable value exists fall back to the lexicographically first candidate for determinism. Each rig is now processed exactly once. Add TestEnsureAllMetadata_NoPingPong regression test covering the two-DB scenario for the same rig.
ababea9 to
67c374d
Compare
…ent_enabled and review_depth vars (gt-lch)
…resolved (gt-lch) When the configured agent binary (e.g. opencode) is not in PATH, ResolveRoleAgentConfig falls back to claude and the plugin files are never created. Switch to ResolveRoleAgentName (no binary validation) so hooks are installed based on the configured agent regardless of whether the binary is currently available on the machine.
… (gt-n8f) TestStampLoop_SelfStampFails and TestStampLoop_InvalidValence both call t.Parallel() while mutating shared wlStamp* package-level vars, causing data races detected by -race. Remove the t.Parallel() calls; these tests are sequential by nature given the save/restore pattern.
ResolveRoleAgentConfig falls back to 'claude' when the agent binary is not found in PATH (e.g., opencode in CI), causing the doctor to skip non-Claude template agent targets and falsely report all targets in sync. Use ResolveRoleAgentName instead to get the configured agent name regardless of whether its binary is installed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…(gt-xwr) CanForceRemove() now returns true for CleanupUnpushed. Previously --force only allowed uncommitted changes but still blocked on unpushed commits, making it impossible to remove a polecat whose branch was synced with its own tracking branch but whose repo contained other polecats' branches with unpushed work. GitHub: #3238 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e (gt-1at)
Windows paths contain backslashes which are invalid in JSON strings without
escaping. When {{GT_BIN}} was substituted into JSON templates, it produced
invalid JSON on Windows, causing TemplateContentEqual to fail to unmarshal
the content and incorrectly return false (triggering SyncUpdated instead
of SyncUnchanged).
Fix: escape backslashes before substitution.
Fixes TestSyncForRole_JSONWhitespaceInsensitive on Windows.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Closing in favor of individual focused PRs:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes ping-pong when two Dolt databases map to the same rig (e.g. 'gastown' and 'gt' both mapping to gastown rig). When multiple databases resolve to the same rig, prefer the one
metadata.jsonalready points to. EliminatesWarning: metadata.json dolt_database was "X", correcting to "Y"spam duringgt up.Fixes #3222