-
-
Notifications
You must be signed in to change notification settings - Fork 60
Add e2e specs Rails 8 #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis pull request removes legacy Rails 5.2 files and adds a comprehensive set of new files supporting a Rails 8 environment. A new GitHub Actions workflow job named Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as GitHub Actions Runner
participant Checkout as Checkout Action
participant RubySetup as Ruby Setup Action
participant Bundler as Bundler Manager
participant Tests as Test Executor
Runner->>Checkout: Checkout repository
Runner->>RubySetup: Set up Ruby 3.2.2
Runner->>Bundler: Uninstall bundler (>=2) and install bundler (<2)
Runner->>Tests: Run tests with `bundle exec rake`
Runner->>Tests: Execute interaction tests via ./specs_e2e/rails_8/test.sh
Possibly related PRs
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
🧹 Nitpick comments (22)
specs_e2e/rails_8/config/deploy.yml (1)
7-15
: Server Deployment ConfigurationThe
servers:
block properly designates a web server with the specified IP, and the job section is commented out for now. If the job functionality is not required in this phase, consider adding a clarifying note or removing it to reduce clutter.specs_e2e/rails_8/config/initializers/filter_parameter_logging.rb (1)
6-8
:❓ Verification inconclusive
Consider adding more financial and personal identifiers.
The current list of filtered parameters provides good security coverage. However, consider adding more common sensitive parameters:
- Financial:
:card
,:account
,:routing
,:iban
- Personal:
:phone
,:dob
,:birth
,:ssn
,:sin
,:tax
Rails.application.config.filter_parameters += [ - :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc + :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc, + :card, :account, :routing, :iban, :phone, :dob, :birth, :sin, :tax ]Let's verify if any of these sensitive parameters are being used in the codebase:
🏁 Script executed:
#!/bin/bash # Search for potential sensitive parameters in the codebase echo "Searching for sensitive parameter usage..." rg -i "params\.(card|account|routing|iban|phone|dob|birth|sin|tax)"Length of output: 164
Enhance Sensitive Parameter Filtering
Please update the filtering configuration in
specs_e2e/rails_8/config/initializers/filter_parameter_logging.rb
to include additional financial and personal identifiers. The improved snippet would appear as follows:Rails.application.config.filter_parameters += [ - :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc + :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc, + :card, :account, :routing, :iban, :phone, :dob, :birth, :sin, :tax ]A preliminary grep search for these additional parameter names did not produce any output. Since this inference may be low-confidence, please perform a manual verification to ensure that adding these parameters aligns with your application's usage patterns and security requirements.
specs_e2e/rails_8/public/404.html (2)
104-106
: Enhance SVG Accessibility – Improvement RecommendedThe inline SVG used in the header is visually appealing; however, adding accessibility attributes (such as
role="img"
and, if the SVG is purely decorative,aria-hidden="true"
) can enhance support for screen readers and improve overall accessibility.
112-115
: Extraneous Content Detected – NitpickThere appears to be an extraneous line (the standalone "115") at the end of the file. Removing it would help maintain clean markup and prevent any unintended rendering issues.
specs_e2e/rails_8/config/environments/production.rb (1)
15-26
: Consider production-grade storage and CDN configuration.While the caching configuration is good, consider the following production optimizations:
- Using a CDN by uncommenting and configuring
asset_host
- Using a cloud storage service (like AWS S3) instead of local storage for better scalability
specs_e2e/rails_8/public/400.html (1)
104-106
: SVG Accessibility Enhancement
The inline SVG within the header is a key visual element. Consider adding an accessibility attribute (e.g.,aria-hidden="true"
) if the graphic is purely decorative, or an appropriaterole
/title
if it conveys meaningful information.specs_e2e/rails_8/db/queue_schema.rb (3)
14-20
: Consider adding a foreign key forprocess_id
.
solid_queue_claimed_executions
references aprocess_id
yet lacks a correspondingadd_foreign_key
, which can lead to orphan records if processes are deleted or restructured.Potential fix:
+ add_foreign_key "solid_queue_claimed_executions", "solid_queue_processes", + column: "process_id", on_delete: :cascade
53-65
: Add referential integrity forsupervisor_id
.
Ifsupervisor_id
references another record insolid_queue_processes
, consider enforcing referential integrity with a foreign key for transactionally consistent data.
123-129
: Confirm broad on-delete cascade usage.
All foreign keys cascade on delete, which can be powerful but also risky if jobs or related records are unintentionally removed. Ensure these actions align with your data-retention policies.Do you need help creating a quick guide or flow diagram on how this cascade might operate in production?
specs_e2e/rails_8/bin/brakeman (1)
1-7
: Add frozen string literal pragma.
Consider adding# frozen_string_literal: true
at the top of the file to maintain consistency with newer Ruby style guidelines and potentially improve performance.Proposed change:
1c1 - #!/usr/bin/env ruby + #!/usr/bin/env ruby +# frozen_string_literal: truespecs_e2e/rails_8/test/test_helper.rb (1)
13-13
: Consider adding common test helper methods.The comment indicates a placeholder for helper methods. Consider adding commonly needed helpers for:
- Authentication setup
- Factory methods for test data
- Common assertions
Would you like me to suggest some common helper methods implementation?
specs_e2e/rails_8/db/cable_schema.rb (2)
3-6
: Consider optimizing binary field sizes.The binary field sizes are quite large:
channel
at 1KBpayload
at 512MB
Consider if these limits are necessary for your use case, as they might impact database performance.
5-5
: Consider adding updated_at timestamp.The table only has
created_at
but missingupdated_at
. While this might be intentional for message logging, having both timestamps is a Rails convention and might be useful for debugging or maintenance.t.datetime "created_at", null: false +t.datetime "updated_at", null: false
specs_e2e/rails_8/app/views/layouts/application.html.erb (2)
4-4
: Consider a more descriptive default title.The default title "App" is quite generic. Consider using a more descriptive application name.
- <title><%= content_for(:title) || "App" %></title> + <title><%= content_for(:title) || "Rails 8 E2E Tests" %></title>
5-9
: Add recommended security headers.Consider adding additional security-related meta tags and headers for better protection.
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes"> + <meta name="referrer" content="strict-origin-when-cross-origin"> <%= csrf_meta_tags %> <%= csp_meta_tag %> + <%= tag.meta name: "robots", content: "noindex" if Rails.env.test? %>specs_e2e/rails_8/config/application.rb (1)
17-17
: Consider additional autoload ignores for e2e specs.For e2e testing setup, you might want to ignore additional directories.
- config.autoload_lib(ignore: %w[assets tasks]) + config.autoload_lib(ignore: %w[assets tasks specs_e2e])specs_e2e/rails_8/config/environments/development.rb (2)
28-29
: Consider using :null_store for e2e tests.Using :memory_store might cause inconsistencies in e2e tests. Consider using :null_store or adding a comment about e2e test considerations.
- # Change to :null_store to avoid any caching. - config.cache_store = :memory_store + # Use :null_store for e2e tests to avoid caching-related flakiness + config.cache_store = Rails.env.test? ? :null_store : :memory_store
40-42
: Consider disabling query logs in e2e tests.Verbose query logs might slow down e2e tests unnecessarily.
# Highlight code that triggered database queries in logs. - config.active_record.verbose_query_logs = true + config.active_record.verbose_query_logs = !Rails.env.test?specs_e2e/rails_8/Gemfile (1)
17-20
: Consider adding additional testing gems.While the current setup with
cypress-on-rails
anddatabase_cleaner
is good, consider adding these gems to improve the testing experience:
factory_bot_rails
for test data setupfaker
for generating test datashoulda-matchers
for RSpec-like assertionsgroup :development, :test do gem 'cypress-on-rails', path: '../../' gem 'database_cleaner' + gem 'factory_bot_rails' + gem 'faker' + gem 'shoulda-matchers' end.github/workflows/ruby.yml (1)
46-64
: Review: New rails_8 Job ConfigurationThe addition of the
rails_8
job is well executed. By updating to Ruby 3.2.2 and reusing the bundler commands (uninstalling conflicting versions and installing the required bundler version), the configuration aligns nicely with the Rails 8 environment. Ensure that the./specs_e2e/rails_8/test.sh
script is kept up to date with any new Rails 8 testing requirements.As an optional improvement, consider refactoring shared steps (like checking out the repo, Ruby setup, and bundler management) into YAML anchors for enhanced maintainability across similar jobs.
specs_e2e/rails_8/config/initializers/content_security_policy.rb (2)
19-21
: Consider a more secure nonce generator for production use.While using
session.id
as a nonce generator works, consider usingSecureRandom
for better security in production. However, for e2e testing purposes, the current implementation is acceptable.-# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_generator = ->(request) { SecureRandom.base64(16) }
23-25
: Consider enabling report-only mode during initial testing.For e2e testing setup, it's recommended to initially enable report-only mode to identify any CSP violations without breaking the tests. This helps in fine-tuning the policy based on actual usage.
-# # config.content_security_policy_report_only = true +# config.content_security_policy_report_only = true if Rails.env.test?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
specs_e2e/rails_5_2/public/favicon.ico
is excluded by!**/*.ico
specs_e2e/rails_8/public/icon.png
is excluded by!**/*.png
specs_e2e/rails_8/public/icon.svg
is excluded by!**/*.svg
📒 Files selected for processing (89)
.github/workflows/ruby.yml
(1 hunks)specs_e2e/rails_5_2/Gemfile
(0 hunks)specs_e2e/rails_5_2/app/assets/javascripts/posts.js
(0 hunks)specs_e2e/rails_5_2/app/assets/stylesheets/posts.css
(0 hunks)specs_e2e/rails_5_2/app/assets/stylesheets/scaffold.css
(0 hunks)specs_e2e/rails_5_2/app/controllers/application_controller.rb
(0 hunks)specs_e2e/rails_5_2/app/jobs/application_job.rb
(0 hunks)specs_e2e/rails_5_2/app/views/layouts/application.html.erb
(0 hunks)specs_e2e/rails_5_2/app/views/welcome/index.html.erb
(0 hunks)specs_e2e/rails_5_2/bin/bundle
(0 hunks)specs_e2e/rails_5_2/bin/rails
(0 hunks)specs_e2e/rails_5_2/bin/rake
(0 hunks)specs_e2e/rails_5_2/bin/setup
(0 hunks)specs_e2e/rails_5_2/bin/update
(0 hunks)specs_e2e/rails_5_2/config/application.rb
(0 hunks)specs_e2e/rails_5_2/config/boot.rb
(0 hunks)specs_e2e/rails_5_2/config/credentials.yml.enc
(0 hunks)specs_e2e/rails_5_2/config/database.yml
(0 hunks)specs_e2e/rails_5_2/config/environments/development.rb
(0 hunks)specs_e2e/rails_5_2/config/environments/production.rb
(0 hunks)specs_e2e/rails_5_2/config/environments/test.rb
(0 hunks)specs_e2e/rails_5_2/config/initializers/application_controller_renderer.rb
(0 hunks)specs_e2e/rails_5_2/config/initializers/backtrace_silencers.rb
(0 hunks)specs_e2e/rails_5_2/config/initializers/content_security_policy.rb
(0 hunks)specs_e2e/rails_5_2/config/initializers/cookies_serializer.rb
(0 hunks)specs_e2e/rails_5_2/config/initializers/filter_parameter_logging.rb
(0 hunks)specs_e2e/rails_5_2/config/initializers/mime_types.rb
(0 hunks)specs_e2e/rails_5_2/config/initializers/wrap_parameters.rb
(0 hunks)specs_e2e/rails_5_2/config/locales/en.yml
(0 hunks)specs_e2e/rails_5_2/config/master.key
(0 hunks)specs_e2e/rails_5_2/public/404.html
(0 hunks)specs_e2e/rails_5_2/public/422.html
(0 hunks)specs_e2e/rails_5_2/public/500.html
(0 hunks)specs_e2e/rails_5_2/public/robots.txt
(0 hunks)specs_e2e/rails_8/.gitattributes
(1 hunks)specs_e2e/rails_8/.rubocop.yml
(1 hunks)specs_e2e/rails_8/Gemfile
(1 hunks)specs_e2e/rails_8/Rakefile
(1 hunks)specs_e2e/rails_8/app/assets/stylesheets/application.css
(1 hunks)specs_e2e/rails_8/app/controllers/application_controller.rb
(1 hunks)specs_e2e/rails_8/app/jobs/application_job.rb
(1 hunks)specs_e2e/rails_8/app/models/application_record.rb
(1 hunks)specs_e2e/rails_8/app/views/layouts/application.html.erb
(1 hunks)specs_e2e/rails_8/bin/brakeman
(1 hunks)specs_e2e/rails_8/bin/bundle
(1 hunks)specs_e2e/rails_8/bin/dev
(1 hunks)specs_e2e/rails_8/bin/importmap
(1 hunks)specs_e2e/rails_8/bin/rails
(1 hunks)specs_e2e/rails_8/bin/rake
(1 hunks)specs_e2e/rails_8/bin/setup
(1 hunks)specs_e2e/rails_8/bin/thrust
(1 hunks)specs_e2e/rails_8/config.ru
(1 hunks)specs_e2e/rails_8/config/application.rb
(1 hunks)specs_e2e/rails_8/config/boot.rb
(1 hunks)specs_e2e/rails_8/config/cable.yml
(1 hunks)specs_e2e/rails_8/config/cache.yml
(1 hunks)specs_e2e/rails_8/config/credentials.yml.enc
(1 hunks)specs_e2e/rails_8/config/database.yml
(1 hunks)specs_e2e/rails_8/config/deploy.yml
(1 hunks)specs_e2e/rails_8/config/environment.rb
(1 hunks)specs_e2e/rails_8/config/environments/development.rb
(1 hunks)specs_e2e/rails_8/config/environments/production.rb
(1 hunks)specs_e2e/rails_8/config/environments/test.rb
(1 hunks)specs_e2e/rails_8/config/importmap.rb
(1 hunks)specs_e2e/rails_8/config/initializers/content_security_policy.rb
(1 hunks)specs_e2e/rails_8/config/initializers/filter_parameter_logging.rb
(1 hunks)specs_e2e/rails_8/config/initializers/inflections.rb
(1 hunks)specs_e2e/rails_8/config/locales/en.yml
(1 hunks)specs_e2e/rails_8/config/master.key
(1 hunks)specs_e2e/rails_8/config/puma.rb
(1 hunks)specs_e2e/rails_8/config/queue.yml
(1 hunks)specs_e2e/rails_8/config/recurring.yml
(1 hunks)specs_e2e/rails_8/config/storage.yml
(1 hunks)specs_e2e/rails_8/db/cable_schema.rb
(1 hunks)specs_e2e/rails_8/db/cache_schema.rb
(1 hunks)specs_e2e/rails_8/db/migrate/20180621085832_create_posts.rb
(1 hunks)specs_e2e/rails_8/db/queue_schema.rb
(1 hunks)specs_e2e/rails_8/db/seeds.rb
(1 hunks)specs_e2e/rails_8/package.json
(1 hunks)specs_e2e/rails_8/public/400.html
(1 hunks)specs_e2e/rails_8/public/404.html
(1 hunks)specs_e2e/rails_8/public/406-unsupported-browser.html
(1 hunks)specs_e2e/rails_8/public/422.html
(1 hunks)specs_e2e/rails_8/public/500.html
(1 hunks)specs_e2e/rails_8/public/robots.txt
(1 hunks)specs_e2e/rails_8/test-results/.last-run.json
(1 hunks)specs_e2e/rails_8/test.sh
(1 hunks)specs_e2e/rails_8/test/application_system_test_case.rb
(1 hunks)specs_e2e/rails_8/test/test_helper.rb
(1 hunks)
💤 Files with no reviewable changes (33)
- specs_e2e/rails_5_2/app/controllers/application_controller.rb
- specs_e2e/rails_5_2/config/initializers/mime_types.rb
- specs_e2e/rails_5_2/bin/rake
- specs_e2e/rails_5_2/config/master.key
- specs_e2e/rails_5_2/bin/bundle
- specs_e2e/rails_5_2/config/locales/en.yml
- specs_e2e/rails_5_2/app/views/welcome/index.html.erb
- specs_e2e/rails_5_2/app/assets/stylesheets/posts.css
- specs_e2e/rails_5_2/public/robots.txt
- specs_e2e/rails_5_2/config/initializers/application_controller_renderer.rb
- specs_e2e/rails_5_2/public/404.html
- specs_e2e/rails_5_2/config/initializers/backtrace_silencers.rb
- specs_e2e/rails_5_2/config/initializers/cookies_serializer.rb
- specs_e2e/rails_5_2/config/environments/test.rb
- specs_e2e/rails_5_2/config/database.yml
- specs_e2e/rails_5_2/bin/setup
- specs_e2e/rails_5_2/app/views/layouts/application.html.erb
- specs_e2e/rails_5_2/Gemfile
- specs_e2e/rails_5_2/config/application.rb
- specs_e2e/rails_5_2/app/jobs/application_job.rb
- specs_e2e/rails_5_2/config/credentials.yml.enc
- specs_e2e/rails_5_2/config/initializers/content_security_policy.rb
- specs_e2e/rails_5_2/bin/rails
- specs_e2e/rails_5_2/app/assets/javascripts/posts.js
- specs_e2e/rails_5_2/config/initializers/filter_parameter_logging.rb
- specs_e2e/rails_5_2/public/422.html
- specs_e2e/rails_5_2/config/boot.rb
- specs_e2e/rails_5_2/config/environments/production.rb
- specs_e2e/rails_5_2/public/500.html
- specs_e2e/rails_5_2/config/initializers/wrap_parameters.rb
- specs_e2e/rails_5_2/bin/update
- specs_e2e/rails_5_2/config/environments/development.rb
- specs_e2e/rails_5_2/app/assets/stylesheets/scaffold.css
✅ Files skipped from review due to trivial changes (33)
- specs_e2e/rails_8/Rakefile
- specs_e2e/rails_8/config/environment.rb
- specs_e2e/rails_8/public/robots.txt
- specs_e2e/rails_8/test.sh
- specs_e2e/rails_8/app/jobs/application_job.rb
- specs_e2e/rails_8/config/boot.rb
- specs_e2e/rails_8/test/application_system_test_case.rb
- specs_e2e/rails_8/bin/dev
- specs_e2e/rails_8/.gitattributes
- specs_e2e/rails_8/bin/rails
- specs_e2e/rails_8/config/cache.yml
- specs_e2e/rails_8/bin/rake
- specs_e2e/rails_8/config/initializers/inflections.rb
- specs_e2e/rails_8/bin/importmap
- specs_e2e/rails_8/config/queue.yml
- specs_e2e/rails_8/config/recurring.yml
- specs_e2e/rails_8/package.json
- specs_e2e/rails_8/app/assets/stylesheets/application.css
- specs_e2e/rails_8/config/master.key
- specs_e2e/rails_8/test-results/.last-run.json
- specs_e2e/rails_8/config/puma.rb
- specs_e2e/rails_8/config/importmap.rb
- specs_e2e/rails_8/public/422.html
- specs_e2e/rails_8/db/cache_schema.rb
- specs_e2e/rails_8/public/500.html
- specs_e2e/rails_8/config/locales/en.yml
- specs_e2e/rails_8/config/credentials.yml.enc
- specs_e2e/rails_8/config/environments/test.rb
- specs_e2e/rails_8/public/406-unsupported-browser.html
- specs_e2e/rails_8/.rubocop.yml
- specs_e2e/rails_8/bin/thrust
- specs_e2e/rails_8/db/migrate/20180621085832_create_posts.rb
- specs_e2e/rails_8/db/seeds.rb
🔇 Additional comments (44)
specs_e2e/rails_8/config/deploy.yml (11)
1-3
: Service Name ConfigurationThe application service is defined as
app
. Ensure this value aligns with your overall naming conventions across environments.
4-6
: Container Image ConfigurationThe image is currently set as
your-user/app
, which appears to be a placeholder. Verify that this value is updated based on your actual Docker image repository before deployment.
16-23
: SSL and Proxy ConfigurationThe proxy settings enable SSL with auto-certification and designate
app.example.com
as the host. Ensure that this domain is updated to reflect your production domain. The comments provide clear guidance for edge cases like Cloudflare usage.
24-33
: Registry Credentials ConfigurationThe registry block is structured correctly with a username and password list. Remember to replace placeholder values with secure credentials and avoid checking sensitive data into version control.
34-55
: Environment Variables InjectionThe
env:
block clearly separates secret and clear environment variables. The inclusion ofSOLID_QUEUE_IN_PUMA: true
is explicit, and the commented lines serve as useful documentation for optional configurations. Confirm that these settings match your deployment needs.
56-63
: Alias Commands ConfigurationThe defined aliases for console, shell, logs, and dbc streamline command-line operations. They are clearly specified and should enhance developer productivity when interacting with containers.
64-69
: Persistent Storage Volume SetupThe volumes configuration for persistent storage (
app_storage:/rails/storage
) is concise. Verify that the mounted volume path is appropriately backed up and aligns with your production storage strategy.
70-75
: Asset Path BridgingThe asset path is set to
/rails/public/assets
to bridge fingerprinted assets. Ensure that this path accurately reflects the location of your precompiled assets to prevent 404 errors.
76-89
: Image Builder ConfigurationThe
builder:
block is well-organized and includes clear commentary on remote builds and build arguments. Retaining the commented examples is useful for future reference; just be sure to remove or update them as your build process evolves.
90-93
: SSH User Configuration (Commented Out)The optional SSH configuration is provided as a commented template for running as a non-root user. This is a good security practice—ensure you update and enable it if required by your deployment environment.
94-117
: Accessory Services ConfigurationThe commented out accessory services for MySQL and Redis serve as practical templates for future use. When you decide to integrate these services, make sure to adjust the configuration (host, port, files, etc.) to fit your production or staging environment.
specs_e2e/rails_8/config/initializers/filter_parameter_logging.rb (1)
1-5
: LGTM! Clear and comprehensive documentation.The comments effectively explain the purpose, behavior, and requirements of this configuration file. The reference to ActiveSupport::ParameterFilter documentation is particularly helpful for maintainers.
specs_e2e/rails_8/public/404.html (2)
1-12
: HTML Structure and Meta Tags – ApprovedThe document begins with a correct HTML5 doctype, specifies the language attribute, and includes the essential meta tags (charset, viewport, and robots). This establishes a solid foundation for the 404 error page.
107-109
: Clear and Informative 404 Message – ApprovedThe content within the
<article>
tag presents a clear, user-friendly message that explains the error and suggests possible causes. This is effective for guiding users when they encounter a missing page.specs_e2e/rails_8/config/environments/production.rb (4)
1-14
: LGTM! Core configuration follows Rails production best practices.The configuration correctly disables code reloading, enables eager loading for better performance, and disables local request consideration for security.
36-48
: LGTM! Logging configuration follows 12-factor app principles.The configuration correctly implements:
- STDOUT logging with request ID tracking
- Environment-based log level configuration
- Health check noise reduction
- Deprecation silence in production
56-71
: Update mailer configuration for production use.The mailer configuration needs production-specific updates:
- Replace
example.com
with the actual production domain- Uncomment and configure SMTP settings
- Ensure SMTP credentials are properly set using
rails credentials:edit
49-55
:✅ Verification successful
Verify solid_cache and solid_queue gem dependencies.
The configuration uses Rails 8's new features. Please ensure:
- The required gems are added to the Gemfile
- The queue database configuration exists in database.yml
🌐 Web query:
Are solid_cache_store and solid_queue officially supported in Rails 8?
💡 Result:
Yes, both
solid_cache_store
(Solid Cache) andsolid_queue
(Solid Queue) are officially supported in Rails 8 as default components. Here’s a breakdown:
Solid Cache
- Official status: Enabled by default in new Rails 8 apps[1][3][6].
- Purpose: Replaces Redis for caching by using your SQL database (PostgreSQL/MySQL/SQLite) or dedicated NVMe SSD storage[1][10].
- Key benefits:
- Larger caches (weeks instead of hours)[7]
- Simplified infrastructure (no Redis dependency)[10]
- Automatic configuration via
rails new
[1][6]- Disabling: Use
rails new app_name --skip-solid
[3][6].
Solid Queue
- Official status: Default Active Job backend in Rails 8[6][8].
- Purpose: Manages background jobs via your SQL database instead of Redis/Sidekiq[2][4][7].
- Key benefits:
- Eliminates Redis/Sidekiq dependencies[4][7]
- Supports prioritization, retries, and scheduling[4]
- Configured automatically with
rails new
[6]- Disabling: Same
--skip-solid
flag as Solid Cache[3][6].
Key Evidence
Feature Source Confirmation Default in Rails 8 Enabled unless skipped via --skip-solid
([Rails Guides][3], [Rails Blog][6])Database-backed design Uses SQL instead of Redis ([GitHub docs][1], [Jay's Tech Bites][9]) Production readiness Explicitly recommended for production caching/jobs ([Pawel Urbanek][7], [YT demo][10])
Comparison Table
Solid Cache Solid Queue Replaces Redis/Memcached Sidekiq/Resque Storage SQL database or NVMe SSDs SQL database Rails 8 Default ✔️ ✔️ Infra Simplification No Redis required No Redis required For existing apps, migration guides are available to adopt these tools incrementally[7][9].
Citations:
- 1: https://github.com/rails/solid_cache
- 2: https://www.youtube.com/watch?v=ReyKfb12EVU
- 3: https://guides.rubyonrails.org/caching_with_rails.html
- 4: https://blog.railsforgedev.com/rails-8-solidqueue-solidcache-solidcable
- 5: https://dev.to/hrishio/how-to-use-solid-queue-for-background-jobs-in-rails-3m9l
- 6: https://rubyonrails.org/2024/9/6/this-week-in-rails
- 7: https://pawelurbanek.com/rails-8-features
- 8: rails/rails#50442
- 9: https://jaystechbites.com/posts/2024/rails-8-beta1-no-paas/
- 10: https://www.youtube.com/watch?v=mA6somzKYEg
Solid Cache & Solid Queue Configuration Verified
The web query confirms that both
solid_cache_store
andsolid_queue
are officially supported in Rails 8. The configuration inspecs_e2e/rails_8/config/environments/production.rb
(lines 49-55) correctly utilizes Rails 8’s default components.Please ensure:
- The necessary gem dependencies are added in the Gemfile (or are automatically provided by Rails when not skipped).
- The queue database configuration referenced in
config.solid_queue.connects_to
exists and matches the appropriate settings indatabase.yml
.If these conditions are met, no further changes are required.
specs_e2e/rails_8/public/400.html (4)
1-3
: HTML Structure & Doctype Declaration
The file begins with a proper HTML5 doctype declaration and sets the language attribute appropriately, ensuring a modern and accessible document structure.
5-12
: Head Metadata & Title Setup
The<head>
section includes essential meta tags (charset, viewport, robots) and a descriptive title. Although the title is verbose, it effectively communicates the error context.
13-84
: Inline CSS Styling Overview
The inline CSS is comprehensive, employing modern layout techniques like CSS Grid, responsive typography viaclamp()
, and proper resets (e.g., universal box-sizing). The styling is well-organized and enhances the user experience.
99-114
: Well-Structured HTML Body
The<body>
section is neatly organized with a<main>
container that includes both a<header>
(with an inline SVG) and an<article>
for the error message. This clear structure supports both usability and readability.specs_e2e/rails_8/db/queue_schema.rb (2)
1-1
: Confirm ActiveRecord schema version alignment with Rails 8.
This file referencesActiveRecord::Schema[7.1]
, which may conflict with the stated objective of incorporating “Rails 8” changes.Would you like to confirm that this version is indeed correct for your Rails 8 environment?
112-121
: Evaluate concurrency/semaphore usage.
Thesolid_queue_semaphores
table uses a simplevalue
integer and expiration strategy. Before shipping, verify your concurrency approach and consider whether an additional index onkey
plus concurrency logic is needed to handle high-throughput scenarios.specs_e2e/rails_8/app/models/application_record.rb (1)
2-2
: Use ofprimary_abstract_class
is aligned with modern Rails.
This approach is recommended in Rails 7.x+ and helps keep the base model class separate from direct instantiation.specs_e2e/rails_8/config.ru (1)
3-6
: LGTM! Follows Rails 8 best practices.The configuration properly initializes the Rails 8 application with the required
load_server
call.specs_e2e/rails_8/app/controllers/application_controller.rb (1)
2-3
:❓ Verification inconclusive
Verify browser compatibility requirements.
The
allow_browser versions: :modern
directive restricts access to only modern browsers. While this ensures better feature support, please verify if this restriction is intentional for e2e specs, as it might affect test coverage for older browsers.
🌐 Web query:
What browsers are considered "modern" by Rails 8's allow_browser versions: :modern directive?
💡 Result:
Rails 8 defines "modern" browsers through its
allow_browser
directive as those supporting key web features like webp images, web push, badges, import maps, CSS nesting, and CSS:has
. The specific browser versions considered modern are:
- Safari: 17.2+
- Chrome: 120+
- Firefox: 121+
- Opera: 106+
This configuration blocks older browsers by default while allowing newer versions and agents without user-agent headers[1][4][10]. Developers can customize these thresholds further using hash syntax (e.g.,
allow_browser versions: { safari: 16.4 }
) or override defaults in specific controllers[1][7]. Unsupported browsers receive a406 Not Acceptable
response withpublic/406-unsupported-browser.html
[1][7].Citations:
- 1: https://guides.rubyonrails.org/action_controller_advanced_topics.html
- 2: https://www.gitclear.com/open_repos/rails/rails/release/v8.0.0
- 3: https://github.com/ARDivekar/TypeScript-on-the-Browser-Starter/blob/master/README.md
- 4: https://blog.saeloun.com/2024/03/18/rails-7-2-adds-allow-browser-to-set-minimum-versions/
- 5: https://gist.github.com/peterc/214aab5c6d783563acbc2a9425e5e866?permalink_comment_id=5443827
- 6: https://dev.to/pluralsight/how-blazor-is-going-to-change-web-development-14n4?comments_sort=top
- 7: https://guides.rubyonrails.org/7_2_release_notes.html
- 8: https://api.rubyonrails.org/v8.0.1/classes/ActionController/AllowBrowser/ClassMethods.html
- 9: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162359
- 10: https://www.mintbit.com/blog/efficiently-setting-minimum-browser-versions-with-allow-browser-in-rails/
Confirm browser support scope.
The
allow_browser versions: :modern
directive restricts access to browsers that support key modern web features (webp images, web push, badges, import maps, CSS nesting, and CSS:has
). In Rails 8, this means that only Safari (17.2+), Chrome (120+), Firefox (121+), and Opera (106+) are allowed. Please verify that this configuration is intentional for our e2e specs. If broader browser coverage (including legacy browsers) is needed for testing, consider adjusting these restrictions.specs_e2e/rails_8/test/test_helper.rb (1)
7-9
: LGTM! Efficient test parallelization setup.The parallel test configuration using
number_of_processors
is optimal for maximizing test execution speed.specs_e2e/rails_8/db/cable_schema.rb (1)
7-9
: LGTM! Good index coverage.The indexes on
channel
,channel_hash
, andcreated_at
are well-chosen for optimizing common query patterns.specs_e2e/rails_8/app/views/layouts/application.html.erb (1)
13-14
: Consider enabling PWA support for e2e testing.The PWA manifest is commented out. Since this is for e2e testing, enabling PWA features could help test offline functionality.
Please verify if PWA testing is part of the e2e test requirements. If so, we can help implement the manifest configuration.
specs_e2e/rails_8/config/application.rb (1)
12-12
: LGTM! Rails 8 defaults are properly configured.The application is correctly configured to use Rails 8.0 defaults.
specs_e2e/rails_8/Gemfile (1)
4-4
: LGTM! Rails 8 version is correctly specified.The
~> 8.0.1
constraint ensures compatibility with Rails 8 while allowing patch updates.specs_e2e/rails_8/config/database.yml (2)
26-41
: LGTM! Well-structured multiple database configuration.The production setup with separate databases for primary, cache, queue, and cable operations follows best practices:
- Each database has its own migration path
- Consistent naming convention
- Proper inheritance from default configuration
14-14
:✅ Verification successful
Verify storage directory existence.
Ensure the
storage/
directory exists and has proper permissions for database files.Also applies to: 21-21
🏁 Script executed:
#!/bin/bash # Check if storage directory exists and create it if needed if [ ! -d "specs_e2e/rails_8/storage" ]; then echo "Storage directory missing" exit 1 fi # Check directory permissions ls -ld specs_e2e/rails_8/storageLength of output: 151
Storage directory configuration verified
The
specs_e2e/rails_8/storage
directory exists and has the appropriate permissions (drwxr-xr-x), confirming that the database file atstorage/development.sqlite3
is correctly supported. Both the configuration at line 14 and its counterpart at line 21 inspecs_e2e/rails_8/config/database.yml
are properly aligned with this setup. Please ensure that any production database configuration that relies on this storage path is similarly verified.specs_e2e/rails_8/config/cable.yml (1)
11-17
:✅ Verification successful
Verify solid_cable adapter compatibility.
The production configuration uses
solid_cable
adapter with specific settings. Please verify:
- The adapter's compatibility with Rails 8
- The appropriateness of the polling interval and message retention periods
🌐 Web query:
Is solid_cable adapter compatible with Rails 8?
💡 Result:
Yes, the
solid_cable
adapter is fully compatible with Rails 8 and serves as its default Action Cable adapter for production environments[1][3][4]. This integration eliminates Redis as a mandatory dependency for real-time WebSocket communication by leveraging your existing SQL database (PostgreSQL, MySQL, or SQLite)[2][4][7].Key Details:
- Default Configuration:
Rails 8 configuressolid_cable
as the standard adapter inconfig/cable.yml
, replacing Redis-based setups[3][7].- Database Backend:
Messages are stored in a database table (solid_cable_messages
) and polled at sub-second intervals (default:0.1.seconds
), achieving performance comparable to Redis for most use cases[3][4][5].- Hotwire Integration:
Works seamlessly with Turbo and Stimulus for real-time UI updates without custom JavaScript[2][5].Example Configuration:
# config/cable.yml production: adapter: solid_cable connects_to: database: writing: cable polling_interval: 0.1.secondsFor new Rails 8 apps, no additional setup is required. Existing apps can migrate by updating their
cable.yml
and runningbin/rails solid_cable:install
to create the necessary database tables[2][7]. While Redis remains optional for advanced scaling needs,solid_cable
simplifies deployments by reducing infrastructure dependencies[1][4][9].Citations:
- 1: https://www.honeybadger.io/blog/rails-8/
- 2: https://blog.railsforgedev.com/rails-8-solidqueue-solidcache-solidcable
- 3: https://hotwireweekly.com/archive/week-37-solid-cable-in-rails-8-morphable-web-components/
- 4: https://blog.appsignal.com/2024/10/07/whats-new-in-ruby-on-rails-8.html
- 5: https://www.youtube.com/watch?v=bOlrHbhLzZE
- 6: https://mileswoodroffe.com/articles/solid-cable-in-production
- 7: https://mileswoodroffe.com/articles/super-solid-cable
- 8: newrelic/newrelic-ruby-agent#2886
- 9: https://reinteractive.com/articles/rails-8-solid-trifecta-comparison-cache-cable-queue
- 10: https://railsnotes.xyz/blog/rails-8-whats-coming
Solid Cable Adapter Configuration Verified
The production configuration using the
solid_cable
adapter is fully compatible with Rails 8, as confirmed by recent documentation. The polling interval of0.1.seconds
matches the established default for Rails 8 setups. Additionally, while themessage_retention: 1.day
parameter isn’t part of the default configuration example, it appears acceptable provided it aligns with your production messaging requirements.
Production Configuration:
solid_cable
is confirmed as the default and compatible adapter for Rails 8.- The polling interval is set correctly for optimal performance.
- The custom
message_retention
setting should be double-checked to ensure it meets your specific needs.Development/Test Setup:
- Ensure that your development/test configurations remain consistent, especially if using alternative adapters or if different messaging retention logic is required.
specs_e2e/rails_8/bin/bundle (2)
13-103
: LGTM! Well-structured Bundler initialization.The module provides robust version detection and error handling for Bundler activation.
1-1
:✅ Verification successful
Verify script permissions.
Ensure the bundle script is executable.
🏁 Script executed:
#!/bin/bash # Check if the script is executable if [ ! -x "specs_e2e/rails_8/bin/bundle" ]; then echo "Bundle script is not executable" exit 1 fiLength of output: 45
Bundle Script Permissions Verified
The
specs_e2e/rails_8/bin/bundle
file is correctly marked as executable. The permissions check executed without errors, confirming that no changes are necessary.specs_e2e/rails_8/config/storage.yml (6)
1-4
: Review: Test Storage ConfigurationThe
test
service is configured correctly using the Disk service with its root set totmp/storage
viaRails.root.join
. This is a common and effective setup for an isolated test environment.
5-8
: Review: Local Storage ConfigurationThe
local
configuration correctly uses the Disk service pointed at a dedicated storage directory. This clear separation of environments is appropriate for local development.
9-16
: Review: AWS S3 Configuration (Commented)The commented-out AWS S3 configuration provides useful instructions (via
bin/rails credentials:edit
) and serves as a template. Be sure to secure all sensitive data in Rails credentials when activated.
17-23
: Review: Google Cloud Storage Configuration (Commented)The configuration template for Google Cloud Storage is well-documented, and the reminder not to check in your GCS keyfile is an excellent security measure.
24-30
: Review: Azure Storage Configuration (Commented)The Azure Storage commented section is consistent with the AWS and GCS sections. It includes clear instructions for setting secrets via credentials.
31-34
: Review: Mirror Service Configuration (Commented)The mirror configuration template, though commented, provides a useful blueprint for future needs. Make sure that, if enabled, the service names and mirror array are validated against actual storage service configurations.
specs_e2e/rails_8/config/initializers/content_security_policy.rb (1)
1-6
: LGTM! Documentation is clear and helpful.The file includes proper documentation and links to the Rails security guide, which is essential for maintainers to understand and modify the CSP configuration.
Summary by CodeRabbit
New Features
Cleanup & Upgrades