Skip to content

ci: Run RuboCop serially to avoid JRuby thread-parallel failures - #424

Merged
kinyoklion merged 1 commit into
mainfrom
devin/1787848263-rubocop-serial
Aug 27, 2026
Merged

ci: Run RuboCop serially to avoid JRuby thread-parallel failures#424
kinyoklion merged 1 commit into
mainfrom
devin/1787848263-rubocop-serial

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Aug 27, 2026

Copy link
Copy Markdown
Member

Run RuboCop serially, mirroring launchdarkly/openfeature-ruby-server#34, because --parallel is broken under JRuby as of RuboCop 1.90.0.

  • The shared check composite action runs on jruby-9.4, and the gemspec's rubocop "~> 1.76" floats to 1.90.0 (released 2026-08-24), so this repo is exposed to the same failure
  • Parallelism buys little here, and the CRuby jobs only lose a negligible speedup

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

launchdarkly/openfeature-ruby-server#34

Implementation details

Root cause (from the investigation in openfeature-ruby-server#34)

Under JRuby the parallel gem cannot fork, so it runs work in threads instead of worker processes. RuboCop 1.90 began preserving cop instances across files, and RuboCop::Cop::Base documents the assumption that each --parallel worker is its own process with its own cop instances. With threads that assumption breaks: reused cop instances see concurrent processed_source values, producing internal cop errors and phantom offenses with mismatched locations. The mechanism is a reading of the RuboCop source, not an upstream-confirmed diagnosis.

Verified there (JRuby 10.0.4/10.0.6/10.1.1 with RuboCop 1.90.0: --parallel fails, serial clean; RuboCop 1.89.0: both clean), so no JRuby upgrade avoids it and pinning RuboCop only defers it.

Scope

Only .github/actions/check/action.yml changes; that action is used by ci.yml, build-gem.yml, release-please.yml, and the manual publish workflows, so all of them pick up the serial run.

Alternatives considered

  • Pin rubocop to ~> 1.89.0: hides the problem and freezes lint at an old version.
  • Skip RuboCop on JRuby: works, but drops JRuby-specific lint coverage for no benefit over running serially.

Link to Devin session: https://app.devin.ai/sessions/feaff386987f4b3db39becb95bce9fa4
Open in Devin Desktop: https://app.devin.ai/desktop/session/feaff386987f4b3db39becb95bce9fa4?variant=devin
Requested by: @kinyoklion


Note

Overview
The shared Quality control checks composite action (.github/actions/check/action.yml) now runs bundle exec rubocop without --parallel, so RuboCop executes serially on every workflow that uses this action (CI, gem build, release, etc.).

This avoids JRuby CI failures introduced with RuboCop 1.90, where thread-based “parallel” workers reuse cop instances and trigger internal errors and bogus offenses; serial execution matches the fix used in launchdarkly/openfeature-ruby-server#34.

Reviewed by Cursor Bugbot for commit 8b0080f. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Contributor

@cursor review

@kinyoklion
kinyoklion marked this pull request as ready for review August 27, 2026 16:35
@kinyoklion
kinyoklion requested a review from a team as a code owner August 27, 2026 16:35
@kinyoklion
kinyoklion merged commit 63d65e7 into main Aug 27, 2026
12 checks passed
@kinyoklion
kinyoklion deleted the devin/1787848263-rubocop-serial branch August 27, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants