Overhaul CI/CD, specs, and release pipeline#3
Merged
Conversation
This prevents CI runners from inheriting external/home RuboCop configs (like missing rubocop-discourse) and failing unrelated PR checks. Co-authored-by: Cursor <cursoragent@cursor.com>
Aligns modal_stack's infrastructure with the swal_rails sibling gem so the two share the same Ruby/Rails support matrix and release workflow. Highlights: - Multi-Rails CI: matrix Ruby 3.2-4.0 x Rails 7.2/8.0/8.1/8.1+sprockets via Appraisals. Adds dedicated lint job and ci-success aggregator for branch protection. - modal_stack-specific CI jobs: bun test, bun build:check, and a bundle-freshness check that catches PRs editing JS source without rebuilding the importmap-friendly app/assets/javascripts/modal_stack.js. - Automated release on push to main via OIDC trusted publishing (.github/workflows/release.yml). Tag, GitHub Release, and gem push driven by lib/modal_stack/version.rb. - Dummy Rails app fleshed out with controllers/views/routes so we can drive a real Capybara+Cuprite suite. New rails_helper.rb registers the Cuprite driver and pulls in the gem's own Capybara matchers. - Full system spec suite under spec/system/: boot, push, pop (ESC + backdrop), stack depth, modal_replace with history :push, browser history back, all four drawer sides, dismissible flag. - RuboCop config replaced with the swal_rails-style baseline (Metrics tuned for DSL helpers, Naming/PredicatePrefix exempt for Capybara matchers, ParameterLists ignores keyword args). Old .rubocop_todo.yml deleted; residual offenses fixed in source (modal_link_to refactored into helpers; HTML fixtures hoisted out of the spec describe block). - capybara_spec around-block restores Capybara.app/current_driver so the unit specs no longer pollute global state and break system specs that run after them. - Dependabot enabled for bundler + github-actions (weekly). - README rewritten with usage, dev, and release instructions. - CHANGELOG reformatted to Keep a Changelog. - gemspec exclusions extended (Appraisals, gemfiles/, examples/, CLAUDE.md, bunfig.toml) so the published .gem stays minimal. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
within_modal caches a Capybara reference to the layer element, then morphTopLayer (replaceChildren) mutates the layer's children mid-test. Cuprite/Ferrum then raises NodeNotFoundError when the cached node is re-resolved on slow CI runners, even though the layer DIV itself survives the morph. Replace the post-click within_modal with a page-level have_css that scopes via CSS selector. Capybara's matcher retries against fresh DOM each tick, sidestepping the cached-node race entirely. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Aligns
modal_stack's infrastructure with the siblingswal_railsgem so both share the same support matrix and release pipeline.gemfiles/). Adds dedicatedlintjob and aci-successaggregator for branch protection.bun test,bun run build:check, and abundle-freshnesscheck that catches PRs editing JS source without rebuilding the importmap-friendlyapp/assets/javascripts/modal_stack.js.mainvia OIDC trusted publishing (.github/workflows/release.yml). Tag, GitHub Release, andgem pushdriven bylib/modal_stack/version.rb.rails_helper.rb. Full Capybara system suite underspec/system/covering boot, push, pop (ESC + backdrop), depth-2 stack inertness,modal_replacewithhistory: :push, browser back, all four drawer sides, and the dismissible flag.Metricstuned for DSL helpers,Naming/PredicatePrefixexempt for the Capybara matchers,ParameterListsignores keyword args)..rubocop_todo.ymldeleted; residual offenses fixed in source (modal_link_torefactored into helpers; HTML fixtures hoisted out of theRSpec.describeblock).capybara_specnow uses anaroundblock to restoreCapybara.app/current_driverso the unit specs stop polluting global state and breaking system specs that run after them.Appraisals,gemfiles/,examples/,CLAUDE.md,bunfig.toml).Local verification
bundle exec rake(rspec + rubocop) green on all 4 appraisals — 105 examples, 0 failures, 38 files / no offenses each.bun test— 61 pass / 0 fail.bun run build:checkclean.bin/build && git diff --exit-code app/assets/javascripts/modal_stack.js— no drift.gem build modal_stack.gemspecproduces a 0.1.0 gem with onlyapp/,lib/,CHANGELOG.md,CODE_OF_CONDUCT.md,LICENSE.txt,Rakefile,README.md(nobin/,spec/,gemfiles/,Appraisals,examples/,.github/,CLAUDE.md).Test plan
lint,js-test,js-build-check,bundle-freshness,ci-successgreen.release.ymltagsv0.1.0(no-op since tag already exists) without errors.Notes
e22f2a7from PR Force RuboCop to use the repository config in rake tasks #2 (Force RuboCop to use the repository config in rake tasks). The new CI callsbundle exec rubocop --no-serverdirectly, so the rake-level override is no longer needed — this PR restores bareRuboCop::RakeTask.new. Merging this PR also closes out PR Force RuboCop to use the repository config in rake tasks #2.modal_stackis already configured on rubygems.org, per user confirmation. The release workflow will publish on the next push tomainafter merge if the version bumps.🤖 Generated with Claude Code