Skip to content

Fix CI, drop the V2 label requirement, and test through Ruby 4.0.5 - #5

Merged
grantcox merged 13 commits into
ynab-v2from
stagility/fix-ci
Sep 3, 2026
Merged

grantcox merged 13 commits into
ynab-v2from
stagility/fix-ci

Conversation

@grantcox

@grantcox grantcox commented Sep 2, 2026

Copy link
Copy Markdown

Nine commits, each self-contained.

CI plumbing

Pin actions to full-length SHAs. Org policy rejects floating tags, which failed all six Ruby jobs at job setup. actions/checkout@v3a37ce91, ruby/setup-ruby@v195ef2b0 (v1.321.0). Same versions.

fail-fast: false. One failing version was cancelling the rest, so siblings that had already passed reported as failures.

Remove the V2 label requirement. pr-review.yml required one_of: V2, but no such label exists in this fork, so every PR failed it unconditionally. label-checker was the file's only job, so the file is gone. The org tier-2-repos ruleset has no required-status-check rule, so nothing waits on a check that will never report.

Making the suite run on modern Ruby

The matrix stopped at 2.7, and everything past it was broken. Each of these was a hard stop:

  • rake ~> 11.3 pinned rake 11, which requires ostruct — not a default gem in Ruby 4.0. Relaxed to >= 11.3.
  • webmock ~> 2.3 pinned webmock 2.3.2 (2017), which requires base64 — not a default gem from Ruby 3.4. Relaxed to >= 2.3.2.
  • logger left the default gems in Ruby 4.0 and spec_helper requires it. Added.
  • &Proc.new in both XML backends — the implicit-block idiom Ruby 3.0 removed. XML#each raised ArgumentError on every Ruby from 3.0 on. This one is library code, not test-only.
  • MiniTest::Mock — minitest dropped the MiniTest alias. spec_helper already used Minitest, so this was the last old-spelling reference.
  • minitest 6, which Ruby 4.0 bundles and which wins activation over the gemspec pin. It removed the global must_* expectations this suite is written in, moved Minitest::Mock to a separate gem, and rejects assert_equal nil. Handled with minitest-global_expectations, minitest-mock (only on Ruby >= 4.0 — it needs Ruby >= 3.1, which the old half of the matrix cannot meet), and must_equal nilmust_be_nil.
  • Instance-variable order is not preserved across a Marshal round-trip on Ruby 3+; four marshal specs compared the arrays directly. Now compared as sets.

spec/environment.rb was swallowing $stderr unconditionally, so all of the above surfaced as a silent exit with no test output and no cause — the buffer is now released when the run fails. Worth knowing about before debugging anything else here.

Matrix

2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 4.0.5, jruby-9.3, quoted so YAML does not read them as floats. All 12 green.

Org policy requires all actions be pinned to a full-length SHA; the
floating tags blocked every Ruby test job at job setup.
The label-checker job was the only job in pr-review.yml, and the V2
label does not exist in this fork, so every PR failed it.
fail-fast defaults to true, so one failing version cancelled the rest
and hid whether they actually passed.
minitest dropped the MiniTest compatibility alias; spec_helper already
uses Minitest, so this was the last reference to the old spelling.
Both pins held gems that require stdlib files no longer shipped by
default, and spec/environment.rb swallows $stderr, so the resulting
LoadErrors surfaced as a silent exit with no test output at all.
Ruby 3.0 removed the bare Proc.new implicit-block idiom, so XML#each
raised ArgumentError on every Ruby from 3.0 on.
Ruby 3.x onward does not preserve instance variable order across a
Marshal round-trip; the assertion only cares that the set matches.
Extends the matrix over the 3.x line up to 4.0.5, the version Evergreen
runs. Versions are quoted so YAML does not read them as floats.
The buffer was discarded unconditionally, so a LoadError in spec_helper
produced a silent exit with no test output and no cause.
minitest 6 removed the global must_* expectations and Minitest::Mock,
and rejects assert_equal nil. The two shim gems restore the first two
for every Ruby in the matrix; must_be_nil works on minitest 5 and 6.
Ruby 4.0's bundled minitest 6 wins activation over the gemspec pin, and
it no longer ships Mock.
@grantcox grantcox changed the title Fix CI: pin actions to SHAs, drop the V2 label requirement Fix CI, drop the V2 label requirement, and test through Ruby 4.0.5 Sep 2, 2026

@grantcox grantcox Sep 2, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the same change in lib/recurly_v2/xml/rexml.rb are both "broken in production" bugs (ArgumentError will be raised in Ruby 3 onwards), they're not just CI issues.

However, Claude has traced this and the only use is for redaction of CVVs in debug log messages, and so is only invoked if the RECURLY_INSECURE_DEBUG env var is true. I've confirmed we don't set this env var anywhere, so that's why we haven't had any issues ourselves.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the issue in rexml.rb was fixed upstream in recurly@f516a11#diff-b2b37bc25c4fe579fc6b01c5356a20e8d4f7fb730fd2f2cba26c942f38d72722 , although this nokogiri.rb issue is still present.

I will create another PR updating us to the latest upstream v2 branch. But that will come after this one - we want CI to actually be running (and green) to confirm that this version update does still pass completely, on all relevant Ruby versions.

Evergreen is on 4.0.5 today, so keep that exact version covered, and add a
'4' entry that setup-ruby resolves to the newest 4.x it knows about.
Comment thread .github/workflows/ci.yml
# '4' is a prefix match resolved against the version list baked into the
# setup-ruby commit pinned below, so it only tracks new 4.x releases as far
# as that pin. Bump the pin to pick up newer ones.
ruby: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0.5', '4', 'jruby-9.3']

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4.0.5 is what we use in Evergreen currently, hence that version specifically. 4 is just to test any future versions (currently 4.0.6)

Comment thread .github/workflows/ci.yml
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }} tests
strategy:
fail-fast: false

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really matter, it just means "if one test in the matrix fails, do we cancel all others". I think it's worth seeing what does succeed vs fail, hence the change. But when everything is green, it's no difference.

Comment on lines -21 to -25
steps:
- name: Check Labels
uses: docker://agilepathway/pull-request-label-checker:latest
with:
one_of: V2

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was requiring every PR to have a V2 tag. This may make sense in the upstream repo, but it doesn't for us, and we don't want an irrelevant failing CI step.

@grantcox
grantcox marked this pull request as ready for review September 2, 2026 23:12
@grantcox
grantcox requested a review from becky-ynab September 2, 2026 23:12

@becky-ynab becky-ynab left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@grantcox
grantcox merged commit 5c2072a into ynab-v2 Sep 3, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants