Skip to content

Refactor data task#155

Draft
torresga wants to merge 5 commits intomainfrom
refactor-data-task
Draft

Refactor data task#155
torresga wants to merge 5 commits intomainfrom
refactor-data-task

Conversation

@torresga
Copy link
Copy Markdown

@torresga torresga commented Mar 25, 2026

Summary

  • Replaces the two-task setup (find_or_create_rails_releases + update_rails_releases) with a single canonical data:sync_rails_releases task that creates and updates Rails releases in one pass
  • Adds guards in the task to raise early if minimum_ruby_version or minimum_bundler_version are missing for any version entry
  • Adds model-level presence validations for minimum_ruby_version and minimum_bundler_version on RailsRelease
  • Updates README setup instructions to reference the new task name

Test plan

  • Run rake data:sync_rails_releases on a fresh database and verify all releases are created with required fields populated
  • Verify that removing minimum_ruby_version from an entry in the task raises an error before any DB writes
  • Verify that saving a RailsRelease without minimum_ruby_version or minimum_bundler_version fails validation

Fixes #145

* 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
@sentry
Copy link
Copy Markdown

sentry bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.38%. Comparing base (1676056) to head (c1d463b).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

has_many :compats, dependent: :destroy

validates :version, presence: true, format: { with: /\A\d+\.\d+\z/, allow_blank: true }
validates :minimum_ruby_version, presence: true
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To me that service is dead code. we probably can remove it since we have the lib/tasks/data.rake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace split Rails release tasks with one canonical sync + integrity check task

2 participants