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

Fixes #34432 - Remove drpm from ignorable_content for roots #9986

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

sjha4
Copy link
Member

@sjha4 sjha4 commented Feb 28, 2022

What are the changes introduced in this pull request?

Adds a migration to remove drpm from irgnorable_content list for root repositories.

Considerations taken when implementing this change?

What are the testing steps for this pull request?

How I tested this:

  1. Change katello/app/models/katello/root_repository.rb L20 to allow drpm as ignorable_content type:
    IGNORABLE_CONTENT_UNIT_TYPES = %w(srpm drpm).freeze
  2. Change katello/app/lib/actions/katello/repository/update.rb file L13 to add
    repo_params[:ignorable_content] = ['srpm', 'drpm']
  3. The changes above mean that any yum repo you update will get srpm and drpm as ignorable content. So update a couple yum repos, ex: name in your setup.
  4. Go to foreman console: bundle exec rails c
  5. Run Katello::RootRepository.select {|r| r&.ignorable_content&.include? "drpm"}
  6. You should see a few root repository with drpm in the ignorable content list
  7. Checkout this PR and run bundle exec rails db:migrate
  8. Check Katello::RootRepository.select {|r| r&.ignorable_content&.include? "drpm"}. You shouldn't have any records.

@theforeman-bot
Copy link

Issues: #34432

Copy link
Member

@rverdile rverdile left a comment

Choose a reason for hiding this comment

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

The migration forward works! Did you want it to be able to rollback? Or should it be irreversible? Right now if you rollback it doesn't do anything.

@sjha4
Copy link
Member Author

sjha4 commented Mar 1, 2022

I don't think there's any way to make this reversible cause once the migration is run, we have no way of knowing which repos had drpm in ignorable content during rollback.

@rverdile
Copy link
Member

rverdile commented Mar 1, 2022

Good point. Do you think it needs "IrreversibleMigration"?

@sjha4
Copy link
Member Author

sjha4 commented Mar 1, 2022

@rverdile : Updated.. 👍🏼

Copy link
Member

@rverdile rverdile left a comment

Choose a reason for hiding this comment

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

lgtm!

@sjha4 sjha4 merged commit 2859ec6 into Katello:master Mar 2, 2022
sbernhard pushed a commit to ATIX-AG/katello that referenced this pull request May 12, 2022
sbernhard pushed a commit to ATIX-AG/katello that referenced this pull request May 12, 2022
…O-4.1'

Fixes #34432 - Remove drpm from ignorable_content for roots (Katello#9986)

See merge request Engineering/orcharhino/dependencies/katello!69
Manisha15 pushed a commit to ATIX-AG/katello that referenced this pull request Jun 15, 2022
sbernhard pushed a commit to ATIX-AG/katello that referenced this pull request Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants