Fixes #39520 - Remove deprecated compute_resource endpoints#11090
Fixes #39520 - Remove deprecated compute_resource endpoints#11090nadjaheitmann wants to merge 1 commit into
Conversation
|
Thanks @chris1984 for approving. Any thoughts about removing the deprecation altogether? Maybe @ofedoren or @adamruzicka ? |
ofedoren
left a comment
There was a problem hiding this comment.
Thanks, @nadjaheitmann :) There are even more typos :/
Well, if it was there for that amount of time and it's about dropping just a parameter instead of a whole endpoint, I personally don't mind :) Although, the deprecation warning itself was not quite correct, so 🤷
Also, if we're going to remove that, I'd like to ensure we're covered in other related places, such as hammer (does it use the suggested endpoint or still requires the param to be present) and maybe foreman ansible modules since they are built on top of API as well.
And a small OCD nitpick: please don't use Refs on something ancient :D It's better to create a separate ticket, especially if we're going to drop the deprecated stuff.
| def available_storage_domains | ||
| if params[:storage_domain] | ||
| Foreman::Deprecation.api_deprecation_warning("use /compute_resources/:id/storage_domain/:storage_domain_id endpoind instead") | ||
| Foreman::Deprecation.api_deprecation_warning("use /compute_resources/:id/storage_domain/:storage_domain_id endpoint instead") |
There was a problem hiding this comment.
| Foreman::Deprecation.api_deprecation_warning("use /compute_resources/:id/storage_domain/:storage_domain_id endpoint instead") | |
| Foreman::Deprecation.api_deprecation_warning("use /compute_resources/:id/storage_domains/:storage_domain_id endpoint instead") |
| def available_storage_pods | ||
| if params[:storage_pod] | ||
| Foreman::Deprecation.api_deprecation_warning("use /compute_resources/:id/storage_pod/:storage_pod_id endpoind instead") | ||
| Foreman::Deprecation.api_deprecation_warning("use /compute_resources/:id/storage_pod/:storage_pod_id endpoint instead") |
There was a problem hiding this comment.
| Foreman::Deprecation.api_deprecation_warning("use /compute_resources/:id/storage_pod/:storage_pod_id endpoint instead") | |
| Foreman::Deprecation.api_deprecation_warning("use /compute_resources/:id/storage_pods/:storage_pod_id endpoint instead") |
Thanks for finding them 🙈
I agree.
Personally, I think it looks weird but ok for the typo fix. If we want to drop the endpoint, we should for sure create a new ticket 👍 |
|
@ofedoren @adamruzicka So what do you suggest to do? Merge the typo fix with @ofedoren s suggestion or go ahead and directly remove the deprecated parameter. I have opened an issue for it: https://projects.theforeman.org/issues/39520 |
|
The deprecation warning was there for ~7 years and we have a major version coming up, I'd be tempted to drop it completely. |
Same here. Let me adjust the PR then. |
f4cc710 to
1184e4f
Compare
1184e4f to
63f3932
Compare
ofedoren
left a comment
There was a problem hiding this comment.
Thanks, @nadjaheitmann, but here's your open can of worms :D
Since it's full removal, should we also remove the routes?
- https://github.com/theforeman/foreman/blob/develop/config/routes/api/v2.rb#L263
- https://github.com/theforeman/foreman/blob/develop/config/routes/api/v2.rb#L267
Also, I'm afraid there is a bit problem with the hammer counterpart: there is no command covering the suggested endpoints, so by removing the deprecated stuff here, we can't use alternative within hammer :/ Looking at the how it was written, we probably won't be able to make the changes "silently": we would either need to add a new specific command or maybe try to preserve the option, but use the new endpoint if it's used (an internal mess, but shouldn't break any automation).
No idea about FAM part though.
And it'll probably require a release note.
63f3932 to
41335ad
Compare
|
Thanks @ofedoren !
Well, I don't like worms, so let's clean them up :D
Yes, I adjusted the files.
I agree that would be messy, but it's a good idea to preserve the hammer endpoint I guess.
From what I can see, it might not affect FAM (https://docs.ansible.com/projects/ansible/latest/collections/theforeman/foreman/compute_resource_module.html#ansible-collections-theforeman-foreman-compute-resource-module), but I am no expert here, either, so please someone double-check. Maybe @evgeni ? Do you mind checking if removing this endpoint has an impact on FAM?
Yes, for sure. If we want to be nice, we can even announce it before the release such than community can prepare (I know that they had 7 years to prepare, but.... ) |
|
Nice worms you have here, would be a shame if I offered you more, huh? Just kiddin', we do use the Burn them with fire! And glitter! |
Those endpoints were deprecated in theforeman#6442 (which was in January 2019).
41335ad to
fa59eca
Compare
Just had a look at hammer. Which option are we talking about exactly? I found those two:
|
Those that are being removed: By removing those, hammer should no longer have these options, thus can't construct the call to the removed endpoint (which is expected). But since there are no longer options nor endpoint, hammer lost some functionality (even if it was weird to use like this) and has no replacement (yet). Given that I have no idea about actual usage of this endpoint through hammer, I'd be paranoid with the removal until there is an alternative present in hammer (or at least those options being added explicitly instead of being generated from API docs and pointed to construct the new route). Regarding on how to approach this: no strong opinion. Surely it would be nice to just change internals, so the users wouldn't feel a thing, but on the other hand we could provide something new and be explicit about that in release notes and/or upgrade warnings. |
|
I had a short look but I could not figure out how to preserve the option for |
I stumbled across that typo and actually was wondering if it is not time to remove that whole depreciation warning altogether :)
I don't see the parameter in there and the warning has been around since 2019!