manageiq icon indicating copy to clipboard operation
manageiq copied to clipboard

[WIP] Allow updating all plugins when building the lockfile

Open Fryguy opened this issue 2 years ago • 10 comments

The lockfile generator is very conservative and doesn't update the lockfile refs for git repos (i.e. plugins). As such, when gem updates happen in plugins, they aren't automatically pulled into the lockfile. This new option allows me to see which specific plugins are making changes. I can then choose to just update them all, or pick and choose.

@bdunne Please review.

Fryguy avatar Sep 28 '23 20:09 Fryguy

I've also considered pushing does that weird repo path scanning logic into Vmdb::Plugins - if that's preferable, let me know. I only didn't do it because I couldn't decide on the key/method name.

────────────────────────────────────────────────────────
modified: lib/tasks/release.rake
────────────────────────────────────────────────────────
@ lib/tasks/release.rake:190 @ namespace :release do
     update_gems = ENV["UPDATE_GEMS"].to_s.split(" ")
     if ENV["UPDATE_PLUGINS"]
       require "vmdb/plugins"
-      update_gems += Vmdb::Plugins.paths.values.map { |p| p.match(%r{/gems/(.+)-\h+$}).captures.first }
+      update_gems += Vmdb::Plugins.repos.values
     end

     root = Pathname.new(__dir__).join("../..")
────────────────────────────────────────────────────────
modified: lib/vmdb/plugins.rb
────────────────────────────────────────────────────────
@ lib/vmdb/plugins.rb:37 @ def details
         hash[engine] = {
           :name    => engine.name,
           :version => version(engine),
-          :path    => engine.root.to_s
+          :path    => engine.root.to_s,
+          :repo    => engine.root.to_s.match(%r{/gems/(.+)-\h+$}).captures.first
         }
       end
     end
@ lib/vmdb/plugins.rb:51 @ def versions
       details.transform_values { |v| v[:version] }
     end

+    def repos
+      details.transform_values { |v| v[:repo] }
+    end
+
     # Ansible content (roles) that come out-of-the-box, for use by both Automate
     #   and ansible-runner
     def ansible_content

Fryguy avatar Sep 28 '23 20:09 Fryguy

Checked commits https://github.com/Fryguy/manageiq/compare/c30ce7038ea0e244709fc9b2579a4c7394dcc6ec~...b58e15698e1400a4fdde416742a61fa181c3965f with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint 2 files checked, 0 offenses detected Everything looks fine. :+1:

miq-bot avatar Sep 29 '23 22:09 miq-bot

Moved to WIP because when you are running from a plug-in the path is your local dev path. Need to handle that case and be more defensive here in general.

Fryguy avatar Sep 29 '23 22:09 Fryguy

This pull request is not mergeable. Please rebase and repush.

miq-bot avatar Nov 06 '23 17:11 miq-bot

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

miq-bot avatar Feb 19 '24 00:02 miq-bot

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

miq-bot avatar May 20 '24 00:05 miq-bot