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

Handle unapplied phased updates in testinfra checks #7420

Merged
merged 1 commit into from
Jan 28, 2025
Merged

Conversation

legoktm
Copy link
Member

@legoktm legoktm commented Jan 22, 2025

Status

Ready for review

Description of Changes

noble now has phased updates, in which the package repository will have pending updates, but they won't be applied yet. We need to look for a different message on noble to handle this change.

Fixes #7419.

Testing

How should the reviewer test this PR?

  • visual review
  • noble staging job passes

Deployment

Any special considerations for deployment? n/a

Checklist

@legoktm legoktm added the noble Ubuntu Noble related work label Jan 22, 2025
@legoktm legoktm added this to the SecureDrop 2.12.0 milestone Jan 22, 2025
@legoktm legoktm requested a review from a team as a code owner January 22, 2025 15:54
@legoktm
Copy link
Member Author

legoktm commented Jan 22, 2025

The noble job passed, but I had forgotten to pull develop first so the focal one failed. Anyways, rebased and marked as ready for review.

@legoktm
Copy link
Member Author

legoktm commented Jan 22, 2025

E + where 2 = CommandResult(command=b'dpkg -l deb.torproject.org-keyring', exit_status=2, stdout=None, stderr=b"dpkg-query: error: failed to open package info file '/var/lib/dpkg/updates/0000' for reading: No such file or directory\n").rc

that's a new flaky and unrelated failure. thankfully it happened in the focal job so it's irrelevant for this PR, but I'll retrigger it anyways.

Copy link
Member

@cfm cfm left a comment

Choose a reason for hiding this comment

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

This looks good, @legoktm, and CI is happy with it. However, I'm puzzled by the following result in local testing for my own edification:

user@sd:~$ docker run -it -e DEBIAN_FRONTEND=noninteractive ubuntu:noble bash -c "apt update && apt install unattended-upgrades --yes && unattended-upgrades --dry-run --debug" | tail -n 6
pkgs that look like they should be upgraded: 
Fetched 0 B in 0s (0 B/s)
fetch.run() result: 0
Packages blacklist due to conffile prompts: []
No packages found that can be upgraded unattended and no pending auto-removals
The list of kept packages can't be calculated in dry-run mode.

In other words, I'm running the command at —

c = host.run("sudo unattended-upgrades --dry-run --debug")

—explicitly under Noble, but I'm getting the Focal result at:

"No packages found that can be upgraded unattended and no pending auto-removals"

Is it worth refining the conditional you've added here? or are we happy with this working as expected in CI?

@legoktm
Copy link
Member Author

legoktm commented Jan 27, 2025

I suspect it's because there are currently no phased updates that affect the Docker container, so we get the original all good message.

Let me adjust the logic to check for that message first, and then fallback to our new string if it's missing.

noble now has phased updates, in which the package repository will have
pending updates, but they won't be applied yet. We need to look for a
different message on noble to handle this change.

Fixes #7419.
Copy link
Member

@cfm cfm left a comment

Choose a reason for hiding this comment

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

Thanks, @legoktm.

@cfm cfm added this pull request to the merge queue Jan 28, 2025
Merged via the queue into develop with commit e33a910 Jan 28, 2025
46 checks passed
@legoktm legoktm deleted the stg-noble-phased branch February 3, 2025 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
noble Ubuntu Noble related work
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

noble staging job is failing because of unattended-upgrades
2 participants