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 #36482 - Use string keys for accessing 'arch' and 'minor' in re… #10616

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

wbclark
Copy link
Contributor

@wbclark wbclark commented Jun 16, 2023

…po hash

@theforeman-bot
Copy link

Issues: #36482

Katello::Content.substitute_content_path(arch: repo[:arch],
releasever: repo[:minor],
Katello::Content.substitute_content_path(arch: repo['arch'],
releasever: repo['minor'],
content_path: content_path)
Copy link
Member

Choose a reason for hiding this comment

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

Can we do something like:
repo_hash = HashWithIndifferentAccess.new(repo) and then we won't have to worry about symbol or string key access?
Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I initially wanted this approach, but decided against it because I wasn't sure about performance characteristics in case results or repo is particularly large.

If you think it's fine, I'll happily make the change.

Copy link
Contributor

@parthaa parthaa Jun 20, 2023

Choose a reason for hiding this comment

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

I like @wbclark 's approach better. That is more because contents of the repo results themselves are not returned. We are instead returning a list of string paths
Only thing I 'd suggest adding is a Unit test.

@sjha4 sjha4 self-assigned this Jun 16, 2023
@sjha4
Copy link
Member

sjha4 commented Jun 20, 2023

Able to enable upstream repos with substitutions now.
After_PR

Test based Ack 👍🏼

@wbclark
Copy link
Contributor Author

wbclark commented Jun 20, 2023

Let's give this a shot...

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 pending rubocop

@wbclark wbclark force-pushed the 36482_cdn_hash_key_symbols branch from f1f7f58 to 5c11c02 Compare June 20, 2023 18:21
@wbclark wbclark merged commit 03e1186 into Katello:master Jun 21, 2023
4 checks passed
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.

4 participants