Repository navigation
[CASE-4447] Release 2.1.2 and fix the failing CI checks - #84
Merged
Merged
Conversation
…arison Rails main (8.2.0.alpha, rails/rails@03a3ed8397) adds the conflicting record's id to the uniqueness error details. On save the error comes from the database, which does not report the id, so the comparison with Rails' own validator failed in the railsmaster job (62 examples).
aitorlb
marked this pull request as ready for review
October 27, 2026 10:03
AlfonsoUceda
approved these changes
Oct 27, 2026
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.
Ticket: CASE-4447
Draft. Releases 2.1.2 with #82 and #83, and makes
master's CI green first: both failing jobs fail onmastertoo, independently of those two PRs.Problem
masterfails two CI jobs:rubocop: three offenses already onmaster.database_validations.gemspec:12(Layout/ExtraSpacing,Layout/SpaceAroundOperators) and therubocop:disablecomment inspec/validations/db_belongs_to_spec.rb(Lint/CopDirectiveSyntax, a trailing:after the cop name).test (4.0, railsmaster): 62 failures, all inspec/validations/validates_db_uniqueness_of_spec.rb(has (almost) the same errorsanddoes not break transaction: 22 on PostgreSQL, 18 on MySQL, 22 on SQLite), every one of them the same difference. Rails main (8.2.0.alpha) now adds the conflicting record's id to the uniqueness error details (rails/rails@03a3ed8397, "Include record ID in error when uniqueness validation fails"):Fix
existing_idout of Rails' details. On save the error comes from the database's unique violation, which reports the key's values but not the existing row's id, so the gem cannot supply it without the query it exists to avoid. Thevalid?path still compares exactly: there the gem runs Rails' own query, so both sides carryexisting_id.## [2.1.2] - 2026-10-27, andversion.rbis bumped, as in the 2.1.0 and 2.1.1 releases. A patch version: [CASE-4454] Unique violation without key detail is handled on PostgreSQL #82 fixes aNoMethodErrorand [CASE-4447] Handle a violated composite foreign key in db_belongs_to on PostgreSQL #83 makesdb_belongs_toadd the validation error it already promises for a composite key; neither adds API. [CASE-4447] Handle a violated composite foreign key in db_belongs_to on PostgreSQL #83's entry now starts with "Fix …" like [CASE-4454] Unique violation without key detail is handled on PostgreSQL #82's.One behaviour to know about on Rails 8.2: a uniqueness error the gem adds on save has no
existing_id, while Rails' own validator's has. This PR does not change that.Tests
83ddc9f, 8.2.0.alpha):validates_db_uniqueness_of_spec.rbhas 22 failures withmaster's spec and 0 with this one; the PostgreSQL examples underspec/validationsandspec/adapterspass (192).Not run
MySQL and SQLite: no MySQL server here and no
sqlite3in this environment's bundle. CI covers them; their failures in the railsmaster job are the sameexisting_iddifference, and the fix is in the adapter-independent shared example.Reviewed by a separate agent before opening; its two wording points (the spec comment, the CHANGELOG entry) are applied.
After merging, the release itself (tag
v2.1.2on the mergedmastercommit, as for v2.1.0 and v2.1.1, and the gem push) is for a maintainer.career-services-backendthen bumps to 2.1.2 for toptal/career-services-backend#2195.🤖 Generated with Claude Code