|
1 | 1 | <!---
|
2 |
| -This file was generated on 2019-12-05T21:32:23+00:00 from the rspec-dev repo. |
| 2 | +This file was generated on 2020-12-24T13:24:00+01:00 from the rspec-dev repo. |
3 | 3 | DO NOT modify it by hand as your changes will get lost the next time it is generated.
|
4 | 4 | -->
|
5 | 5 |
|
@@ -42,3 +42,45 @@ test case. To make this process easier, we have prepared one basic
|
42 | 42 | Maintenance branches are how we manage the different supported point releases
|
43 | 43 | of RSpec. As such, while they might look like good candidates to merge into
|
44 | 44 | main, please do not open pull requests to merge them.
|
| 45 | + |
| 46 | +## Working on multiple RSpec gems at the same time |
| 47 | + |
| 48 | +RSpec is composed of multiple gems (`rspec-core`, `rspec-mocks`, etc). Sometimes you have |
| 49 | +to work on a combination of them at the same time. When submitting your code for review, |
| 50 | +we ask that you get a passing build (green CI). If you are working across the repositories, |
| 51 | +please add a commit that temporarily pins your PR to the right branch of the other repository |
| 52 | +you depend on. For example, if we wanted a change in `rspec-expectations` that relied on a |
| 53 | +change for on `rspec-mocks`. We add a commit with the title: |
| 54 | + |
| 55 | +>[WIP] Use rspec-mocks with "custom-failure-message" branch |
| 56 | +
|
| 57 | +And content: |
| 58 | + |
| 59 | +```diff |
| 60 | +diff --git a/Gemfile b/Gemfile |
| 61 | + |
| 62 | +-%w[rspec rspec-core rspec-mocks rspec-support].each do |lib| |
| 63 | ++%w[rspec rspec-core rspec-support].each do |lib| |
| 64 | + library_path = File.expand_path("../../#{lib}", __FILE__) |
| 65 | + if File.exist?(library_path) && !ENV['USE_GIT_REPOS'] |
| 66 | + gem lib, :path => library_path |
| 67 | +@@ -11,6 +11,7 @@ branch = File.read(File.expand_path("../maintenance-branch", __FILE__)).chomp |
| 68 | + gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => branch |
| 69 | + end |
| 70 | + end |
| 71 | ++gem 'rspec-mocks', :git => "https://github.com/rspec/rspec-mocks.git", :branch => "custom-failure-message" |
| 72 | +``` |
| 73 | + |
| 74 | +In general the process is: |
| 75 | +1. Create PRs explaining what you are trying to achieve. |
| 76 | +2. Pin the repositories to each other. |
| 77 | +3. Check they pass (go green). |
| 78 | +4. Await review if appropriate. |
| 79 | +5. Remove the commit from step 2. We will merge ignoring the failure. |
| 80 | +6. Remove the commit from the other, check it passes with the other commit now on `main`. |
| 81 | +7. Merge the other. |
| 82 | +8. We will trigger builds for the `main` branch of affected repositories to check if everything is in order. |
| 83 | + |
| 84 | +Steps 5-8 should happen continuously (e.g. one after another but within a short timespan) |
| 85 | +so that we don't leave a broken main around. It is important to triage that build process |
| 86 | +and revert if necessary. |
0 commit comments