theforeman / puppetdb_foreman

PuppetDB proxy in Foreman
http://theforeman.org
GNU General Public License v3.0
32 stars 23 forks source link

Drop PuppetDB API v1 & v3 #71

Closed ekohl closed 1 year ago

ekohl commented 2 years ago

Puppet 6 & 7 only support v4 and older version are EOL.

ehelms commented 2 years ago

I don't know if the original maintainers are as active on this repository -- should we merge and handle the release @ekohl ?

ekohl commented 2 years ago

I was looking at this and found some more things. However, I need to check them. My plan is to build a new dev env and verify it. Then also mark this plugin as "looking for maintainer".

ekohl commented 2 years ago

This is now much larger. I included a rewrite to the settings DSL since the old style is deprecated. I'll have to see about setting up a test env to verify this.

@ezr-ondrej would you mind taking a look if this approach makes sense?

ekohl commented 2 years ago

@ezr-ondrej while I have your attention, do you know what the best solution for the Rubocop fixes is? I'm mostly wondering because they come from theforeman-rubocop (which probably still needs a new owner):

/home/jenkins/workspace/puppetdb_foreman-pull-request/database/postgresql/label/fast/ruby/2.7/plugin/app/models/concerns/orchestration/puppetdb.rb:26:51: C: Style/FormatStringToken: Prefer annotated tokens (like %<foo>s) over template tokens (like %{foo}).
      failure format(_("Failed to deactivate node %{name} in PuppetDB: %{message}\n "), name: name, message: e.message), e
                                                  ^^^^^^^
/home/jenkins/workspace/puppetdb_foreman-pull-request/database/postgresql/label/fast/ruby/2.7/plugin/app/models/concerns/orchestration/puppetdb.rb:26:72: C: Style/FormatStringToken: Prefer annotated tokens (like %<foo>s) over template tokens (like %{foo}).
      failure format(_("Failed to deactivate node %{name} in PuppetDB: %{message}\n "), name: name, message: e.message), e
                                                                       ^^^^^^^^^^

Looking at the Foreman code it is mostly using _('...') % {} rather than format(). Should this be doing the same?

/home/jenkins/workspace/puppetdb_foreman-pull-request/database/postgresql/label/fast/ruby/2.7/plugin/app/services/puppetdb_host.rb:14:10: C: Rails/SkipsModelValidations: Avoid using update_attribute because it skips validations.
    host.update_attribute(environment: environment) if environment

I'm not sure what the best solution is here. Simply skip it for now?

ezr-ondrej commented 2 years ago

I'm not sure what the best solution is here. Simply skip it for now?

Yeah, I'd go with a skip :)

For foreman-puppet I went with format as it is prefered way to go in modern Ruby it seems and I'd like if Rubocop does that for us (shift us towards the new standards) but only if it doesnt hurt I'd say :)

adriangalbincea commented 2 years ago

hey, I noticed that if I upgrade my foreman from 2.1.4 to 2.2, despite the Foreman will have the hosts and puppet agent will sync fine, my Icinga collector will stop working. Is this related to new foreman compatibility?

janfickler commented 1 year ago

can this PR pushed forward please ? ... foreman 3.4 is not working anymore if the plugin is installed without a fix. So many users seems to be affected.

so also - https://community.theforeman.org/t/foreman-3-4-stable-unknown-attribute-description-for-setting-foremanhostextravalidator/30333/19

ekohl commented 1 year ago

Thanks to @kamils-iRonin #74 was merged. I'll rebase this.

ekohl commented 1 year ago

Reduced to just dropping PuppetDB API v1 & v3 support.

timogoebel commented 1 year ago

Thanks a bunch!