canonical / ubuntu-pro-client

Ubuntu Pro Client for offerings from Canonical
https://canonical-ubuntu-pro-client.readthedocs-hosted.com/en/latest/
GNU General Public License v3.0
52 stars 73 forks source link

Ignore corrupt jobs-state.json file #3292

Closed renanrodrigo closed 3 weeks ago

renanrodrigo commented 4 weeks ago

Why is this needed?

This PR solves all of our problems because we now ignore invalid jobs-state.json files if they are corrupted and cannot be decoded, avoiding the oops which stopped phasing on noble (see LP bug)

LP: #2078737

Test Steps

Unit tests cover behavior for the functionality:


github-actions[bot] commented 4 weeks ago

PR Checklist

How to use this checklist ### How to use this checklist #### PR Author For each section, check a box when it is true. Uncheck a box if it becomes un-true. Then check the box at the bottom of the PR description to re-run the action that creates this checklist. The action that creates and updates this comment will retain your edits. The action will fail if the checklist is not completed. #### PR Reviewer Check that the PR checklist action did not fail. Double check that the author filled out the checklist accurately. If you disagree with a checklist item, start a conversation. For example, the author may say they don't think integration tests are necessary, but you may disagree.
### Bug References - Launchpad: [#2078737](https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/2078737) #### Confirm - [x] I've properly referenced all bugs that this PR fixes
How to properly reference fixed bugs * If this PR is related to a Jira item, include an `SC-1234` reference in the PR title * If this PR is fixes a GitHub issue, include a `Fixes: #1234` reference in the commit that fixes the issue * If this PR is fixes a Launchpad bug, include a `LP: #12345678` reference in the commit that fixes the issue
### Test Updates #### Unit Tests - [x] I have updated or added any unit tests accordingly - [ ] No unit test changes are necessary for this change #### Integration Tests - [ ] I have updated or added any integration tests accordingly - [x] No integration test changes are necessary for this change ### Documentation - [ ] Changes here need to be documented and I have referenced the docs PR in the description - [x] No documentation updates are necessary for this change ### Does this PR require review from someone outside the core ubuntu-pro-client team? - [ ] Yes, and I have requested those reviews via GitHub - [x] No
renanrodrigo commented 4 weeks ago

Ok Github is failing to build the package on Xenial because it is using an outdated version of the Python 3.5 stdlib in the chroot. This is reproducible locally. May have to comment the test out.

renanrodrigo commented 4 weeks ago

As agreed I just removed the extra unit test (as we never had it anyway) and there is a unit test covering the new exception in the timer job. This is now good to go.