Skip to content

Thread database_name through Migration/CompiledMigration/TimeoutPolicies - #157

Merged
BBrannick merged 9 commits into
masterfrom
thread-database-name-config
Aug 13, 2026
Merged

Thread database_name through Migration/CompiledMigration/TimeoutPolicies#157
BBrannick merged 9 commits into
masterfrom
thread-database-name-config

Conversation

@BBrannick

Copy link
Copy Markdown
Contributor

Summary

  • Nandi::Config's per-database timeout lookup methods (access_exclusive_lock_timeout, concurrent_statement_timeout, etc.) already accepted an optional database_name argument, but nothing in the migration-compilation pipeline ever passed one — every timeout/config lookup always resolved against the default database, even for migrations compiled against a non-default database (e.g. a YugabyteDB-configured database).
  • Threads database_name end-to-end: CompiledMigration#migrationMigration.new(validator, database_name:)Migration#database_namedisable_lock_timeout?/disable_statement_timeout?/default_statement_timeout/default_lock_timeoutTimeoutPolicies::AccessExclusive/Concurrent (via migration.database_name).
  • database_name: nil remains the default at every layer, so this is a fully backward-compatible change — zero behavior difference for single-database or default-database usage.
  • Reuses the threading mechanism from a previously closed/unmerged PR (Allow disabling CONCURRENTLY on remove_index #156), as fresh commits on a new branch off master. Deliberately excludes that PR's unrelated remove_index concurrently: feature, which is why it was closed.
  • Adds spec/nandi/timeout_policies/concurrent_spec.rb, which previously had zero coverage.

Test plan

  • Full suite passes: bundle exec rspec (433 examples, 0 failures)
  • bundle exec rubocop reports 0 offenses
  • New/updated specs cover: Migration#database_name (default + explicit), CompiledMigration#migration passing database_name, and TimeoutPolicies::AccessExclusive/Concurrent resolving bounds against a non-default database

🤖 Generated with Claude Code

@BBrannick BBrannick added the bug Something isn't working label Aug 5, 2026
@BBrannick
BBrannick requested a review from a team August 5, 2026 10:22

@orlylevk orlylevk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes looks ok
Can we add the bug fix in here CHANGELOG.md + update the minor version

Comment thread CHANGELOG.md
@BBrannick
BBrannick merged commit b7e6408 into master Aug 13, 2026
10 checks passed
@BBrannick
BBrannick deleted the thread-database-name-config branch August 13, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants