Expand bundle gem to allow users to choose between Code of Conducts.#9256
Open
colby-swandale wants to merge 14 commits intomasterfrom
Open
Expand bundle gem to allow users to choose between Code of Conducts.#9256colby-swandale wants to merge 14 commits intomasterfrom
bundle gem to allow users to choose between Code of Conducts.#9256colby-swandale wants to merge 14 commits intomasterfrom
Conversation
…butor covernent CoCs
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the bundle gem command to allow users to choose between different Code of Conducts (Contributor Covenant or Ruby Community Conduct Guideline) instead of a boolean on/off option. The change migrates the configuration from a boolean to a string value while maintaining backward compatibility with existing boolean configurations.
Changes:
- Updated
--cocoption to accept string values:contributor-covenant,ruby, ornone - Added two new Code of Conduct templates for the different options
- Implemented backward compatibility logic to migrate legacy boolean values (
true/false) to the new string-based system - Updated tests to cover all new functionality and edge cases
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| bundler/spec/commands/newgem_spec.rb | Comprehensive test coverage for new CoC options, backward compatibility, and configuration behavior |
| bundler/lib/bundler/templates/newgem/RUBY_SRC_CODE_OF_CONDUCT.md.tt | New template for Ruby Community Conduct Guideline |
| bundler/lib/bundler/templates/newgem/CONTRIBUTOR_COVENANT_CODE_OF_CONDUCT.md.tt | New template for Contributor Covenant v3.0 |
| bundler/lib/bundler/settings.rb | Moved gem.coc from BOOL_KEYS to STRING_KEYS to support string values |
| bundler/lib/bundler/man/bundle-gem.1.ronn | Updated documentation for the new --coc options |
| bundler/lib/bundler/cli/gem.rb | Implemented ask_and_set_coc method with backward compatibility logic |
| bundler/lib/bundler/cli.rb | Updated method_option for --coc to accept string enum with lazy_default |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.
What was the end-user or developer problem that led to this PR?
The bundle gem command has been using the Contributor Covenant since 2014, but it was recently updated to the Ruby CoC when the RubyGems project was moved under the Ruby Organization.
I want to improve the project by updating the bundle gem command to offer a choice between the two going forward. This will also allow the Ruby community to nominate any future Code of Conducts more easily if needed.
What is your fix for the problem, implemented in this PR?
This Pull Request updates the bundle gem --coc option to allow users to select between the Ruby CoC or the Contributor Covenant. It takes into account any previous configuration (before: Boolean, after: String) for this option and handles the migration to the new functionality appropriately.
Make sure the following tasks are checked