fix(connections): read an SSH config saved before the agent socket field existed - #2377
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Ten entries out of the quarantine file, 42 to 32. One of them was a real bug the quarantine was hiding.
The bug
SSHConfiguration.init(from:)decodedagentSocketPathwithtry container.decode, while every sibling field that has a default useddecodeIfPresent ?? default. The property has a default too:So an SSH config written before that field existed throws
keyNotFound, and a connection that fails to decode is a connection the user no longer has. Every defaulted key now decodes as optional, which is what the rest of the initializer already did.DatabaseConnectionExternalAccessTestswas catching this and sat under the label "stale fixture: the model gained a field the fixture JSON does not carry". The fixture was right and the code was wrong.The others, and why the label mattered
The same three-case group turned out to hold three different causes. Taking the group label at face value would have produced migration paths for data that never existed.
agentSocketPathmissing"rowHeight": "normal"DataGridRowHeighthas beenInt-backed since301c9fb28introduced it, so that string never shipped. Fixture invented it"sshTunnelMode": { "kind": ... }mode;git log -S'case kind'finds nothing. Fixture invented it"sslConfig": { "mode": ... }Three invented values in one hand-written fixture, which is a class of rot rather than three mistakes. Both external-access cases now build their JSON by encoding a real
DatabaseConnectionand editing the one key under test, so the fixture cannot describe a document the encoder would not produce.Tests moved to the layer that owns the behaviour
ALTER TABLE ... UPDATEandALTER TABLE ... DELETE WHEREare written in exactly one place,ClickHousePlugin.swift:386. The app'sSQLStatementGeneratoremits the plain form for every engine. Three cases asserted the ClickHouse shape throughDataChangeManagerwith no driver connected, which that layer cannot produce and never could.generateStatementsonClickHousePluginDriveris internal, and the driver constructs from a config without dialling anywhere, so the assertion is testable at its owner.ClickHouseDMLStatementTestscovers update, delete, and two the old cases did not: that an insert stays a plainINSERT, and that a delete absent fromdeletedRowIndicesproduces nothing.That needed four plugin files in the test target rather than one.
ClickHousePlugin.swiftalone fails to compile there becauseClickHousePluginDriveris spread across three extension files.The rest
TableQueryBuilderFilteredQueryTestsbuiltTableQueryBuilder(databaseType: .mysql)with no dialect, and the dialect is what carries the SQL syntax, so there was noWHEREto produce.TableQueryBuilderNoSQLTestsin the same file asserts exactly that for MongoDB. The sibling count suite already supplied one.ClickHouseDialectTests/testFactoryFallbackWithoutPluginasserted an empty fallback "when plugin not loaded". The ClickHouse driver is bundled and the test host is the app, so the fallback is unreachable and the factory returns the real dialect.PluginCapabilityTests/decodingRemovedRawValueFailsasserted raw value 3 was undecodable.PluginCapabilitygrew a fourth case and 3 is nowdocumentInspector. It tests a value outside the range instead, plus a round-trip over every declared case.Verification
The quarantine file records where each removed case went, so the next person is not looking for a deleted suite.
Still quarantined
32, with the largest block being 12 change-tracking cases. Those need a decision this PR does not make:
reloadVersionincrements onclearChanges,discardChangesandconfigureForTable, and deliberately not onrecordCellChange, because a reload there would discard the user's uncommitted edits. The tests assert the opposite.