Skip to content

Conversation

justin808
Copy link
Member

@justin808 justin808 commented Sep 28, 2025

Summary

Adds automated release rake tasks to streamline the release process, eliminating the need for manual version bump PRs.

Rake Tasks Added

rake release:prepare[VERSION]

Prepares a new release by:

  • Validating version format (semantic versioning)
  • Updating lib/cypress_on_rails/version.rb
  • Updating CHANGELOG.md with date and compare link
  • Prompting for confirmation

rake release:publish

Publishes the release by:

  • Verifying on master branch with clean working directory
  • Running the test suite
  • Creating and pushing git tag
  • Building the gem
  • Publishing to RubyGems

rake release:full[VERSION]

Combines both prepare and publish for one-command releases.

Documentation

Added RELEASING.md with:

  • Complete step-by-step release process
  • Version numbering guidelines
  • Pre-release checklist
  • Troubleshooting guide
  • Rollback procedures
  • Example release flow

Usage Example

# Prepare release (updates files)
rake release:prepare[1.19.0]

# Review and commit changes
git diff
git add -A
git commit -m "Bump version to 1.19.0"
git push origin master

# Publish to RubyGems
rake release:publish

Benefits

  • No manual PRs needed for version bumps
  • Consistent process every release
  • Prevents errors with validation and checks
  • Clear workflow with guided next steps
  • Automated CHANGELOG updates

Changes From Original PR

This PR now focuses on infrastructure rather than a one-time version bump:

  • Removed manual version changes
  • Added reusable rake tasks
  • Added comprehensive documentation

The actual v1.19.0 release will be performed by running:

rake release:prepare[1.19.0]

After this PR is merged.

Next Steps After Merge

  1. Merge this PR to add the release tooling
  2. Run rake release:prepare[1.19.0] on master
  3. Commit and push the version bump
  4. Run rake release:publish to release v1.19.0

🤖 Generated with Claude Code

Copy link

coderabbitai bot commented Sep 28, 2025

Warning

Rate limit exceeded

@justin808 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 42 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 41be34e and a31853c.

📒 Files selected for processing (3)
  • RELEASING.md (1 hunks)
  • Rakefile (1 hunks)
  • cypress-on-rails.gemspec (1 hunks)

Walkthrough

Introduces v1.19.0 with new test-runner Rake tasks, a server orchestration class, state-reset middleware, configuration hooks and settings, Railtie task loading, and extensive documentation (README, CHANGELOG, release notes/checklist, guides). Also bumps the version and updates the generator initializer template with commented configuration options.

Changes

Cohort / File(s) Summary
Version bump
lib/cypress_on_rails/version.rb
Update version constant to 1.19.0.
Configuration & initializer template
lib/cypress_on_rails/configuration.rb, lib/generators/cypress_on_rails/templates/config/initializers/cypress_on_rails.rb.erb
Add server lifecycle hooks and server settings (host, port, transactional mode). Provide commented examples in the initializer template.
Railtie & middleware
lib/cypress_on_rails/railtie.rb, lib/cypress_on_rails/state_reset_middleware.rb
Load Rake tasks via Railtie; add and mount a StateResetMiddleware handling reset endpoints and invoking optional hooks and cleaning logic.
Server orchestration & tasks
lib/cypress_on_rails/server.rb, lib/tasks/cypress.rake
Add a server manager to start Rails, run Cypress/Playwright (open/run/init), manage env and transactions, and cleanly shut down. Introduce Rake tasks for Cypress and Playwright that use this server.
Documentation — Core
README.md, CHANGELOG.md
Expand README with quick starts, lifecycle hooks, server management, and task-driven workflows. Add Unreleased + 1.19.0 entry with additions and migration guidance.
Documentation — Release
RELEASE_NOTES_1.19.0.md, RELEASE_CHECKLIST.md
Add detailed 1.19.0 release notes and a release checklist (pre-release, testing, release, post-release, rollback).
Documentation — Guides
docs/BEST_PRACTICES.md, docs/DX_IMPROVEMENTS.md, docs/PLAYWRIGHT_GUIDE.md, docs/TROUBLESHOOTING.md, docs/VCR_GUIDE.md
Add comprehensive guides: best practices, DX improvements, Playwright integration, troubleshooting, and VCR usage. No code changes.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev as Developer
    participant Rake as Rake Task (cypress:run/open/init / playwright:run/open)
    participant Srv as CypressOnRails::Server
    participant Rails as Rails Server
    participant Runner as Test Runner (Cypress/Playwright)
    participant MW as StateResetMiddleware

    Dev->>Rake: Invoke task
    Rake->>Srv: new(...).run/open/init
    rect rgba(230,245,255,0.6)
      note right of Srv: Server lifecycle (new in 1.19)
      Srv->>Srv: Apply config (host/port/transactional)
      Srv->>Rails: Spawn server (hooks: before/after start)
      Srv-->>Rails: Wait until ready
    end
    alt transactional_server enabled
      Srv->>Rails: Begin transaction (hook: after_transaction_start)
    end
    Srv->>Runner: Execute command with baseUrl
    Runner->>MW: Optional call /__cypress__/reset_state
    MW->>MW: Reset DB/cache/deps (hook: after_state_reset)
    Runner-->>Srv: Exit status
    rect rgba(230,245,255,0.6)
      Srv->>Rails: Shutdown (hook: before_server_stop)
    end
    Srv-->>Rake: Result
    Rake-->>Dev: Task completes
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • VCR use_cassette middleware #167 — Also modifies configuration and Railtie to add/configure middleware (VCR) and options; closely related to this PR’s new hooks and middleware integration.

Suggested reviewers

  • grantspeelman

Poem

I thump my paws—new tasks to run!
A server hums, the tests begun.
Hooks that hop before and after,
Reset fields trim our test-world’s chatter.
With Cypress, Playwright side by side,
I nibble docs with fluffy pride.
Hippity-ci! The bugs collide. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.17% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ⚠️ Warning The title “Add automated release rake tasks” misrepresents the pull request’s primary purpose, which is to prepare for the v1.19.0 release by bumping the version, updating the changelog, and adding release notes and a release checklist; while the PR does introduce new rake tasks, those tasks are focused on test execution (Cypress and Playwright) rather than automating the release process. Please update the title to clearly reflect the main changes, for example: “Prepare v1.19.0 release with version bump, changelog, release notes, and checklist.”
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

claude bot commented Sep 28, 2025

Code Review for PR #182: Prepare for v1.19.0 release

Thank you for this comprehensive release preparation! I've reviewed the changes and here's my feedback:

Strengths

  1. Excellent Documentation: The addition of 2000+ lines of documentation (TROUBLESHOOTING.md, PLAYWRIGHT_GUIDE.md, VCR_GUIDE.md, etc.) directly addresses user pain points from multiple issues. This is a fantastic improvement for developer experience.

  2. Feature Completeness: The new rake tasks (cypress:open, cypress:run, playwright:open, playwright:run) with automatic server management significantly improves the testing workflow and achieves cypress-rails parity.

  3. Well-Structured Release Process: The RELEASE_CHECKLIST.md and RELEASE_NOTES_1.19.0.md demonstrate professional release management.

🔍 Code Quality Observations

1. Error Handling in Server Management (lib/cypress_on_rails/server.rb)

The new Server class should have more robust error handling:

  • Consider adding timeout handling for server startup
  • Add cleanup in case of unexpected failures
  • Consider what happens if the port is already in use

2. Configuration Validation (lib/cypress_on_rails/configuration.rb)

The new configuration options should validate input:

  • Port numbers should be validated (1-65535)
  • Callbacks should verify they're callable
  • Consider adding type checking for configuration values

3. State Reset Middleware (lib/cypress_on_rails/state_reset_middleware.rb)

Security consideration: Ensure this endpoint is properly protected and only accessible in test environment.

🐛 Potential Issues

  1. Race Conditions: In the server lifecycle hooks, there might be race conditions between after_server_start and when the server is actually ready to accept connections. Consider adding a health check mechanism.

  2. Transaction Handling: The transactional_server mode needs careful consideration for tests that spawn background jobs or use multiple database connections.

  3. Memory Leaks: With the new state reset mechanism, ensure that all caches and in-memory data structures are properly cleared to avoid memory growth during long test runs.

🚀 Performance Considerations

  1. Port Selection: The dynamic port selection in Server class could benefit from a more robust algorithm to avoid conflicts in CI environments with parallel jobs.

  2. Documentation Loading: With the extensive new documentation, consider if these should be excluded from the gem build to reduce package size.

🔒 Security Concerns

  1. Test Endpoint Exposure: The /cypress_rails_reset_state endpoint must be absolutely certain it's disabled in production. Consider adding multiple safeguards.

  2. Callback Execution: The configuration callbacks (before_server_start, etc.) execute arbitrary code. Consider documenting security implications.

📋 Test Coverage

The PR would benefit from:

  • Unit tests for the new Server class
  • Integration tests for the rake tasks
  • Tests for the state reset middleware
  • Tests for configuration validation

💡 Suggestions

  1. Add deprecation warnings for any older patterns that users should migrate away from.

  2. Consider adding a --dry-run option to the rake tasks for debugging server startup issues.

  3. Add logging configuration to help users debug issues with the automatic server management.

  4. Version compatibility matrix in the README showing which Rails versions are tested.

Minor Improvements

  1. In CHANGELOG.md, the comparison link format [Compare]: should be [1.19.0]: for consistency.

  2. Consider adding a timeout to the server startup wait loop to prevent infinite waiting.

  3. The RELEASE_CHECKLIST.md could benefit from automated checks via a GitHub Action.


Overall Assessment: This is a solid release that significantly improves the developer experience. The cypress-rails compatibility and comprehensive documentation address real user needs. The main areas for improvement are around error handling, validation, and test coverage for the new features.

Great work on making the gem more accessible and user-friendly! 🎉

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/TROUBLESHOOTING.md (1)

386-409: Correct the Cypress helper name for VCR cassette recording

The surrounding snippets define the helper as Cypress.Commands.add('vcrInsert', ...), so the usage here should be cy.vcrInsert(...)/cy.vcrEject(...). Calling cy.vcr_insert_cassette will throw “is not a function” at runtime, so the troubleshooting guidance currently sends users down a broken path. Please fix this section (and the similar examples lower in the file) to match the actual command names.

-```js
-cy.vcr_insert_cassette('my_cassette', { record: 'new_episodes' });
-```
+```js
+cy.vcrInsert('my_cassette', { record: 'new_episodes' });
+```
🧹 Nitpick comments (3)
RELEASE_NOTES_1.19.0.md (1)

98-98: Wrap bare URL to keep markdownlint happy

markdownlint flags the bare GitHub URL (MD034). Converting it to a markdown link resolves the lint failure.

-Please report issues at: https://github.com/shakacode/cypress-playwright-on-rails/issues
+Please report issues at: [github.com/shakacode/cypress-playwright-on-rails/issues](https://github.com/shakacode/cypress-playwright-on-rails/issues)

Based on static analysis hints.

RELEASE_CHECKLIST.md (1)

40-40: Format the bare URL to avoid markdownlint errors

Same MD034 warning here—wrapping the release page URL fixes the lint complaint.

-- [ ] Go to https://github.com/shakacode/cypress-playwright-on-rails/releases/new
+- [ ] Go to [github.com/shakacode/cypress-playwright-on-rails/releases/new](https://github.com/shakacode/cypress-playwright-on-rails/releases/new)

Based on static analysis hints.

docs/PLAYWRIGHT_GUIDE.md (1)

48-63: Add a fenced code language specifier.

Line 48 opens a fenced block without a language tag, tripping markdownlint (MD040) and hurting consistency with the rest of the guide. Please annotate it (e.g., ```text) so tooling stays quiet and formatting is predictable.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d50de89 and 41be34e.

📒 Files selected for processing (16)
  • CHANGELOG.md (1 hunks)
  • README.md (4 hunks)
  • RELEASE_CHECKLIST.md (1 hunks)
  • RELEASE_NOTES_1.19.0.md (1 hunks)
  • docs/BEST_PRACTICES.md (1 hunks)
  • docs/DX_IMPROVEMENTS.md (1 hunks)
  • docs/PLAYWRIGHT_GUIDE.md (1 hunks)
  • docs/TROUBLESHOOTING.md (1 hunks)
  • docs/VCR_GUIDE.md (1 hunks)
  • lib/cypress_on_rails/configuration.rb (2 hunks)
  • lib/cypress_on_rails/railtie.rb (1 hunks)
  • lib/cypress_on_rails/server.rb (1 hunks)
  • lib/cypress_on_rails/state_reset_middleware.rb (1 hunks)
  • lib/cypress_on_rails/version.rb (1 hunks)
  • lib/generators/cypress_on_rails/templates/config/initializers/cypress_on_rails.rb.erb (1 hunks)
  • lib/tasks/cypress.rake (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
lib/cypress_on_rails/server.rb (2)
lib/cypress_on_rails/configuration.rb (2)
  • initialize (36-38)
  • configuration (76-78)
lib/cypress_on_rails/state_reset_middleware.rb (4)
  • initialize (2-44)
  • initialize (3-5)
  • run_hook (41-43)
  • call (7-14)
lib/cypress_on_rails/state_reset_middleware.rb (2)
lib/cypress_on_rails/configuration.rb (1)
  • configuration (76-78)
lib/cypress_on_rails/server.rb (1)
  • run_hook (190-194)
🪛 markdownlint-cli2 (0.18.1)
RELEASE_CHECKLIST.md

40-40: Bare URL used

(MD034, no-bare-urls)

RELEASE_NOTES_1.19.0.md

98-98: Bare URL used

(MD034, no-bare-urls)

docs/BEST_PRACTICES.md

18-18: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

docs/TROUBLESHOOTING.md

18-18: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


18-18: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


20-20: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


20-20: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


83-83: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


83-83: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


83-83: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


103-103: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


103-103: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


103-103: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


129-129: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


129-129: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


131-131: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


131-131: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


131-131: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


142-142: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


142-142: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


142-142: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


168-168: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


168-168: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


170-170: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


170-170: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


256-256: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


256-256: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


256-256: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


266-266: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


266-266: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


266-266: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


275-275: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


275-275: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


275-275: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


292-292: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


292-292: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


294-294: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


294-294: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)

docs/PLAYWRIGHT_GUIDE.md

48-48: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

CHANGELOG.md

13-13: Link and image reference definitions should be needed
Unused link or image reference definition: "compare"

(MD053, link-image-reference-definitions)

docs/DX_IMPROVEMENTS.md

79-79: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

docs/VCR_GUIDE.md

197-197: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


371-371: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


371-371: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


384-384: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


384-384: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


386-386: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


386-386: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


413-413: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


413-413: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


428-428: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


428-428: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


430-430: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


430-430: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


453-453: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


453-453: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


463-463: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


463-463: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


477-477: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


477-477: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


478-478: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


478-478: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


479-479: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


479-479: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


480-480: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


480-480: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


481-481: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


481-481: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


482-482: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


482-482: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


486-486: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


486-486: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


487-487: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


487-487: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


492-492: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


492-492: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


493-493: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)


493-493: Strong style
Expected: underscore; Actual: asterisk

(MD050, strong-style)

🪛 Brakeman (7.0.2)
lib/cypress_on_rails/server.rb

[medium] 187-187: Possible command injection
Type: Command Injection
Confidence: Medium
More info: https://brakemanscanner.org/docs/warning_types/command_injection/

(Command Injection)


[medium] 107-107: Possible command injection
Type: Command Injection
Confidence: Medium
More info: https://brakemanscanner.org/docs/warning_types/command_injection/

(Command Injection)

lib/cypress_on_rails/state_reset_middleware.rb

[medium] 30-30: Possible SQL injection
Type: SQL Injection
Confidence: Medium
More info: https://brakemanscanner.org/docs/warning_types/sql_injection/

(SQL Injection)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: rails_8
  • GitHub Check: rails_6_1
  • GitHub Check: rails_7_2
  • GitHub Check: claude-review
🔇 Additional comments (1)
CHANGELOG.md (1)

12-13: Verify the release date before tagging

The entry is dated 2025-09-27, but we’re preparing the release on 2025-09-28. Please double-check the actual tag date before merge so the changelog reflects the true release timeline.

Comment on lines 130 to 171
afterEach(() => {
cy.vcr_eject_cassette();
});

it('fetches weather data', () => {
// Start recording
cy.vcr_insert_cassette('weather_api', {
record: 'new_episodes'
});

cy.visit('/weather');
cy.contains('Current Temperature');

// Recording continues until ejected
});

it('handles API errors', () => {
// Use pre-recorded cassette
cy.vcr_insert_cassette('weather_api_error', {
record: 'none' // Only replay, don't record
});

cy.visit('/weather?city=invalid');
cy.contains('City not found');
});
});
```

### Advanced Options
```js
cy.vcr_insert_cassette('api_calls', {
record: 'new_episodes', // Recording mode
match_requests_on: ['method', 'uri', 'body'], // Request matching
erb: true, // Enable ERB in cassettes
allow_playback_repeats: true, // Allow multiple replays
exclusive: true, // Disallow other cassettes
serialize_with: 'json', // Use JSON format
preserve_exact_body_bytes: true, // For binary data
decode_compressed_response: true // Handle gzipped responses
});
```

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Align VCR usage examples with the defined Cypress commands

Earlier in this guide you add vcrInsert/vcrEject commands, but the examples here (and later in the file) switch to cy.vcr_insert_cassette / cy.vcr_eject_cassette, which aren’t defined and will break consumer suites. Please update all occurrences to the camelCase helpers that the guide tells readers to register.

-  afterEach(() => {
-    cy.vcr_eject_cassette();
+  afterEach(() => {
+    cy.vcrEject();
   });

   it('fetches weather data', () => {
     // Start recording
-    cy.vcr_insert_cassette('weather_api', { 
+    cy.vcrInsert('weather_api', { 
       record: 'new_episodes' 
     });
@@
-    cy.vcr_insert_cassette('weather_api_error', { 
+    cy.vcrInsert('weather_api_error', { 
       record: 'none'  // Only replay, don't record
     });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
afterEach(() => {
cy.vcr_eject_cassette();
});
it('fetches weather data', () => {
// Start recording
cy.vcr_insert_cassette('weather_api', {
record: 'new_episodes'
});
cy.visit('/weather');
cy.contains('Current Temperature');
// Recording continues until ejected
});
it('handles API errors', () => {
// Use pre-recorded cassette
cy.vcr_insert_cassette('weather_api_error', {
record: 'none' // Only replay, don't record
});
cy.visit('/weather?city=invalid');
cy.contains('City not found');
});
});
```
### Advanced Options
```js
cy.vcr_insert_cassette('api_calls', {
record: 'new_episodes', // Recording mode
match_requests_on: ['method', 'uri', 'body'], // Request matching
erb: true, // Enable ERB in cassettes
allow_playback_repeats: true, // Allow multiple replays
exclusive: true, // Disallow other cassettes
serialize_with: 'json', // Use JSON format
preserve_exact_body_bytes: true, // For binary data
decode_compressed_response: true // Handle gzipped responses
});
```
afterEach(() => {
cy.vcrEject();
});
it('fetches weather data', () => {
// Start recording
cy.vcrInsert('weather_api', {
record: 'new_episodes'
});
cy.visit('/weather');
cy.contains('Current Temperature');
// Recording continues until ejected
});
it('handles API errors', () => {
// Use pre-recorded cassette
cy.vcrInsert('weather_api_error', {
record: 'none' // Only replay, don't record
});
cy.visit('/weather?city=invalid');
cy.contains('City not found');
});
});
🤖 Prompt for AI Agents
In docs/VCR_GUIDE.md around lines 130 to 171, the examples use undefined
commands cy.vcr_insert_cassette and cy.vcr_eject_cassette; change those to the
previously defined camelCase helpers cy.vcrInsert and cy.vcrEject (update both
the test examples and the Advanced Options block occurrences) so all examples
match the registered Cypress commands and won’t break consumer suites.

Comment on lines 77 to 91
if @transactional && defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.begin_transaction(joinable: false)
run_hook(config.after_transaction_start)
end

yield

ensure
run_hook(config.before_server_stop)

if @transactional && defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.rollback_transaction if ActiveRecord::Base.connection.transaction_open?
end

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Remove the ineffective transactional wrapper.

Lines 78-89 attempt to wrap the run in a database transaction, but the Rails server is spawned in a separate process with its own connections. Any writes from the UI runner bypass this transaction, so the rollback never reverts test data, giving a false sense of isolation. Please drop the begin/rollback (and associated hook) until there’s a cross-process strategy—otherwise we quietly leave the database dirty.

-        if @transactional && defined?(ActiveRecord::Base)
-          ActiveRecord::Base.connection.begin_transaction(joinable: false)
-          run_hook(config.after_transaction_start)
-        end
-        
         yield
         
       ensure
-        run_hook(config.before_server_stop)
-        
-        if @transactional && defined?(ActiveRecord::Base)
-          ActiveRecord::Base.connection.rollback_transaction if ActiveRecord::Base.connection.transaction_open?
-        end
+        run_hook(config.before_server_stop)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if @transactional && defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.begin_transaction(joinable: false)
run_hook(config.after_transaction_start)
end
yield
ensure
run_hook(config.before_server_stop)
if @transactional && defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.rollback_transaction if ActiveRecord::Base.connection.transaction_open?
end
yield
ensure
run_hook(config.before_server_stop)
🤖 Prompt for AI Agents
In lib/cypress_on_rails/server.rb around lines 77 to 90, remove the ineffective
cross-process transactional wrapper: delete the conditional block that calls
ActiveRecord::Base.connection.begin_transaction and the
run_hook(config.after_transaction_start) call before yield, and delete the
corresponding ensure-time rollback logic that checks transaction_open? and calls
rollback_transaction; keep the run_hook(config.before_server_stop) and the yield
intact. This removes the misleading @transactional begin/rollback behavior until
a proper cross-process strategy is implemented.

Comment on lines 54 to 55
gem 'cypress-on-rails', '~> 1.0'

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Update the Gemfile version constraint for the new release.

Line 55 still instructs users to install cypress-on-rails with ~> 1.0, which predates the rake tasks and lifecycle hooks we’re highlighting in this README. Following these updated instructions with the old constraint will pull in 1.0.x and the described features will be missing. Let’s bump the example to ~> 1.19 (or ~> 1.19.0) so Quick Start reflects the release we’re preparing.

- gem 'cypress-on-rails', '~> 1.0'
+ gem 'cypress-on-rails', '~> 1.19'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
gem 'cypress-on-rails', '~> 1.0'
gem 'cypress-on-rails', '~> 1.19'
🤖 Prompt for AI Agents
In README.md around lines 54 to 55, the Gemfile example pins cypress-on-rails to
"~> 1.0" which will pull an older release missing the rake tasks and lifecycle
hooks described; update the example line to use "~> 1.19" (or "~> 1.19.0") so
the Quick Start reflects the new release and its features.

@justin808 justin808 force-pushed the prepare-v1.19.0-release branch 2 times, most recently from e14fa03 to ac7d59a Compare September 30, 2025 10:01
@justin808 justin808 changed the title Prepare for v1.19.0 release Add automated release rake tasks Sep 30, 2025
Implements rake tasks for automating the release process, similar to Shakapacker.

New rake tasks:
- rake release:prepare[VERSION] - Bumps version and updates CHANGELOG
- rake release:publish - Tags, builds, and publishes gem to RubyGems
- rake release:full[VERSION] - Complete release in one command

Features:
- Validates semantic versioning format
- Confirms before making changes
- Updates version.rb automatically
- Updates CHANGELOG.md with date and compare link
- Runs test suite before publishing
- Creates and pushes git tags
- Builds and publishes to RubyGems
- Provides clear next steps after each phase

Documentation:
- RELEASING.md with complete release process guide
- Troubleshooting section for common issues
- Examples and pre-release checklist

This eliminates the need for a manual PR to bump versions.
Instead, maintainers can run: rake release:prepare[1.19.0]

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@justin808 justin808 force-pushed the prepare-v1.19.0-release branch from ac7d59a to a31853c Compare September 30, 2025 10:04
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.

1 participant