Skip to content

Upgrade stack to Ruby 4.0.5 and Node 26.4.0.#457

Merged
Janell-Huyck merged 23 commits into
qafrom
LIBAPPO1-84-update-dependencies
Jun 30, 2026
Merged

Upgrade stack to Ruby 4.0.5 and Node 26.4.0.#457
Janell-Huyck merged 23 commits into
qafrom
LIBAPPO1-84-update-dependencies

Conversation

@Janell-Huyck

@Janell-Huyck Janell-Huyck commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Major platform and CI refresh for the 3.1.0 release: upgrade Ruby and Node to current org standards, migrate from CircleCI to GitHub Actions, and replace Coveralls with a SimpleCov coverage baseline gate on pull requests.

Runtime upgrades

  • Ruby 3.4.9 → 4.0.5 — adds explicit cgi gem (removed from Ruby 4 stdlib); updates .ruby-version and Gemfile
  • Node 24.x → 26.4.0 — updates .nvmrc, package.json engines, and docs to match org standard
  • Rails 8.1.3 — already on latest 8.1.x; no functional Rails upgrade beyond Ruby 4 compatibility fixes
  • Yarn 4 (Corepack) — hardens JS toolchain for CI, RSpec asset builds, and deploy:
    • JavascriptBuildEnv resolves Node/Yarn without File.which (not available on Ruby 4.0.5)
    • scripts/corepack_yarn.sh and slimmer bin/yarn for Corepack activation
    • Ensures yarn is available when Rake runs javascript:install during assets:precompile

CI: CircleCI → GitHub Actions

Removes .circleci/config.yml, .coveralls.yml, and the old .github/workflows/main.yml. Adds .github/workflows/ci_checks.yml with three job groups:

Job What it runs
checks (matrix) RuboCop, Brakeman, bundler-audit
tests Chrome + ChromeDriver (paired via setup-chrome), Node 26, yarn install, asset build, migrations, full RSpec suite
coverage-update (PRs only) Compares SimpleCov line coverage to coverage/coverage_baseline.txt; commits a higher baseline when coverage improves

Supporting scripts live under scripts/ci/ (extracted from the old monolithic workflow for clarity and local parity).

CI behavior changes vs CircleCI:

  • Parallel lint/security checks run as separate matrix jobs instead of a single build
  • RSpec runs as one job (no CircleCI test splitting); coverage artifact uploaded for the gate
  • Coveralls removedsimplecov-lcov dropped; SimpleCov HTML report + committed baseline replaces external coverage service
  • Push trigger limited to qa and main so feature-branch pushes with an open PR do not double-run CI
  • node_modules cached explicitly for Yarn 4 (setup-node's built-in Yarn 1.x cache is not used)
  • Baseline-bot commits include [skip ci] so bumping coverage_baseline.txt does not re-trigger the full workflow

Application fixes

  • true_false_toggleyes_no_label — helper always returned "Yes"; views now use a correct yes/no label
  • Capybara in CI — uses CHROME_BIN / CHROMEDRIVER_PATH from setup-chrome; fixes driver version mismatch and Driver.new keyword-arg error on current Capybara
  • Brakeman — refreshed ignore entries for file-upload warnings

Test coverage & project standards

  • 100% line + branch coverage on new/changed code in SoftwareRecordsHelper and JavascriptBuildEnv
  • New Cursor rule (.cursor/rules/new-code-coverage.mdc) documents the 100% new-code requirement; updates to code-quality.mdc and definition-of-done.mdc
  • spec/ci/ci_checks_spec.rb guards CI workflow shape (no Coveralls, baseline file present, skip-ci on bot commits)
  • Coverage baseline raised to 77.31%

Docs

  • README.md and CHANGELOG.md updated for Ruby 4, Node 26, GHA CI, and SimpleCov baseline gate

Test plan

  • CI green on this PR (checks matrix + tests + coverage-update)
  • Confirm baseline-bot push does not re-run full CI (commit message contains [skip ci])
  • Local: nvm use, corepack enable, bin/setup, bundle exec rspec
  • Local: bundle exec rubocop
  • Deploy smoke test to QA after merge (Capistrano asset precompile with Node 26 + Yarn 4)

Janell-Huyck and others added 23 commits June 30, 2026 13:33
Align CI, deploy docs, and version pins with org standards; add cgi gem
required after Ruby 4 removed CGI from the default stdlib.

Co-authored-by: Cursor <cursoragent@cursor.com>
Skip global corepack enable on cimg's /usr/local Node; prepare and invoke
yarn via corepack from the active nvm installation instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove obsolete and duplicate File Access ignores after safe_path refactor;
update line numbers and notes for Brakeman 8.

Co-authored-by: Cursor <cursoragent@cursor.com>
Activate Corepack from the nvm Node bin so jsbundling-rails can shell out
to bare yarn in CI and during assets:precompile specs.

Co-authored-by: Cursor <cursoragent@cursor.com>
CircleCI nvm Node installs omit the corepack shim; invoke corepack.js
with --install-directory ~/bin so yarn is on PATH for Rake and CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
Run parallel lint/security jobs and a tests job on ubuntu-24.04, enforce
SimpleCov coverage via a committed baseline on pull requests, and consolidate
Corepack/Yarn setup into shared CI scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
setup-node's cache: yarn invokes global Yarn 1.x before Corepack; restore
and save node_modules via actions/cache instead while keeping bundler-cache.

Co-authored-by: Cursor <cursoragent@cursor.com>
Feature-branch pushes with an open PR were firing both push and
pull_request events, causing every job to run twice.

Co-authored-by: Cursor <cursoragent@cursor.com>
JavascriptBuildEnv now resolves Node from setup-node when nvm is absent
so assets:precompile can run yarn during RSpec. Capybara uses the pinned
CHROME_BIN from setup-chrome and skips a mismatched bundled chromedriver.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pass the Rack app as the first positional argument to
Capybara::Selenium::Driver.new; the CI-only driver is skipped locally
when CI is unset.

Co-authored-by: Cursor <cursoragent@cursor.com>
Avoids "Unable to reserve cache" races from saving an existing key;
continue-on-error covers overlapping runs. Save runs after tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Install matching chromedriver from setup-chrome and export both paths so
feature specs do not use the runner's stale system driver. Add a git-push
rule requiring an explicit push request.

Co-authored-by: Cursor <cursoragent@cursor.com>
Route bin/yarn through JavascriptBuildEnv only, surface Corepack
failures, and fold Ruby version checks into print_runner_env. Drop
unused setup_dependencies scripts and harden the CI Capybara driver.

Co-authored-by: Cursor <cursoragent@cursor.com>
Walk PATH with File.executable? instead; File.which is not available
on Ruby 4.0.5 and broke assets:precompile in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
Only warn when Corepack setup fails and yarn is not on PATH; fix specs
that stubbed activate_yarn! without a return value.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add specs for sorting, encryption, pie charts, toggles, and upgrade
history. Fix true_false_toggle to read the record attribute and test
helper module methods directly where controller helpers shadow them.

Co-authored-by: Cursor <cursoragent@cursor.com>
The old helper always returned Yes; yes_no_label formats the boolean
value the view already passes. Clarify yes_no_toggle as form-only.

Co-authored-by: Cursor <cursoragent@cursor.com>
Exercise PATH lookup, yarn detection, default_root branches, and apply!
warning paths. Split apply! examples into a dedicated spec file.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add new-code-coverage.mdc and reference it from code-quality and
definition-of-done so touched application code must be fully covered.

Co-authored-by: Cursor <cursoragent@cursor.com>
[skip ci] on baseline commits avoids re-running the full workflow on pull_request synchronize.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Janell-Huyck

Copy link
Copy Markdown
Contributor Author

Deploys to libappstest and runs normally

@Janell-Huyck
Janell-Huyck merged commit 143fe53 into qa Jun 30, 2026
5 checks passed
@Janell-Huyck
Janell-Huyck deleted the LIBAPPO1-84-update-dependencies branch June 30, 2026 19:11
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.

1 participant