-
Notifications
You must be signed in to change notification settings - Fork 75
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
Apt pinned packages #3297
Apt pinned packages #3297
Conversation
PR ChecklistHow to use this checklistHow to use this checklistPR AuthorFor each section, check a box when it is true. PR ReviewerCheck that the PR checklist action did not fail. Bug ReferencesConfirm
How to properly reference fixed bugs
Test UpdatesUnit Tests
Integration Tests
Documentation
Does this PR require review from someone outside the core ubuntu-pro-client team?
|
7ba01f5
to
20a23de
Compare
2773ad8
to
032d973
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.
@dheyay @renanrodrigo do you think we could come up with an integration test for this ?
032d973
to
c909222
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.
As part of our process to get ready for v35, I have rebased next-v35
onto main
. As a result, next-v35
is now obsolete. Please rebase this on main
and target the PR to main
.
0c40fe1
to
c909222
Compare
c909222
to
0c40fe1
Compare
uaclient/security_status.py
Outdated
if is_candidate | ||
else UpdateStatus.AVAILABLE_NOT_PREFERRED.value | ||
) | ||
if ua_info["attached"] and service_name in ua_info["enabled_services"]: |
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.
Is there a particular reason to apply the logic only to the archive, but not to possible underpreferred ESM versions?
I mean, even if those are not a planned thing, they may happen and the criteria is the same - anything available but not a candidate should be in the new state
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.
Updated this as per standup discussion 😄
Writing the integration test would be hard (as you probably figured out by now) because the situation where we have unpreferred updates is (or should be) temporary (see the issue - the package which triggered it is fixed already). Either we fake it all (no reason to have an integration test then, just the unit test will do) or we reason about it and move on. In the second case, I would still go for a manual test, even if i involves manipulating apt caches, just to make sure. |
0c40fe1
to
769cf09
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.
Thanks this looks good! Approval except for below:
From the checklist:
- No documentation updates are necessary for this change
This introduces a new enum value, which must at least be described here: https://canonical-ubuntu-pro-client.readthedocs-hosted.com/en/latest/explanations/how_to_interpret_the_security_status_command/#u-pro-packages-updates-v1
uaclient/security_status.py
Outdated
def _is_candidate_version(pkg: str, version: str) -> bool: | ||
"""Returns True if the package version is a candidate version.""" | ||
candidate_version = get_pkg_candidate_version(pkg, check_esm_cache=False) | ||
print(pkg, " ", version, " ", candidate_version) |
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.
print(pkg, " ", version, " ", candidate_version) |
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.
Fixed and created #3328
769cf09
to
793c3e1
Compare
793c3e1
to
ea9122a
Compare
Why is this needed?
Fix for #3184
Documentation update PR: #3328
Test Steps