Skip to content

Commit

Permalink
Fix/add missing settings migration (#112)
Browse files Browse the repository at this point in the history
* fix(migration): add missing settings category migration

* fix(bundler): pin version to support used ruby version

* fix(tests): Update dependent plugins and add fix for failing minitest

* feat(tests): Add foreman >= 3.5 versions to test matrix
  • Loading branch information
laugmanuel authored Feb 2, 2024
1 parent 1274da3 commit d1e1ca7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 9 deletions.
48 changes: 39 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ jobs:
strategy:
fail-fast: false
matrix:
foreman-core-branch: [3.1-stable, 3.2-stable, 3.3-stable, 3.4-stable, develop]
foreman-core-branch:
- 3.1-stable
- 3.2-stable
- 3.3-stable
- 3.4-stable
- 3.5-stable
- 3.6-stable
- 3.7-stable
- 3.8-stable
- 3.9-stable
- develop
ruby-version: [2.7]
node-version: [14]
include:
Expand All @@ -26,14 +36,29 @@ jobs:
foreman-puppet-version: 3.0.7
foreman-tasks-version: 6.0.3
- foreman-core-branch: 3.3-stable
foreman-puppet-version: 4.0.3
foreman-tasks-version: 7.0.0
foreman-puppet-version: 4.0.4
foreman-tasks-version: 7.2.1
- foreman-core-branch: 3.4-stable
foreman-puppet-version: 4.0.3
foreman-tasks-version: 7.0.0
foreman-puppet-version: 4.1.1
foreman-tasks-version: 7.2.1
- foreman-core-branch: 3.5-stable
foreman-puppet-version: 5.1.3
foreman-tasks-version: 7.2.1
- foreman-core-branch: 3.6-stable
foreman-puppet-version: 5.1.3
foreman-tasks-version: 7.2.1
- foreman-core-branch: 3.7-stable
foreman-puppet-version: 6.2.0
foreman-tasks-version: 8.3.3
- foreman-core-branch: 3.8-stable
foreman-puppet-version: 6.2.0
foreman-tasks-version: 8.3.3
- foreman-core-branch: 3.9-stable
foreman-puppet-version: 6.2.0
foreman-tasks-version: 9.0.2
- foreman-core-branch: develop
foreman-puppet-version: 4.0.3
foreman-tasks-version: 7.0.0
foreman-puppet-version: 6.2.0
foreman-tasks-version: 9.0.2
steps:
- name: Install dependencies
run: |
Expand All @@ -60,6 +85,11 @@ jobs:
git cherry-pick -n a439e1e92e9f98f3dbc8ed2f204bd53cc861565e # pin rack-test to < 2.0 (see https://github.com/theforeman/foreman/pull/9288)
git cherry-pick -n c3c697fa131aa54c11918bcc563a7789f3c08ef7 # drop rack-test and bump show_me_the_cookies to ~ 6.0 (see https://github.com/theforeman/foreman/pull/9353)
working-directory: foreman
- name: Apply patches for Foreman >= 3.2 and <= 3.7
if: ${{ contains(fromJson('["3.2-stable", "3.3-stable", "3.4-stable", "3.5-stable", "3.6-stable", "3.7-stable"]'), matrix.foreman-core-branch) }}
run: |
git cherry-pick -n 1c3a4155f286352e0abbf0d0b298e47e81c2d6c5 # Pin minitest < 5.19 to resolve test failures (see https://github.com/theforeman/foreman/pull/9781)
working-directory: foreman
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -68,7 +98,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node-version }}
- name: Add foreman_puppet
working-directory: foreman
run: echo "gem 'foreman_puppet', '~> ${{ matrix.foreman-puppet-version }}'" > bundler.d/foreman_puppet.local.rb
Expand All @@ -79,7 +109,7 @@ jobs:
working-directory: foreman
run: |
echo "gem 'foreman_wreckingball', path: '../foreman_wreckingball'" > bundler.d/foreman_wreckingball.local.rb
gem install bundler
gem install bundler -v 2.4.22
bundle config path vendor/bundle
bundle config set without journald development console mysql2 sqlite
bundle lock --update
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

class FixWreckingballSettingsCategoryToDsl < ActiveRecord::Migration[6.0]
class MigrationSettings < ActiveRecord::Base
self.table_name = :settings
end

def up
MigrationSettings.where(category: 'Setting::Wreckingball').update_all(category: 'Setting') if column_exists?(:settings, :category)
end
end

0 comments on commit d1e1ca7

Please sign in to comment.