← Graph

How To Package A Rails Engine Generation To Automation

talk 32 connections

Adrian Marin's wroclove.rb 2022 talk walking end-to-end through packaging a Rails engine as a distributable gem. Covers: what a Rails engine is (a miniature Rails app with its own routes, models, controllers, views, mounted inside a host app); when to use engines (e.g. a marketplace with separate buyer/seller namespaces) vs generating shareable frameworks like an admin panel; generating a mountable engine with `rails plugin new admin --mountable` and the dummy test app inside `test/`; the gemspec as the 'package.json of Ruby' — metadata, homepage/bug-tracker links, the files option, runtime dependencies (e.g. `spec.add_dependency 'pundit'`) and the engine's internal Gemfile for dev dependencies; building with `bundle exec rails build`; building in isolation via a Docker image (Ruby base, nokogiri caching layer, bundler install, build, then `docker cp` the gem out) to avoid polluted local env/assets; publishing with `gem push`; versioning with the `bump` gem (bump pre/minor/major/patch, auto-commit, tag and push); changelog options (CHANGELOG.md, Confluence, docs, GitHub Releases attached to git tags). Then automates the whole workflow with GitHub Actions: test workflow with a matrix of Ruby 3.0/3.1 × Rails 6/7, Postgres service, actions/checkout, ruby/setup-ruby, capybara failure screenshot upload via actions/upload-artifact, codecov action; lint workflow using reviewdog with Standard RB and ESLint posting inline PR suggestions; PR labeling by branch prefix (feature/, fix/, chore/, refactor/) via pr-labeler; release-drafter to auto-generate categorized release notes with contributor attributions on every merge to main; and a release workflow triggered on `v*.*` tags that checks out, builds the gem, fetches the drafted release notes, creates a GitHub Release with the gem attached as an asset, and finally `gem push`es to RubyGems. Closes with the engine asset-pipeline problem: either hook into the host app's asset pipeline (requires Node.js etc. on the host) or pre-compile assets at build time inside `public/admin-assets` using jsbundling with esbuild + Tailwind scripts in package.json, and serve them via a `Rack::Static` middleware registered in the Engine class that maps `/admin-assets` to the engine's `public/` — letting the host app stay oblivious. Ends with community shout-outs to Ruby Romania, the Short Ruby Newsletter by Lucian Ghinda, and a 'be kind, build useful things' call to action. Q&A covers engines vs namespaces in growing monoliths, packaging an engine with Webpacker, and strategies for avoiding model duplication across engines.

date
2022-03-11
type
talk
talk How To Package A Rails Engine Generation To Automation
about
Rails Engine concept
The talk's core subject is how to build, ship, and maintain Rails engines.
talk How To Package A Rails Engine Generation To Automation
about
Avo tool
Avo is the running example throughout the talk.
talk How To Package A Rails Engine Generation To Automation
about
RubyGems tool
Talk covers publishing engines as gems on RubyGems.
talk How To Package A Rails Engine Generation To Automation
about
gemspec concept
Talk walks through the gemspec as the gem's manifest.
talk How To Package A Rails Engine Generation To Automation
about
Entire automation section uses GitHub Actions.
talk How To Package A Rails Engine Generation To Automation
about
Docker tool
Docker is used to build gems in isolation.
talk How To Package A Rails Engine Generation To Automation
about
bump gem tool
The bump gem is recommended for automating version bumps, commits, and tags.
talk How To Package A Rails Engine Generation To Automation
about
Final section of the talk explains compiling engine assets at build time.
talk How To Package A Rails Engine Generation To Automation
about
Talk explains building gems in Docker for isolation.
talk How To Package A Rails Engine Generation To Automation
about
Talk demonstrates a Ruby × Rails matrix for the test workflow.
talk How To Package A Rails Engine Generation To Automation
about
Changelog concept
Talk discusses changelog options for gem releases.
talk How To Package A Rails Engine Generation To Automation
about
reviewdog tool
Lint workflow uses reviewdog to post inline suggestions on PRs.
talk How To Package A Rails Engine Generation To Automation
about
Ruby linting in the engine's CI uses Standard RB via reviewdog.
talk How To Package A Rails Engine Generation To Automation
about
ESLint tool
JavaScript linting in the engine's CI uses ESLint via reviewdog.
talk How To Package A Rails Engine Generation To Automation
about
Release notes are auto-drafted using the Release Drafter action.
talk How To Package A Rails Engine Generation To Automation
about
PR Labeler tool
Pull requests are auto-labeled using the PR Labeler action by branch prefix.
talk How To Package A Rails Engine Generation To Automation
about
Codecov tool
Coverage is uploaded to Codecov via its GitHub Action.
talk How To Package A Rails Engine Generation To Automation
about
Used at the start of each workflow to check out the code.
talk How To Package A Rails Engine Generation To Automation
about
Used in the test workflow to install the matrix's Ruby version.
talk How To Package A Rails Engine Generation To Automation
about
Used to upload RSpec screenshots/html dumps from failing CI runs.
talk How To Package A Rails Engine Generation To Automation
about
Release workflow creates a GitHub Release with the gem attached.
asked_at
How To Package A Rails Engine Generation To Automation talk
Asked during the Q&A of this talk.
asked_at
How To Package A Rails Engine Generation To Automation talk
Asked during the Q&A of this talk.
asked_at
How To Package A Rails Engine Generation To Automation talk
Asked during the Q&A of this talk.
person Adrian Marin
authored
How To Package A Rails Engine Generation To Automation talk
Adrian Marin delivered this talk at wroclove.rb 2022.
from_talk
How To Package A Rails Engine Generation To Automation talk
Key recommendation from the talk's asset-pipeline section.
from_talk
How To Package A Rails Engine Generation To Automation talk
Recommendation from the build-isolation section.
from_talk
How To Package A Rails Engine Generation To Automation talk
Recommendation from the gemspec walkthrough.
from_talk
How To Package A Rails Engine Generation To Automation talk
Central recommendation of the talk.
from_talk
How To Package A Rails Engine Generation To Automation talk
Closing call to action of the talk.
talk How To Package A Rails Engine Generation To Automation
presented_at
Talk presented at wroclove.rb 2022.
talk How To Package A Rails Engine Generation To Automation
related_to
Adrian opens by praising Yaroslav's earlier wroclove.rb 2022 talk on ViewComponent and Hotwire.

Provenance

Created
2026-04-17 16:17 seed
Read by
16 extractions