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 #35676 - Handle whitespace issue in Python package types #11298

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

pavanshekar
Copy link
Contributor

What are the changes introduced in this pull request?

Added handling to ensure that whitespace is removed from Python package types to prevent issues when creating a new repo.

Considerations taken when implementing this change?

Ensures consistency in handling Python package types while maintaining compatibility with the existing repo creation flow.

What are the testing steps for this pull request?

  1. Go to Products -> Create a new product
  2. Go to Repositories
  3. Click on New Repository
  4. Add all the required details by selecting the type as Python
  5. Select Save -> You should be able to create a new repository without any errors
  6. For verification: After creation, Select action -> Sync now - The sync task should be completed successfully and you should be able to see the synced data.

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.

Could you also remove the whitespace from help text here:

generic_remote_option :package_types, title: N_("Package Types"), type: Array, input_type: "text", delimiter: ",", default: [],
for people ctrl c +v ing and updating that list like me.

Another thing to fix is the update, where one can update the package type list to again contain whitespaces causing sync errors down the line. Add a similar logic for that. Bonus points for reusing the same strip logic for both methods.

@pavanshekar
Copy link
Contributor Author

I have made the suggested changes and pushed the updated code.

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.

Can create and update python repos with whitespaces in package types param. Ack 👍🏼

@sjha4 sjha4 merged commit 155aa5b into Katello:master Feb 5, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants