New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #29993 - Drop Puppetrun #7719
Conversation
Issues: #29993 |
Not looking at the code, I think the descriptions of this and the issue are way too minimal. As an upgrading user this is not very useful. Normally we try to give some background about the feature, why it's being removed and what the alternatives are. It's also good refer to discussion that has happened, like RFCs. Another thing to consider is that right now this feature hasn't been deprecated. Luckily we're still in the RC phase of 2.1 but at the very least the 2.1 manual needs a release note about this. |
app/controllers/concerns/foreman/controller/puppet/hosts_controller_extensions.rb
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd agree with Ewoud we should keep the API for few versions.
@domitea ? This would be nice to get in, what is the status here? :) |
fd3ea4e
to
2de6ae7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you decided to keep PUPPET_MULTIPLE_ACTIONS
?
I believe now it should be ==
to the MULTIPLE_EDIT_ACTIONS
and thus we can use that instead.
else | ||
super | ||
when 'puppetrun' | ||
:puppetrun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haven't we dropped the permission?
I believe we can prepend_before_action
and render there directly. Also, we can add deprecations for the apidocs
.
Take a look at https://github.com/theforeman/foreman/pull/7800/files#diff-36882131819ddf97a1e444b073996328R5
I believe we can do the same here and keep just empty puppetrun
method with the prepended filter, that will render the status.
2de6ae7
to
11c0610
Compare
This needs rebase |
11c0610
to
fb44eb6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few point just to make it bit more tidy.
Additionaly do we have at least a redmine ticket to remove the SmartProxy endpoint for this?
@@ -4,23 +4,23 @@ class PuppetHostsController < V2::BaseController | |||
include Api::Version2 | |||
include HostsControllerExtension | |||
|
|||
prepend_before_action :fail_and_inform_about_plugin | |||
|
|||
check_permissions_for ['puppetrun'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be dropped as well now :)
param :id, :identifier_dottable, :required => true | ||
|
||
def puppetrun | ||
return deny_access unless Setting[:puppetrun] | ||
process_response @host.puppetrun! | ||
end | ||
|
||
def action_permission |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to keep the method now, right?
@@ -4,23 +4,23 @@ class PuppetHostsController < V2::BaseController | |||
include Api::Version2 | |||
include HostsControllerExtension | |||
|
|||
prepend_before_action :fail_and_inform_about_plugin | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at this block: https://github.com/theforeman/foreman/pull/7800/files#diff-36882131819ddf97a1e444b073996328R7-R10
It would mark the resource as deprecated in /apidoc
. I think we can use it here as well.
I'm not sure if it wouldn't deprecate the enpoints added by HostsControllerExtensions
so it needs to get tested. I'd be ok if we do not have it if that turns out to be too much of strugle. If it works though, it adds visibility to the deprecation.
fb44eb6
to
6e5659c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[test katello] doesn't seem related, but it's quite a lot of failures |
[test katello] |
config/routes/puppet/api/v2.rb
Outdated
scope "(:apiv)", :module => :v2, :defaults => {:apiv => 'v2'}, :apiv => /v2/, :constraints => ApiConstraints.new(:version => 2, :default => true) do | ||
constraints(:id => /[^\/]+/) do | ||
resources :hosts, :except => [:new, :edit] do | ||
put :puppetrun, :on => :member, :to => 'puppet_hosts#puppetrun' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I've missed this.
This needs to stay, otherwise the deprecated API endpoint will not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please bring back the api endpoint file, otherwise the endpoint is good as dead (404) and noone will see the informative 501 error :)
6e5659c
to
b524fb9
Compare
@ezr-ondrej File returned, hope It's ready for merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to skip the endpoint from access_permissions_test
b524fb9
to
4154fbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me 👍
Thanks @domitea ! 👍 |
This needs to be reflected in the 2.2 and nightly manual. Section 3.5.2 still refers to the puppetrun setting. |
Coming from an over-time upgraded install, the migration (2.2.0) here fails with:
FTR, DB contents for this setting:
|
thanks! |
Removing puppetrun from core