From 8cc4e19393f31be308f0f58408167f0a28aaab51 Mon Sep 17 00:00:00 2001 From: Leos Stejskal Date: Tue, 6 Feb 2024 10:34:50 +0100 Subject: [PATCH 1/3] Remove deprecated webpacked_plugins* methods --- app/views/discovered_hosts/welcome.html.erb | 7 ------- app/views/discovery_rules/welcome.html.erb | 7 ------- 2 files changed, 14 deletions(-) diff --git a/app/views/discovered_hosts/welcome.html.erb b/app/views/discovered_hosts/welcome.html.erb index a31c0bb8..e9468ec5 100644 --- a/app/views/discovered_hosts/welcome.html.erb +++ b/app/views/discovered_hosts/welcome.html.erb @@ -1,10 +1,3 @@ -<% content_for(:javascripts) do %> - <%= webpacked_plugins_js_for :'foreman_discovery' %> -<% end %> -<% content_for(:stylesheets) do %> - <%= webpacked_plugins_css_for :'foreman_discovery' %> -<% end %> - <% content_for(:title, _("Discovered Hosts")) %> <% content_for(:content) do %> diff --git a/app/views/discovery_rules/welcome.html.erb b/app/views/discovery_rules/welcome.html.erb index c085f50f..d7c1d7b8 100644 --- a/app/views/discovery_rules/welcome.html.erb +++ b/app/views/discovery_rules/welcome.html.erb @@ -1,10 +1,3 @@ -<% content_for(:javascripts) do %> - <%= webpacked_plugins_js_for :'foreman_discovery' %> -<% end %> -<% content_for(:stylesheets) do %> - <%= webpacked_plugins_css_for :'foreman_discovery' %> -<% end %> - <% content_for(:title, _("Discovered Rules")) %> <% content_for(:content) do %> From 5e64c829c3a24b30fcb1c877a3208ee95304a35f Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Mon, 12 Feb 2024 10:39:44 +0100 Subject: [PATCH 2/3] Move to inline settings validations This makes it clearer how the setting is exactly defined. As a bonus, this syntax is compatible with both Ruby 2 and 3. --- lib/foreman_discovery/engine.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/foreman_discovery/engine.rb b/lib/foreman_discovery/engine.rb index 0326130f..d44b02cf 100644 --- a/lib/foreman_discovery/engine.rb +++ b/lib/foreman_discovery/engine.rb @@ -75,11 +75,10 @@ class Engine < ::Rails::Engine setting "discovery_hostname", type: :array, default: ["discovery_bootif"], + validate: { presence: true }, full_name: N_("Hostname facts"), description: N_("List of facts to use for the hostname (first wins)") - validates "discovery_hostname", presence: true - setting "discovery_auto", type: :boolean, default: false, @@ -95,11 +94,10 @@ class Engine < ::Rails::Engine setting "discovery_prefix", type: :string, default: "mac", + validate: { presence: true }, full_name: N_("Hostname prefix"), description: N_("The default prefix to use for the host name, must start with a letter") - validates "discovery_prefix", presence: true - setting "discovery_fact_column", type: :array, default: [], From 215d57425e26416f7f9420ddaa75ec2c31ee8e5f Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Mon, 12 Feb 2024 14:31:45 +0100 Subject: [PATCH 3/3] Strip trailing whitespace --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 86a8b2a9..d805e4b5 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -12,7 +12,7 @@ jobs: uses: theforeman/actions/.github/workflows/rubocop.yml@v0 with: command: bundle exec rubocop --parallel --format github - + test: name: Ruby needs: rubocop