When scaffolding a new packages/forest_admin_datasource_* (or any new)
package, mirror an existing package's scaffold (Gemfile, Gemfile-test,
Rakefile, .rspec, gemspec, LICENSE, spec/spec_helper.rb, .gitignore)
and update every one of these in the same PR β missing one breaks CI or
releases silently, not loudly:
-
lib/<package>/version.rbβ must be exactly:module <Module> VERSION = "0.1.0" end
Double quotes, no
.freeze. The release sed in.releaserc.jsonly matches this exact format. -
New
.gemspecβ explicitly opt out of RubyGems MFA, matching every other package:spec.metadata['rubygems_mfa_required'] = 'false'
Gem publishing runs unattended from CI (
.releaserc.js), so it can't satisfy an MFA prompt. -
.rubocop.ymlβ add the newversion.rbto:Style/MutableConstantExcludeStyle/StringLiteralsExclude
And the new
.gemspectoGemspec/RequireMFAExclude β the cop flags the'false'opt-out from step 2 as an offense, so it needs suppressing.(Other per-file excludes β
Metrics/MethodLength,Metrics/BlockLength,Naming/PredicatePrefixβ are added case-by-case only if the cop actually fires; don't copy them blindly.) -
.releaserc.jsβ add the package in all three spots:prepareCmd:sed -i 's/VERSION = ".*"/VERSION = "${nextRelease.version}"/g' packages/<package>/lib/<package>/version.rb;successCmd:( cd packages/<package> && gem build && gem push <package>-*.gem );@semantic-release/gitassets:packages/<package>/lib/<package>/version.rb
-
.github/workflows/build.ymlβ add the package name to:- the
testjob'spackagesmatrix - the "Send coverage" step's
files:list, as.../reports/<ruby-version>-<package>/coverage.jsonβ the version prefix comes from the artifact name and is easy to drop, and a path that resolves to nothing is exactly the silent-zero case warned about there
The
lintjob needs no entry: it runs one rootbundle exec rubocop, and the root.rubocop.ymlhas noInclude, so it already walkspackages/**.A package with no spec suite (like
forest_admin_test_toolkit) belongs in neither list: the Test step dies atBUNDLE_GEMFILE=Gemfile-test bundle installbefore rspec runs, and qlty'sskip-errorsdefault swallows a missingcoverage.jsoninstead of reddening the job. Such a package's ownGemfileis then resolved nowhere in CI β breakage surfaces only locally β though its gemspec still is, via thepath:refs in five other packages'Gemfile-test. - the
After merging, verify the next release actually bumps the new version.rb β
the sed in step 4 silently no-ops if the format from step 1 is off, with no
CI failure to catch it.