Thanks for working on activestorage-multi_node_disk. Read AGENTS.md first: it is the source of truth for the gem's scope, shape and rules, for people and coding agents alike.
Open an issue before a large change, so we can agree on the shape first. Pull requests need a green CI and a CHANGELOG line for anything a host would notice.
Tools are pinned in mise.toml (Ruby 4.0.10; the gem supports 3.3+).
bin/setup # mise install, bundle install, rakebundle exec rake # specs, StandardRB, RBS syntax
bundle exec rspec spec/requests # one folder
DATABASE_URL=postgres://user:pw@127.0.0.1/scratch bundle exec rspec # on PostgreSQL
DATABASE_URL=trilogy://root:pw@127.0.0.1:3306/scratch bundle exec rspec # on MySQL 8Without DATABASE_URL the dummy app (spec/dummy) uses SQLite. Use a scratch
database only: the suite creates and drops tables.
Current RubyGems and Bundler practice, as applied here:
- gemspec: name, version from
lib/active_storage/multi_node_disk/version.rb, summary, description, homepage, MIT,required_ruby_version >= 3.3; metadatahomepage_uri,source_code_uri,changelog_uri,bug_tracker_uri,documentation_uri,rubygems_mfa_requiredandallowed_push_host(rubygems.org);spec.filesfromgit ls-fileswithout specs, sigs,bin/and dot files. - Dependencies: runtime only
activestorage,actionpack,railties(>= 8.1, < 9); development gems in the Gemfile.Gemfile.lockis committed (Bundler's current guidance). Dependabot proposes updates weekly. - Code:
lib/activestorage-multi_node_disk.rb(Bundler's auto-require) requiresactive_storage/multi_node_disk, which sets upZeitwerk::Loader.for_gem_extension(ActiveStorage); the service file is left to Active Storage's Configurator.# frozen_string_literal: trueeverywhere; one concern per file; a header comment on every class; YARD on public methods. RBS signatures insig/(rake rbschecks the syntax; a full type check needs Rails signatures). - Style: StandardRB, targeting Ruby 3.3 (
.standard.yml); no.rubocop.yml. - Versions: SemVer from 0.1.0; Keep a Changelog: add a
line under
[Unreleased]for anything a host would notice. - CI: GitHub Actions (
.github/workflows/ci.yml):rakeon Ruby 3.3, 3.4 and 4.0, then the suite on PostgreSQL 17 and MySQL 8. Actions are pinned to commit SHAs. Oracle is not run in CI: the audit migration is rendered and its names checked by the suite. - Security: no secrets in the repo; see SECURITY.md.
Releases go to rubygems.org from GitHub Actions with
trusted publishing (no
API key) and a Sigstore attestation (.github/workflows/release.yml, in the
rubygems environment).
Before the first release, an owner of the gem adds a pending trusted
publisher on rubygems.org (Profile → Trusted publishers): gem
activestorage-multi_node_disk, repository owner clearstackio, repository
activestorage-multi_node_disk, workflow release.yml, environment
rubygems. After the first push it becomes the gem's trusted publisher.
- Update
VERSIONinlib/active_storage/multi_node_disk/version.rband runbundle installsoGemfile.lockfollows. - Move the
[Unreleased]entries inCHANGELOG.mdunder the new version and date, and update the compare links at the bottom. - Commit, then tag and push:
git tag vX.Y.Z && git push origin master vX.Y.Z.
The workflow checks the tag matches VERSION, runs rake, then builds,
pushes and attests the gem.
Every behaviour gets a spec: the service against fake nodes
(spec/active_storage/service), the endpoint and routing (spec/requests),
configuration, audit and the generator (spec/active_storage/multi_node_disk,
spec/generators). Specs test behaviour, not layout. Multi-node behaviour
uses ActiveStorage::MultiNodeDisk::TestHelper, never the network.