Skip to content

Commit dbdf929

Browse files
committed
👷 Lock/Unlock Deps Pattern
Two often conflicting goals resolved - deps_unlocked.yml - All runtime & dev dependencies, but does not have a `gemfiles/*.gemfile.lock` committed - Uses an Appraisal2 "deps_unlocked" gemfile, and the current MRI Ruby release - Know when new dependency releases will break local dev with unlocked dependencies - Broken workflow indicates that new releases of dependencies may not work - deps_locked.yml - All runtime & dev dependencies, and has a `Gemfile.lock` committed - Uses the project's main Gemfile, and the current MRI Ruby release - Matches what contributors and maintainers use locally for development - Broken workflow indicates that a new contributor will have a bad time
1 parent ed17c92 commit dbdf929

File tree

10 files changed

+180
-12
lines changed

10 files changed

+180
-12
lines changed

.github/workflows/current.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ jobs:
3838
matrix:
3939
include:
4040
# Ruby 3.4
41-
- ruby: "3.4"
41+
- ruby: "ruby"
4242
appraisal_name: "ar-7-2"
4343
exec_cmd: "rake spec:orm:active_record"
4444
gemfile: "Appraisal.root"
4545
rubygems: latest
4646
bundler: latest
47-
- ruby: "3.4"
47+
- ruby: "ruby"
4848
appraisal_name: "ar-8-0"
4949
exec_cmd: "rake spec:orm:active_record"
5050
gemfile: "Appraisal.root"
5151
rubygems: latest
5252
bundler: latest
53-
- ruby: "3.4"
53+
- ruby: "ruby"
5454
appraisal_name: "sequel-5.86-r3"
5555
exec_cmd: "rake spec:orm:sequel"
5656
gemfile: "Appraisal.root"

.github/workflows/kitchen.yml renamed to .github/workflows/deps_locked.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
---
2-
# Targets the Rakefile's default task and the main Gemfile,
3-
# which contributors and maintainers would use locally for development
4-
name: Kitchen Sink
2+
# Lock/Unlock Deps Pattern
3+
#
4+
# Two often conflicting goals resolved!
5+
#
6+
# - deps_unlocked.yml
7+
# - All runtime & dev dependencies, but does not have a `gemfiles/*.gemfile.lock` committed
8+
# - Uses an Appraisal2 "deps_unlocked" gemfile, and the current MRI Ruby release
9+
# - Know when new dependency releases will break local dev with unlocked dependencies
10+
# - Broken workflow indicates that new releases of dependencies may not work
11+
#
12+
# - deps_locked.yml
13+
# - All runtime & dev dependencies, and has a `Gemfile.lock` committed
14+
# - Uses the project's main Gemfile, and the current MRI Ruby release
15+
# - Matches what contributors and maintainers use locally for development
16+
# - Broken workflow indicates that a new contributor will have a bad time
17+
#
18+
name: Deps Locked
519

620
permissions:
721
contents: read
@@ -30,7 +44,7 @@ concurrency:
3044

3145
jobs:
3246
test:
33-
name: Tests default rake task with main Gemfile.lock ${{ matrix.name_extra || '' }}
47+
name: Default rake task w/ main Gemfile.lock ${{ matrix.name_extra || '' }}
3448
if: ${{ !contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]') }}
3549
runs-on: ubuntu-latest
3650
continue-on-error: ${{ matrix.experimental }}

.github/workflows/deps_unlocked.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
# Lock/Unlock Deps Pattern
3+
#
4+
# Two often conflicting goals resolved!
5+
#
6+
# - deps_unlocked.yml
7+
# - All runtime & dev dependencies, but does not have a `gemfiles/*.gemfile.lock` committed
8+
# - Uses an Appraisal2 "deps_unlocked" gemfile, and the current MRI Ruby release
9+
# - Know when new dependency releases will break local dev with unlocked dependencies
10+
# - Broken workflow indicates that new releases of dependencies may not work
11+
#
12+
# - deps_locked.yml
13+
# - All runtime & dev dependencies, and has a `Gemfile.lock` committed
14+
# - Uses the project's main Gemfile, and the current MRI Ruby release
15+
# - Matches what contributors and maintainers use locally for development
16+
# - Broken workflow indicates that a new contributor will have a bad time
17+
#
18+
name: Deps Unlocked
19+
20+
permissions:
21+
contents: read
22+
23+
env:
24+
K_SOUP_COV_DO: false
25+
26+
on:
27+
push:
28+
branches:
29+
- 'main'
30+
- "*-stable"
31+
tags:
32+
- '!*' # Do not execute on tags
33+
pull_request:
34+
branches:
35+
- '*'
36+
# Allow manually triggering the workflow.
37+
workflow_dispatch:
38+
39+
# Cancels all previous workflow runs for the same branch that have not yet completed.
40+
concurrency:
41+
# The concurrency group contains the workflow name and the branch name.
42+
group: "${{ github.workflow }}-${{ github.ref }}"
43+
cancel-in-progress: true
44+
45+
jobs:
46+
test:
47+
name: Default rake task w/ unlocked deps ${{ matrix.name_extra || '' }}
48+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
49+
runs-on: ubuntu-latest
50+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
51+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
52+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
53+
strategy:
54+
matrix:
55+
include:
56+
# Ruby <whichever version is current, e.g., 3.4 as of 2025-07-12>
57+
- ruby: "ruby"
58+
appraisal_name: "deps_unlocked"
59+
exec_cmd: "rake"
60+
gemfile: "Appraisal.root"
61+
rubygems: latest
62+
bundler: latest
63+
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
68+
- name: Setup Ruby & RubyGems
69+
uses: ruby/setup-ruby@v1
70+
with:
71+
ruby-version: ${{ matrix.ruby }}
72+
rubygems: ${{ matrix.rubygems }}
73+
bundler: ${{ matrix.bundler }}
74+
bundler-cache: false
75+
76+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
77+
# We need to do this first to get appraisal installed.
78+
# NOTE: This does not use the main Gemfile at all.
79+
- name: Install Root Appraisal
80+
run: bundle
81+
- name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal_name }}
82+
run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle
83+
- name: Run ${{ matrix.exec_cmd }} on ${{ matrix.ruby }}@${{ matrix.appraisal_name }}
84+
run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle exec ${{ matrix.exec_cmd }}

.rubocop_gradual.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"README.md:2730514579": [
2+
"README.md:3239175719": [
33
[201, 3, 100, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 3592044714]
44
],
55
"Rakefile:3407355619": [

Appraisals

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@
66
# bundle exec rake rubocop_gradual:autocorrect
77
# NOTE: Commands need to be run from the devcontainer if old Rails or old sqlite3 won't install for you locally.
88

9+
# Lock/Unlock Deps Pattern
10+
#
11+
# Two often conflicting goals resolved!
12+
#
13+
# - deps_unlocked.yml
14+
# - All runtime & dev dependencies, but does not have a `gemfiles/*.gemfile.lock` committed
15+
# - Uses an Appraisal2 "deps_unlocked" gemfile, and the current MRI Ruby release
16+
# - Know when new dependency releases will break local dev with unlocked dependencies
17+
# - Broken workflow indicates that new releases of dependencies may not work
18+
#
19+
# - deps_locked.yml
20+
# - All runtime & dev dependencies, and has a `Gemfile.lock` committed
21+
# - Uses the project's main Gemfile, and the current MRI Ruby release
22+
# - Matches what contributors and maintainers use locally for development
23+
# - Broken workflow indicates that a new contributor will have a bad time
24+
#
25+
appraise "deps_unlocked" do
26+
eval_gemfile("modular/audit.gemfile")
27+
eval_gemfile("modular/coverage.gemfile")
28+
eval_gemfile("modular/documentation.gemfile")
29+
eval_gemfile("modular/style.gemfile")
30+
eval_gemfile("modular/x_std_libs.gemfile")
31+
end
32+
933
# Used for HEAD (nightly) releases of ruby, truffleruby, and jruby.
1034
# Split into discrete appraisals if one of them needs a dependency locked discretely.
1135
appraise "dep-heads" do

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,33 @@ NOTE: Commands need to be run from the devcontainer if old Rails or old sqlite3
3838

3939
When adding an appraisal to CI, check the [runner tool cache][🏃‍♂️runner-tool-cache] to see which runner to use.
4040

41+
### We commit, and don't commit, our "gemfile.lock" files
42+
43+
Thanks to [Appraisal2](https://github.com/appraisal-rb/appraisal2) we have a `gemfiles/*.gemfile` suite
44+
in addition to the main `Gemfile` at the root of the project.
45+
We run a workflow against the main Gemfile, which has a `Gemfile.lock` committed, and
46+
we also run workflows against each of the Appraisal2 `gemfiles/*.gemfile` suite,
47+
which **do not** have `gemfiles/*.gemfile.lock` committed.
48+
49+
```
50+
# Lock/Unlock Deps Pattern
51+
#
52+
# Two often conflicting goals resolved!
53+
#
54+
# - deps_unlocked.yml
55+
# - All runtime & dev dependencies, but does not have a `gemfiles/*.gemfile.lock` committed
56+
# - Uses an Appraisal2 "deps_unlocked" gemfile, and the current MRI Ruby release
57+
# - Know when new dependency releases will break local dev with unlocked dependencies
58+
# - Broken workflow indicates that new releases of dependencies may not work
59+
#
60+
# - deps_locked.yml
61+
# - All runtime & dev dependencies, and has a `Gemfile.lock` committed
62+
# - Uses the project's main Gemfile, and the current MRI Ruby release
63+
# - Matches what contributors and maintainers use locally for development
64+
# - Broken workflow indicates that a new contributor will have a bad time
65+
#
66+
```
67+
4168
## The Reek List
4269

4370
Take a look at the `reek` list which is the file called `REEK` and find something to improve.

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
1111
gemspec
1212

1313
### Std Lib Extracted Gems
14-
eval_gemfile "gemfiles/modular/x_std_libs/r3/libs.gemfile"
14+
eval_gemfile "gemfiles/modular/x_std_libs.gemfile"
1515

1616
### Security Audit
1717
eval_gemfile "gemfiles/modular/audit.gemfile"

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# 🫵 OmniAuth::Identity
1414

15-
[![Version][👽versioni]][👽version] [![License: MIT][📄license-img]][📄license-ref] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![Open Source Helpers][👽oss-helpi]][👽oss-help] [![Depfu][🔑depfui♻️]][🔑depfu] [![Coveralls Test Coverage][🔑coveralls-img]][🔑coveralls] [![CodeCov Test Coverage][🔑codecovi♻️]][🔑codecov] [![QLTY Test Coverage][🔑qlty-covi]][🔑qlty-cov] [![QLTY Maintainability][🔑qlty-mnti]][🔑qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![CI Supported][🚎6-s-wfi]][🚎6-s-wf] [![CI Legacy][🚎4-lg-wfi]][🚎4-lg-wf] [![CI Unsupported][🚎7-us-wfi]][🚎7-us-wf] [![CI Ancient][🚎1-an-wfi]][🚎1-an-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![CI w/ committed Gemfile.lock][🚎13-k-wfi]][🚎13-k-wf]
15+
[![Version][👽versioni]][👽version] [![License: MIT][📄license-img]][📄license-ref] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![Open Source Helpers][👽oss-helpi]][👽oss-help] [![Depfu][🔑depfui♻️]][🔑depfu] [![Coveralls Test Coverage][🔑coveralls-img]][🔑coveralls] [![CodeCov Test Coverage][🔑codecovi♻️]][🔑codecov] [![QLTY Test Coverage][🔑qlty-covi]][🔑qlty-cov] [![QLTY Maintainability][🔑qlty-mnti]][🔑qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Supported][🚎6-s-wfi]][🚎6-s-wf] [![CI Legacy][🚎4-lg-wfi]][🚎4-lg-wf] [![CI Unsupported][🚎7-us-wfi]][🚎7-us-wf] [![CI Ancient][🚎1-an-wfi]][🚎1-an-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![CI w/ committed Gemfile.lock][🚎13-k-wfi]][🚎13-k-wf]
1616

1717
---
1818

@@ -566,8 +566,10 @@ P.S. If you need help️, or want to say thanks, 👇 Join the Discord.
566566
[🚎11-c-wfi]: https://github.com/omniauth/omniauth-identity/actions/workflows/current.yml/badge.svg
567567
[🚎12-crh-wf]: https://github.com/omniauth/omniauth-identity/actions/workflows/current-runtime-heads.yml
568568
[🚎12-crh-wfi]: https://github.com/omniauth/omniauth-identity/actions/workflows/current-runtime-heads.yml/badge.svg
569-
[🚎13-k-wf]: https://github.com/omniauth/omniauth-identity/actions/workflows/kitchen.yml
570-
[🚎13-k-wfi]: https://github.com/omniauth/omniauth-identity/actions/workflows/kitchen.yml/badge.svg
569+
[🚎13-🔒️-wf]: https://github.com/omniauth/omniauth-identity/actions/workflows/deps_locked.yml
570+
[🚎13-🔒️-wfi]: https://github.com/omniauth/omniauth-identity/actions/workflows/deps_locked.yml/badge.svg
571+
[🚎14-🔓️-wf]: https://github.com/omniauth/omniauth-identity/actions/workflows/deps_unlocked.yml
572+
[🚎14-🔓️-wfi]: https://github.com/omniauth/omniauth-identity/actions/workflows/deps_unlocked.yml/badge.svg
571573
[💎ruby-2.3i]: https://img.shields.io/badge/Ruby-2.3-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
572574
[💎ruby-2.4i]: https://img.shields.io/badge/Ruby-2.4-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
573575
[💎ruby-2.5i]: https://img.shields.io/badge/Ruby-2.5-DF00CA?style=for-the-badge&logo=ruby&logoColor=white

gemfiles/deps_unlocked.gemfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file was generated by Appraisal2
2+
3+
source "https://rubygems.org"
4+
5+
gemspec path: "../"
6+
7+
eval_gemfile("modular/audit.gemfile")
8+
9+
eval_gemfile("modular/coverage.gemfile")
10+
11+
eval_gemfile("modular/documentation.gemfile")
12+
13+
eval_gemfile("modular/style.gemfile")
14+
15+
eval_gemfile("modular/x_std_libs.gemfile")

gemfiles/modular/x_std_libs.gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### Std Lib Extracted Gems
2+
eval_gemfile "x_std_libs/r3/libs.gemfile"

0 commit comments

Comments
 (0)