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 #36477 - Correctly imports repos with arch restrictions #10598

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

parthaa
Copy link
Contributor

@parthaa parthaa commented Jun 9, 2023

Red Hat repositories incorrectly allow users to set architecture restrictions on the repo details page. This causes issues when exporting and importing these repositories due to the way enablement worked.

What are the changes introduced in this pull request?

Initially we went the route of no allowing user to update arch information on a redhat repo. Which would imply that the they'd need to run an upgrade task to correct stuff.

This PR allows for exports and imports for the wrong arch via being smart on enablement.

Considerations taken when implementing this change?

Originally thought of adding some complexity in the behavior by adding a original arch substitutions key to the export metadata.json.

But instead decided to go with the simpler "Enable Repo and then override the arch to what comes from the metadata json" approach

What are the testing steps for this pull request?

Before you check out the PR

  • Enable a couple of redhat repos (suggest something you can quickly sync.)
  • Change their architectures
  • Set the download policy to immediate
  • Sync them
  • Export that repo and try to import it in a new org
  • You should see the task completing successfully but the imported repo has zero content.

After checking out the PR

  • Go to the repo details of one of the redhat repos
  • Finally reimport the content in a new org
  • Verify that the content appears correctly.

@theforeman-bot
Copy link

Issues: #36477

@parthaa
Copy link
Contributor Author

parthaa commented Jun 14, 2023

Discussed with @sjha4 . Going to remove the imports part of this PR since the import errors won't show up if the arches were correct in the original repository in the first place.

Copy link
Member

@sjha4 sjha4 left a comment

Choose a reason for hiding this comment

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

Tested different workflows like complete, incremental and syncable import/export with arch changed in the eport org. Was able to successfully import with this PR.

Code looks good 👍🏼
Ack ✔️

@parthaa parthaa merged commit 79ad3ad into Katello:master Jun 29, 2023
5 checks passed
@parthaa parthaa deleted the handle-subs branch June 29, 2023 19:34
wbclark pushed a commit to wbclark/katello that referenced this pull request Jul 20, 2023
wbclark pushed a commit to wbclark/katello that referenced this pull request Jul 21, 2023
wbclark pushed a commit that referenced this pull request Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants