Conversation
* Merge find_or_create_rails_releases and update_rails_releases into a single data:sync_rails_releases task * Add guards to raise early if minimum_ruby_version or minimum_bundler_version are missing for any version entry
… to ensure that they are set on creation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #155 +/- ##
===========================================
- Coverage 87.00% 63.38% -23.63%
===========================================
Files 48 48
Lines 708 710 +2
===========================================
- Hits 616 450 -166
- Misses 92 260 +168 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| has_many :compats, dependent: :destroy | ||
|
|
||
| validates :version, presence: true, format: { with: /\A\d+\.\d+\z/, allow_blank: true } | ||
| validates :minimum_ruby_version, presence: true |
There was a problem hiding this comment.
Are these the validations you had in mind, @JuanVqz? Between the spec failures that arise due to this change and this call to RailsRelease.create in https://github.com/railsbump/app/blob/main/app/services/rails_releases/create.rb#L13 maybe we shouldn't be validating whether these values are present after all? Please let me know what you think.
There was a problem hiding this comment.
To me that service is dead code. we probably can remove it since we have the lib/tasks/data.rake.
Summary
find_or_create_rails_releases+update_rails_releases) with a single canonicaldata:sync_rails_releasestask that creates and updates Rails releases in one passminimum_ruby_versionorminimum_bundler_versionare missing for any version entryminimum_ruby_versionandminimum_bundler_versiononRailsReleaseTest plan
rake data:sync_rails_releaseson a fresh database and verify all releases are created with required fields populatedminimum_ruby_versionfrom an entry in the task raises an error before any DB writesRailsReleasewithoutminimum_ruby_versionorminimum_bundler_versionfails validationFixes #145