Skip to content

Commit 7debc98

Browse files
committed
Add "How to prepare PR for changes in the next CRuby version" section to the How-To guide
1 parent 9dcb731 commit 7debc98

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/contributor/how-to-guide.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
* [How to introduce a constant in specs](#how-to-introduce-a-constant-in-specs)
3333
* [How to add a new spec](#how-to-add-a-new-spec)
3434
* [How to work on a new CRuby feature](#how-to-work-on-a-new-cruby-feature)
35+
* [How to prepare PR for changes in the next CRuby version](#how-to-prepare-pr-for-changes-in-the-next-cruby-version)
3536

3637
## How to find a Core Method implementation
3738

@@ -1582,3 +1583,22 @@ When you work on a new feature/method usually you make the following steps:
15821583
- untag MRI tests and ensure they pass too
15831584
- mention in a PR description an original issue in a way it's described in the Ruby
15841585
release notes or provide a link to an original ticket (on <https://bugs.ruby-lang.org>)
1586+
1587+
## How to prepare PR for changes in the next CRuby version
1588+
1589+
When you work on a new feature that is introduced in Ruby version which TruffleRuby doesn't support yet
1590+
(e.g. TruffleRuby is compatible with Ruby 3.1 now but the feature is introduced in Ruby 3.2) there is a
1591+
problem with running proper specs locally and on CI (both internal and GitHub Actions).
1592+
1593+
So you should ensure that the specs for the new feature are run and passed successfully on CI and the
1594+
whole suit pass successfully as well:
1595+
1596+
- add specs for the new feature if they are missing (with a `ruby_version_is` guard)
1597+
- use `PRETEND_RUBY_VERSION` environment variable to run specs for the new feature
1598+
- add a file with specs for the new feature to the next list in `spec/truffleruby.next-specs` (to run them on CI)
1599+
- use `jt test :next` to run locally all the specs for the next CRuby version
1600+
1601+
If the new feature breaks existing behavior and some specs fail - disable them temporary (until TruffleRuby
1602+
is switched to the next CRuby version completely) with tagging as failed (use `jt tag <path-to-spec-file>`)
1603+
1604+
Look for additional details in the Contributor Workflow guide <https://github.com/oracle/truffleruby/blob/master/doc/contributor/workflow.md#running-specs-for-ruby-32-features>.

0 commit comments

Comments
 (0)