Update test assertions in dolt_status_ignored tests to use boolean
values (true/false) instead of byte values (byte(0)/byte(1)) for the
ignored column in statusIgnoredTableRow.
Refs: #5862
Address PR review feedback for dolt_status_ignored implementation
with refactors to error handling, adapter pattern, test
coverage, and copyright year.
Changes:
- Fix copyright year from 2020 to 2025 in status_ignored_table.go
- Add adapter pattern to NewStatusIgnoredTable; matches
StatusTable implementation.
- Add NewStatusIgnoredTableWithNoAdapter for default behavior
- Fix error handling in checkIfIgnored to return errors instead
of silently returning byte(0)
- Propagate ignore pattern errors up the call stack
Test coverage additions:
- Empty dolt_ignore table test verifying all tables show
ignored=0
- Conflicting patterns test with wildcard (test_*=true) vs
specific override (test_special=false)
- Update ls.bats to expect 27 system tables instead of 26
Error handling refactored to now matches patterns in status.go, commit
.go, and diff.go where IsTableNameIgnored errors are properly propagated
up rather than swallowed.
Refs: #5862
Add new dolt_status_ignored system table that extends dolt_status with
an "ignored" column to show which unstaged tables match dolt_ignore
patterns. This provides SQL equivalent of dolt status --ignored
functionality.
Implementation includes:
- StatusIgnoredTable type with schema containing table_name,
staged, status, and ignored columns
- Registration in system table constants and generated table
names lists
- Helper function getStatusTableRootsProvider to eliminate
duplicate switch case logic between StatusTableName and
StatusIgnoredTableName in database.go
- Shared getStatusRowsData function used by both dolt_status
and dolt_status_ignored to collect status data from roots and
working set
- Unexported helper functions in status_ignored_table.go for
ignore pattern checking: getIgnorePatterns,
buildUnstagedTableNameSet, and checkIfIgnored
- bats integration tests verifying behavior
The ignored column is only set for unstaged tables that match
patterns in dolt_ignore. Staged tables, constraint violations,
merge conflicts, and schema conflicts always have ignored = 0.
Refs: #5862
Add tests for the --filter=renamed option and the --filter=removed alias
that maps to dropped.
Go tests:
- Tests for filter=renamed checking all diff types
- Tests for "removed" alias mapping to dropped internally
- Verify renamed filter only includes renamed tables
BATS tests:
- Test --filter=renamed with table rename scenario
- Test --filter=dropped with table drop scenario
- Verify --filter=removed alias works same as dropped
- Verify other filters correctly exclude renamed/dropped tables
Refs: #1430
When Dolt CLI is running in a directory with a corresponding running sql-server
process, it will connect to the server process and complete its work using SQL
statements. Previously, the Dolt CLI was configured to always connect on a
plaintext TCP connection for these connections. That meant it did not work for
servers configured with require_secure_transport: true. One consequence was
that the published Dolt dockerhub image did not work with
require_secure_transport: true, since that image runs `dolt sql` against the
running server as part of its entrypoint.
This changes `dolt` CLI to connect over (non-verified) TLS if such as an option
is presented by the server. The CLI still falls back to plaintext as well.
Dolt CLI still does not work when the server is configured with
require_client_certificate, since Dolt CLI does not currently have a way to
configure its presented client certificate and private key. As a consequence,
at least for the time being, the published DockerHub images for Dolt do not
work with require_client_certificate: true.
The issue was that start_sql_server_with_args appends --port after
--config, but the config file was resetting to defaults. Fixed by:
1. Calling definePORT to get an available port
2. Including the port in the config file under listener.port
3. Using start_sql_server_with_args_no_port which expects PORT to be set
All 6 branch-activity tests now pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The start_sql_server_with_config function creates a config with
a 'behavior:' section and appends the provided config file. This
caused a YAML parse error when our config also had a 'behavior:' key.
Fixed by creating a complete config file and using start_sql_server_with_args
instead, which avoids the duplicate key issue.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Modified branch-activity.bats to use config file that enables tracking
- Added IsTrackingEnabled() method to BranchActivityTracker
- Added error check in branch_activity_table to return helpful error message
when tracking is disabled
- Added new test case to verify error is shown when tracking is disabled
- Error message instructs users to enable via config:
'behavior.branch_activity_tracking: true'
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implement lazy table header initialization to fix a bug where
empty table headers were printed when all rows were filtered out
during data-only diffs. This occurred because BeginTable() was
called before row filtering, causing headers to print even when
no matching rows existed.
The solution introduces a lazyRowWriter that delays the BeginTable()
call until the first row is actually written. This wrapper is only
used when:
- A filter is active (added/modified/removed)
- The diff is data-only (no schema changes or table renames)
Implementation changes:
- Add shouldUseLazyHeader() helper to determine when to use lazy
initialization based on filter presence and diff type
- Add lazyRowWriter type that wraps SqlRowDiffWriter and delays
BeginTable() until first WriteRow() or WriteCombinedRow() call
- Modify diffUserTable() to skip BeginTable when using lazy writer
- Modify diffRows() to conditionally create lazyRowWriter vs normal
rowWriter based on shouldUseLazyHeader() check
- Add comprehensive unit tests for shouldUseLazyHeader logic and
lazyRowWriter behavior (5 test functions, 8+ test cases)
- Add mock implementations of diffWriter and SqlRowDiffWriter
interfaces to enable testing without database dependencies
- Fix BATS test assertions to match actual SQL output format
(lowercase type names, MODIFY COLUMN vs DROP/ADD pattern)
Test coverage:
- TestShouldUseLazyHeader: validates lazy header logic conditions
- TestLazyRowWriter_NoRowsWritten: verifies BeginTable not called
when no rows written (core lazy behavior)
- TestLazyRowWriter_RowsWritten: verifies BeginTable called on
first write
- TestLazyRowWriter_CombinedRowsWritten: tests combined row writes
- TestLazyRowWriter_InitializedOnlyOnce: ensures BeginTable called
exactly once
Refs: #1430
Add Go unit tests for the diff filter feature to provide fast
feedback and granular validation of filter logic.
Test coverage includes:
- diffTypeFilter struct validation (isValid method)
- Filter inclusion methods (adds, drops, modifications)
- Edge cases (empty strings, typos, case sensitivity)
- Consistency checks across all filter types
- Constant validation (values, uniqueness, lowercase)
- Invalid filter behavior verification
Tests added:
- 12 test functions
- 48+ individual test cases
- 100% coverage of diffTypeFilter struct methods
These tests complement the existing BATS integration tests
and provide unit-level regression protection.
Refs: #1430