-
Notifications
You must be signed in to change notification settings - Fork 297
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 #33525 - Add debs packages_restrict_latest #9671
base: master
Are you sure you want to change the base?
Conversation
Issues: #33525 |
93a1677
to
62a5c67
Compare
a6fe79d
to
9875519
Compare
9875519
to
6835c26
Compare
6835c26
to
91d6332
Compare
Can you add some benchmark values here? https://ruby-doc.org/stdlib-2.5.3/libdoc/benchmark/rdoc/Benchmark.html How can we get this fast? |
91d6332
to
1142695
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack from the logic point of view
return relation.joins( | ||
"LEFT OUTER JOIN(#{relation.to_sql}) AS katello_debs2 ON " \ | ||
'katello_debs.name = katello_debs2.name AND katello_debs.architecture = katello_debs2.architecture AND ' \ | ||
'deb_version_cmp(katello_debs.version, katello_debs2.version) < 0 ' \ | ||
).where('katello_debs2.id IS NULL') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capturing things we talked about live: If I were doing this I'd probably drop the explicit return and used a squiggly heredoc, but that's just personal preference so feel free to ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since most of the code was shamelessly copied over from app/models/katello/rpm.rb, I would keep it that way for being consistent.
Eventually, we should think about enforcing a certain style through rubocop. AFAIK Katello's rubocop rules are currently pretty flexible.
1142695
to
3207034
Compare
This should implement the
packages_restrict_latest
parameter, but I am not sure I really want to have this merged, because it does not scale well at all.This originates in the way we compare debian versions and the fact that we have to compare them and are not able to simply sort them.
Maybe some kind of restriction to a max number of packages is in order for this to be usable.