Skip to content
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

Refs #36706 - Remove remaining katello-agent code including Agent Events & Dynflow actions #10710

Merged
merged 7 commits into from
Aug 31, 2023

Conversation

jeremylenz
Copy link
Member

@jeremylenz jeremylenz commented Aug 28, 2023

What are the changes introduced in this pull request?

Remove remaining katello-agent code, including

  • katello-agent events from Event Daemon
  • katello-agent Dynflow actions
  • katello-agent Dispatcher and Dispatch Histories
  • miscellaneous stragglers

Considerations taken when implementing this change?

Probably not enough

This removes Agent Events, but the other two event types handled by the Event Daemon (Katello Events and Candlepin Events) should be unaffected.

What are the testing steps for this pull request?

Run migrations
Verify that tests pass and the remaining tests make sense
Verify that basic functionality still works, particularly incremental updates
Verify that Katello Events and Candlepin Events still work properly

@theforeman-bot
Copy link

Issues: #36706

@jeremylenz
Copy link
Member Author

jeremylenz commented Aug 28, 2023

This is currenly rebased on the PR that removes API endpoints; I'll rebase on master when that's in.

Comment on lines -146 to -151
# get package information for katello and its components
def packages
names = PACKAGES.join("|")
packages = `rpm -qa | egrep "#{names}"`
packages.split("\n").sort
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't see anywhere where this was used. 🤷

@@ -37,7 +37,6 @@ Gem::Specification.new do |gem|
gem.add_dependency "foreman_remote_execution", ">= 7.1.0"
gem.add_dependency "dynflow", ">= 1.6.1"
gem.add_dependency "activerecord-import"
gem.add_dependency "qpid_proton"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh hey, @Katello/packagers 😇

@jeremylenz jeremylenz changed the title 36706 face your daemons Refs #36706 - Remove remaining katello-agent code including Agent Events & Dynflow actions Aug 28, 2023
@jeremylenz jeremylenz marked this pull request as ready for review August 28, 2023 17:37
Copy link
Member

@jturel jturel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You got all the things I thought someone might miss like removing the DispatchHistory table and qpid gem. Nice!

@jeremylenz
Copy link
Member Author

rebased

@parthaa
Copy link
Contributor

parthaa commented Aug 29, 2023

@@ -358,11 +353,9 @@ def get_task_input(task)

def parse_errata(task)
task_input = get_task_input(task)
agent_input = task_input['errata'] || task_input['content']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if this should be agent_input = task_input['errata'] or may be below
@_tasks_errata_cache[task.id] ||= task_input['errata'].presence? || errata_ids_from_template_invocation(task, task_input)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, I'm remembering now that this is used in the Applied Errata report so that both katello-agent-applied and REX-applied errata are included in the report. So I restored this to the way it was (with improved comments.)

@jeremylenz
Copy link
Member Author

have you thought about removing this https://github.com/Katello/katello/blob/master/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb#L189

I'm a bit nervous about that one. Are we sure it's not also used by the subscription-manager plugin somewhere? It's in the rhsm_proxies_controller so it probably felt safer not to touch it. I could update the description..

I did do some spot checks just now, and I can't get sub-man to hit that endpoint (it doesn't with subscription-manager repos or subscription-manager repo-override) so maybe it is safe to remove.. thoughts?

@parthaa
Copy link
Contributor

parthaa commented Aug 30, 2023

I did do some spot checks just now, and I can't get sub-man to hit that endpoint (it doesn't with subscription-manager repos or subscription-manager repo-override) so maybe it is safe to remove.. thoughts?

On 2nd thoughts i think it is used by katello-host-tools.
https://github.com/Katello/katello-host-tools/blob/master/src/katello/repos.py#L31

So unless we are removing dnf upload, I say we leave this endpoint alone.

@jeremylenz
Copy link
Member Author

jeremylenz commented Aug 30, 2023

So unless we are removing dnf upload, I say we leave this endpoint alone.

Sounds good to me. In which case, is this good to go now? 😄

@parthaa
Copy link
Contributor

parthaa commented Aug 30, 2023

@jeremylenz
Copy link
Member Author

removed

@ehelms
Copy link
Member

ehelms commented Aug 31, 2023

I know you are already pretty far along, something to think about in the future for these kind of changes is to split them into two parts:

  1. Do the bare minimum to stop exposing whatever the feature is to users anymore
  2. Clean-up the code at some future date

This both can allow you to move faster by getting in the actual drop faster (as the code changes are much smaller, and less risky) and it can provide a fall-back mechanism for some amount of time if the change or timeline is risky.

I mentioned a similar thing here for the installer part as well -- theforeman/puppet-foreman_proxy_content#455 (comment)

@jeremylenz
Copy link
Member Author

jeremylenz commented Aug 31, 2023

split them into two parts:

  1. Do the bare minimum to stop exposing whatever the feature is to users anymore
  2. Clean-up the code at some future date

Makes sense! I would actually consider this PR the "clean-up at some future date," since all our API and UI changes in Katello are already merged. From most to least essential, I think about it like

  1. Installer / foreman-maintain - prevent users from having katello-agent enabled. And if we can't do that,
  2. remove from UI / API / CLI - (if this is all we can get in before release, it's not ideal but still workable)
  3. and then finally, remove all the rest of the unused code in Katello (this PR)
  4. remove unused miscellaneous stuff elsewhere (client tools, sosreport, etc.)

Copy link
Contributor

@parthaa parthaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK
Verified that incremental updates does the right thing and always tries remote execution.

@jeremylenz jeremylenz merged commit ea06f3d into Katello:master Aug 31, 2023
4 of 5 checks passed
chris1984 pushed a commit that referenced this pull request Sep 6, 2023
…nts & Dynflow actions (#10710)

* Refs #36706 - Remove agent events and actions

* Refs #36706 - Remove dispatch histories via migration

* Refs #36706 - fix tests

* Refs #36706 - remove katello-agent-notice

* Refs #36706 - use errata presence

* Refs #36706 - add back agent_input

* Refs #36706 - remove bastion reference and more stragglers

(cherry picked from commit ea06f3d)
chris1984 pushed a commit that referenced this pull request Sep 6, 2023
…nts & Dynflow actions (#10710)

* Refs #36706 - Remove agent events and actions

* Refs #36706 - Remove dispatch histories via migration

* Refs #36706 - fix tests

* Refs #36706 - remove katello-agent-notice

* Refs #36706 - use errata presence

* Refs #36706 - add back agent_input

* Refs #36706 - remove bastion reference and more stragglers

(cherry picked from commit ea06f3d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants