Skip to content

Chore/release pipeline - #516

Closed
caseyprovost wants to merge 6 commits into
graphiti-api:mainfrom
topkeyhq:chore/release-pipeline
Closed

caseyprovost wants to merge 6 commits into
graphiti-api:mainfrom
topkeyhq:chore/release-pipeline

Conversation

@caseyprovost

Copy link
Copy Markdown
Contributor

No description provided.

caseyprovost and others added 6 commits August 1, 2026 17:13
The `Appraisals` file and `gemfiles/` had silently diverged. Three gemfiles
that CI referenced -- rails_7_2_graphiti_rails, rails_8_0_graphiti_rails and
rails_8_1_graphiti_rails -- had no corresponding `appraise` block, so running
`bundle exec appraisal generate` would have deleted them and broken CI.

Appraisals now defines a plain and a graphiti-rails variant for each of Rails
7.0, 7.1, 7.2, 8.0 and 8.1, and `appraisal generate` is a no-op against the
committed gemfiles. Rails 5.2 and 6.0 are dropped; both are long EOL and 5.2
cannot run on any supported Ruby.

Two things surfaced while doing this:

- sqlite3 pins were inconsistent (rails-7-1 used "~> 2.1" while
  rails-7-1-graphiti-rails used "~> 1.4.0"). The real constraint comes from
  each Rails version's sqlite3 adapter at require time: 7.0 demands "~> 1.4"
  strictly, 7.1/7.2 accept ">= 1.4", and 8.x requires ">= 2.1". Pins now
  follow that, documented at the top of the file.

- `database_cleaner` was declared both in the appraise blocks and in the root
  Gemfile's :test group, so generated gemfiles listed it twice. Removed from
  the appraise blocks; the root Gemfile already provides it.

The CI matrix is rebuilt as an explicit `include:` list instead of a cross
product plus `exclude:`. An exclude row naming a nonexistent gemfile is
silently ignored, which is how four dead rows for a never-generated
"rails_7_0_graphiti_rails.gemfile" survived unnoticed; an include row fails
loudly instead. The `appraisal` axis is gone as well -- it was fully
determined by the gemfile, and the old cross product existed only to be
excluded back down again.

Also adds Ruby 3.5 coverage (the gemspec's `ostruct` dependency exists
specifically because 3.5 unbundled it, and that was untested), and moves the
lint job off EOL Ruby 3.0. Net: ~60 cells down to 46, with no unreferenced
gemfile and no matrix row pointing at a missing file.

Verified locally on Ruby 4.0.1: all 10 appraisals green (272 examples each),
default Gemfile at 1418 examples / 0 failures, standardrb clean.

Co-Authored-By: Claude Opus 5 <[email protected]>
Ruby 2.7 and 3.0 and Rails 5.2 and 6.0 are all long past end of life, and
supporting them was holding the rest of the toolchain down: `required_ruby_version
>= 2.7` and `.standard.yml`'s `ruby_version: 2.7` between them capped the linter
and inflated the CI matrix with combinations that could never pass.

- required_ruby_version: ">= 2.7" -> ">= 3.1"
- activesupport: ">= 5.2" -> ">= 7.0"
- activemodel (dev): ">= 5.2" -> ">= 7.0"
- .standard.yml ruby_version: 2.7 -> 3.1

Also drops the 1.12 `post_install_message` about relationship readable/writable
guards. Its own TODO said to remove it once the 1.12 upgrade window passed, and
a major release is that moment. No replacement message was added for the new
version floor: users who cannot meet it never complete an install, so they would
never see it, and Bundler's own resolution error already says exactly which
requirement failed.

Note that 3.1 is also the highest TargetRubyVersion RuboCop 1.22.3 understands,
so raising the floor further is blocked on the pending `standard` upgrade.

BREAKING CHANGE: Ruby 3.0 and below, and Rails 6.1 and below, are no longer
supported. Applications on those versions should stay on graphiti 1.x.

Co-Authored-By: Claude Opus 5 <[email protected]>
Three development dependencies had drifted years behind what any real
consumer of this gem actually runs:

- faraday "~> 0.15" resolved to 0.17.6 (2020) while current is 2.14.x. This
  was the one with user-facing consequence: lib/graphiti/resource/remote.rb
  calls Faraday for every remote resource, so the code path was only ever
  tested against a Faraday major version essentially nobody still installs.
  Verified the exact call shape used there -- Faraday.get(url, params, headers)
  with a block setting req.options.timeout, req.options.open_timeout and
  req.headers[] -- against a real 2.14.3 connection; it works unchanged, so
  remote.rb needs no edit. Note remote_resource_spec.rb stubs Faraday.get
  throughout, which is why the suite alone would not have caught a break here.

- kaminari "~> 0.17" resolved to 0.17.0, released in 2015. Now ~> 1.2.

- graphiti_spec_helpers was pinned exactly to "1.0.beta.4", a prerelease,
  despite 1.0.0 through 1.2.0 having shipped since. Now ~> 1.2.

Verified on Ruby 4.0.1: default Gemfile 1418 examples / 0 failures, and all
Rails 7.0 through 8.1 appraisals at 272 examples / 0 failures.

Co-Authored-By: Claude Opus 5 <[email protected]>
These are behavior-preserving cleanups, split out ahead of the `standard`
upgrade so that the upgrade commit is purely mechanical. All three pass lint
under both the old and new `standard`, and are the cops rubocop classifies as
unsafe-autocorrect, so each was applied by hand rather than via `-A`:

- util/cache_debug.rb: `&.scan(...).to_a || []` -- `nil.to_a` is already `[]`,
  so the `|| []` fallback could never evaluate. Dead, not load-bearing.

- delegates/pagination.rb: `params.reject { |key, _| [...].include?(key) }`
  -> `params.except(...)`. Query#params is normalized through `to_h` and
  `deep_symbolize_keys` (query.rb:11-13), so it is always a plain symbol-keyed
  Hash and `except` is safe here.

- spec/fixtures/poro.rb: `data.select { |k, _| Array(t).include?(k) }`
  -> `data.slice(*Array(t))`.

Co-Authored-By: Claude Opus 5 <[email protected]>
`standard` was pinned to "~> 1.4.0" (2021), which held rubocop at 1.22.3.
That version is also the last one to understand TargetRubyVersion 3.1, so it
was the blocker on raising the version floor any further. Now on standard
1.56 / rubocop 1.88.

The code changes here are entirely `standardrb --fix` output across 47 files,
236 offenses, no hand edits -- the three cops rubocop treats as
unsafe-autocorrect were split into the preceding commit. The bulk is
formatting: 161 Style/QuotedSymbols, 12 Style/TernaryParentheses,
11 Performance/BigDecimalWithNumericArgument, 9 Style/RedundantParentheses,
and a long tail.

Separately, this adds an explicit `rexml` development dependency. The specs
have always needed it for ActiveSupport's `Hash.from_xml` when asserting on
`to_xml` output (rendering_spec.rb:53 and friends), but never declared it --
it arrived transitively through rubocop 1.22.3. rubocop 1.88 no longer depends
on it, and since Ruby 3.0 it is a bundled rather than default gem, so the
upgrade surfaced 8 failures in the xml rendering specs. Nothing in lib/ uses
rexml, so it is correctly a development dependency only.

Verified on Ruby 4.0.1: standardrb clean, default Gemfile 1418 examples /
0 failures, and Rails 7.0 through 8.1 appraisals at 272 examples / 0 failures.

Co-Authored-By: Claude Opus 5 <[email protected]>
The release workflow ran on Node 14 (EOL April 2023) with semantic-release 19,
actions/checkout@v3 and actions/setup-node@v2.

- semantic-release 19 -> 25, @semantic-release/changelog 6 -> 7,
  @semantic-release/git 10 -> 11
- Node 14 -> 24, setup-node@v2 -> v4 (with npm caching), checkout@v3 -> v5,
  Ruby 3.1 -> 3.4. Node 24 specifically because semantic-release 25 and its
  plugins require "^22.22.2 || >=24.15".
- Removed the submodule checkout and `git submodule update --init --recursive`
  steps. There is no .gitmodules in this repo, so both were no-ops.

Reproducible installs: releases previously ran `yarn install --frozen-lockfile`
with no lockfile committed. Worth being precise about what that did -- yarn v1
does *not* fail in that situation, it silently generates a lockfile and
continues, which is why releases have been working. The real problem is that
every release resolved its own floating set of transitive dependencies, so the
tool that publishes the gem was never twice the same. Now on `npm ci` against a
committed package-lock.json, which unlike yarn's flag genuinely fails on a
missing or mismatched lockfile.

The .npmrc sets legacy-peer-deps because [email protected] pins
`peerDependencies: { semantic-release: ">=16.0.0 <18.0.0" }`. That range is
stale rather than accurate -- the plugin was last published in July 2020 and
this project has been releasing against semantic-release 19 for years, already
outside it. Verified against 25 locally: the plugin loads under the ESM loader
and exposes all three of its verifyConditions/prepare/publish hooks, the full
plugin chain resolves, and calling its verifyConditions directly against this
repo correctly returns gemName "graphiti" with the right gemspec and
version.rb. It only reads `env` and `cwd` off the plugin context, both stable
across semantic-release majors.

package.json's version field said 1.4.0 while the gem was at 1.13.0. It is
vestigial -- semantic-release-rubygem reads lib/graphiti/version.rb -- so it is
now 0.0.0-development, the semantic-release convention, plus "private": true
since this is a Ruby gem and must never be published to npm.

NOT yet verified: the actual `gem push`. That cannot be exercised without
publishing, so this must be confirmed with a prerelease from the `beta` branch
before it is trusted on main.

Co-Authored-By: Claude Opus 5 <[email protected]>
@jkeen

jkeen commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Dropping Ruby 2.x support and Rails 5.x/6.x support is a breaking change/major version release, and I partially started that process on the beta branch along with another long-awaited breaking change. I think all this stuff also belongs there? It won't be too long before I cut a graphiti 2.0 release, and I'm cutting beta gem releases as I add features.

Wanna repoint this PR to beta?

jkeen added a commit that referenced this pull request Aug 7, 2026
Ruby 3.1 could not resolve a gemspec requiring 3.2, so the release could not build at all. Moves the workflow to Ruby 3.4, checkout v5, Node 24 and npm, and takes semantic-release 25 with it. The .npmrc override is needed because semantic-release-rubygem pins a peer range it stopped updating in 2020.

Taken from #516. The rest of that PR either predates the 2.0 branch or has been overtaken by it: its gemspec still targets Ruby 3.1 and ActiveSupport 7.0, and the lib and spec churn is standardrb autocorrection from a newer standard.

Co-Authored-By: Casey Provost <[email protected]>
jkeen added a commit that referenced this pull request Aug 7, 2026
Ruby 3.1 could not resolve a gemspec requiring 3.2, so the release could not build at all. Moves the workflow to Ruby 3.4, checkout v5, Node 24 and npm, and takes semantic-release 25 with it. The .npmrc override is needed because semantic-release-rubygem pins a peer range it stopped updating in 2020.

Taken from #516. The rest of that PR either predates the 2.0 branch or has been overtaken by it: its gemspec still targets Ruby 3.1 and ActiveSupport 7.0, and the lib and spec churn is standardrb autocorrection from a newer standard.

Co-Authored-By: Casey Provost <[email protected]>
jkeen pushed a commit that referenced this pull request Aug 10, 2026
faraday "~> 0.15" resolved to 0.17.6 (2020) while current is 2.14.x. This was the one with user-facing consequence: lib/graphiti/resource/remote.rb calls Faraday for every remote resource, so the code path was only ever tested against a Faraday major version essentially nobody still installs. The exact call shape used there - Faraday.get(url, params, headers) with a block setting req.options.timeout, req.options.open_timeout and req.headers[] - works unchanged on 2.x, so remote.rb needs no edit. Note remote_resource_spec.rb stubs Faraday.get throughout, which is why the suite alone would not have caught a break here.

kaminari "~> 0.17" resolved to 0.17.0, released in 2015. Now ~> 1.2.

From #516.
jkeen pushed a commit that referenced this pull request Aug 10, 2026
These are behavior-preserving cleanups, split out ahead of the `standard` upgrade so that the upgrade commit is purely mechanical. All three pass lint under both the old and new `standard`, and are the cops rubocop classifies as unsafe-autocorrect, so each was applied by hand rather than via `-A`:

From #516.
jkeen pushed a commit that referenced this pull request Aug 10, 2026
Purely mechanical: the pin bump, standardrb --fix output, and two hand-removed keyword_init: true (redundant since Ruby 3.2, which the gemspec requires). rexml is needed by the specs for Hash.from_xml and stopped arriving transitively when rubocop 1.88 dropped it. From #516.
@jkeen jkeen mentioned this pull request Aug 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.0.0-beta.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants