Exclude .gem files from git and gemspec files list#955
Conversation
Fixes release script failure where `bundle install` in spec/dummy fails with "shakapacker contains itself" validation error from RubyGems' validate_self_inclusion_in_files_list check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe pull request adds exclusion patterns for built gem files (*.gem) to both the gitignore configuration and the gemspec file manifest, ensuring compiled gems are not tracked in version control or distributed with the package. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ReviewClean, minimal fix for a real release-workflow bug. Both changes are correct and well-motivated.
No issues found. LGTM. |
Greptile SummaryThis PR fixes a release-script failure where
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant ReleaseIt as release-it
participant Git as git
participant Bundler as bundler
participant RubyGems as RubyGems
Dev->>ReleaseIt: Run release script
ReleaseIt->>RubyGems: gem build shakapacker.gemspec
RubyGems-->>Dev: shakapacker-x.y.z.gem (created in root)
Note over Git: *.gem now in .gitignore
ReleaseIt->>Git: git add / commit (bump version, etc.)
Git-->>ReleaseIt: *.gem ignored — not staged
Note over RubyGems: s.files filter also rejects .gem files
ReleaseIt->>RubyGems: gem build shakapacker.gemspec (final)
RubyGems-->>ReleaseIt: gem built without self-inclusion
ReleaseIt->>Bundler: bundle install (in spec/dummy)
Bundler-->>ReleaseIt: Success — no validate_self_inclusion error
Last reviewed commit: 8d88a85 |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review: Exclude .gem files from git and gemspecThis is a clean, focused fix. The root cause (RubyGems' Approach is sound:
Minor observation: No CHANGELOG entry needed per project guidelines (release infrastructure fix, not user-visible behavior change). LGTM ✓ |
|
This is a clean, well-targeted fix for a real release-flow problem. Root cause fix - Adding Defense in depth - The Gemfile.lock - The version reflects the correct rc.2 state after the rc.3 bump was reverted. This is appropriate. Minor observation - The No issues with correctness, security, or performance. Good to merge. |
## Summary - Adds `*.gem` to `.gitignore` to prevent built gem files from being staged by git (e.g., during `release-it`'s commit flow) - Adds `.gem` file exclusion to the gemspec's reject filter as a safety net Fixes the release script failure where `bundle install` in `spec/dummy` fails with RubyGems' `validate_self_inclusion_in_files_list` error: `shakapacker-9.6.0.rc.2 contains itself (shakapacker-9.6.0.rc.2.gem), check your files list` ## Test plan - [ ] Run `bundle exec gem build shakapacker.gemspec` and verify the `.gem` file is gitignored - [ ] Run a dry-run release to verify the full flow works 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Small packaging/release hygiene change limited to `.gitignore` and gemspec file selection logic. > > **Overview** > Prevents built RubyGems artifacts from being accidentally committed or packaged by **ignoring `*.gem` outputs**. > > Updates `shakapacker.gemspec`’s `s.files` filter to explicitly reject `.gem` files as a safety net, avoiding self-inclusion errors during gem build/release flows. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8d88a85. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated project configuration to exclude built gem files from version control and package distribution. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
*.gemto.gitignoreto prevent built gem files from being staged by git (e.g., duringrelease-it's commit flow).gemfile exclusion to the gemspec's reject filter as a safety netFixes the release script failure where
bundle installinspec/dummyfails with RubyGems'validate_self_inclusion_in_files_listerror:shakapacker-9.6.0.rc.2 contains itself (shakapacker-9.6.0.rc.2.gem), check your files listTest plan
bundle exec gem build shakapacker.gemspecand verify the.gemfile is gitignored🤖 Generated with Claude Code
Note
Low Risk
Small packaging/release hygiene change limited to
.gitignoreand gemspec file selection logic.Overview
Prevents built RubyGems artifacts from being accidentally committed or packaged by ignoring
*.gemoutputs.Updates
shakapacker.gemspec’ss.filesfilter to explicitly reject.gemfiles as a safety net, avoiding self-inclusion errors during gem build/release flows.Written by Cursor Bugbot for commit 8d88a85. Configure here.
Summary by CodeRabbit