From 643cb2c520ffd27301afed3260497b281ad541d4 Mon Sep 17 00:00:00 2001 From: Chris Lowder Date: Fri, 10 Mar 2023 19:27:01 +0000 Subject: [PATCH 1/2] Include edge Rails in the build matrix Highlighting an incompatibility with the new implementation of `[ActiveSupport::OrderedOptions#dig]`. [^1]: https://github.com/rails/rails/commit/5c15b586aab85fc4fa1465499fc9a97a446f4d52 --- .github/workflows/ci.yml | 7 +++++-- .gitignore | 3 ++- Gemfile | 4 ---- gemfiles/rails_edge.gemfile | 9 +++++++++ mrsk.gemspec | 4 ++++ 5 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 gemfiles/rails_edge.gemfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fe7363e..1d9d2008 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,12 +8,15 @@ jobs: - "2.7" - "3.1" - "3.2" + gemfile: + - Gemfile + - gemfiles/rails_edge.gemfile continue-on-error: [false] - name: ${{ format('Tests (Ruby {0})', matrix.ruby-version) }} runs-on: ubuntu-latest continue-on-error: ${{ matrix.continue-on-error }} - + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }} steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 1e13116a..6100dc73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .byebug_history *.gem coverage/* -.DS_Store \ No newline at end of file +.DS_Store +gemfiles/*.lock diff --git a/Gemfile b/Gemfile index 9c31a8f8..f015da37 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,3 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } gemspec - -gem "debug" -gem "mocha" -gem "railties" diff --git a/gemfiles/rails_edge.gemfile b/gemfiles/rails_edge.gemfile new file mode 100644 index 00000000..34a16801 --- /dev/null +++ b/gemfiles/rails_edge.gemfile @@ -0,0 +1,9 @@ +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +git "https://github.com/rails/rails.git" do + gem "railties" + gem "activesupport" +end + +gemspec path: "../" diff --git a/mrsk.gemspec b/mrsk.gemspec index 6cd77252..d359aa28 100644 --- a/mrsk.gemspec +++ b/mrsk.gemspec @@ -19,4 +19,8 @@ Gem::Specification.new do |spec| spec.add_dependency "zeitwerk", "~> 2.5" spec.add_dependency "ed25519", "~> 1.2" spec.add_dependency "bcrypt_pbkdf", "~> 1.0" + + spec.add_development_dependency "debug" + spec.add_development_dependency "mocha" + spec.add_development_dependency "railties" end From 41a5cb2a04adb7f55d227a9c556bba053faac937 Mon Sep 17 00:00:00 2001 From: Chris Lowder Date: Fri, 10 Mar 2023 19:27:53 +0000 Subject: [PATCH 2/2] Avoid `[ActiveSupport::OrderedOptions#dig]` The implementation has been updated upstream[^1] to expect symbolized keys. MRSK relies heavily on the fact that nested keys are strings, so we're removing existing uses of `#dig`. [^1]: https://github.com/rails/rails/commit/5c15b586aab85fc4fa1465499fc9a97a446f4d52 --- lib/mrsk/commands/traefik.rb | 4 ++-- lib/mrsk/configuration.rb | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/mrsk/commands/traefik.rb b/lib/mrsk/commands/traefik.rb index ee22e64b..67ab448a 100644 --- a/lib/mrsk/commands/traefik.rb +++ b/lib/mrsk/commands/traefik.rb @@ -55,7 +55,7 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base private def cmd_option_args - if args = config.raw_config.dig(:traefik, "args") + if args = config.traefik["args"] optionize args else [] @@ -63,6 +63,6 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base end def host_port - config.raw_config.dig(:traefik, "host_port") || CONTAINER_PORT + config.traefik["host_port"] || CONTAINER_PORT end end diff --git a/lib/mrsk/configuration.rb b/lib/mrsk/configuration.rb index 64c116a2..03413116 100644 --- a/lib/mrsk/configuration.rb +++ b/lib/mrsk/configuration.rb @@ -165,6 +165,9 @@ class Mrsk::Configuration }.compact end + def traefik + raw_config.traefik || {} + end private # Will raise ArgumentError if any required config keys are missing