-
Notifications
You must be signed in to change notification settings - Fork 56
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
fix: validate whole plan, rather than topmost two layers #363
fix: validate whole plan, rather than topmost two layers #363
Conversation
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.
This looks excellent to me for a first PR in Pebble, thanks! No real issues, just a couple of nit comments. I'll also ask @flotter to go over this as he's looking at the whole plan/layers area (from another angle).
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.
Some minor comments for consideration, but overall looks great.
@tonyandrewmeyer b.t.w this is a real coincidence that you are cleaning this up a bit, because I am on a kind of similar mission for slightly different reasons, and I've done in my PoC exactly what you conceptionally doing here. I've also split it up between Layer and Plan validation, but you went a bit further, actually cleaning up what is inside each category, which is super nice and brave :) Looking forward getting this merged. |
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.
This looks great. Just one final comment/question about not mutating in Layer.Validate
.
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.
Excellent, thank you.
This PR moves layer/plan validation into dedicated functions, with `Layer.Validate` covering validation that is specific to a layer (such as an invalid value) and `Plan.Validate` covering validation that covers the plan as a whole (such as cycles or missing values). Plan validation includes layer validation, and is done in the service manager's `updatePlanLayers` and in `plan.CombineLayers`. We also use the check period as the upper bound for the timeout in checks, which was happening before, but less explicitly. No additional validation is done - all of the validation code is moved rather than changed. Fixes canonical#349
Validation fix PR: canonical/pebble#363 Pebble release: https://github.com/canonical/pebble/releases/tag/v1.7.3
#17011 This is to pull in this Pebble fix to the Juju 3.4 branch: canonical/pebble#363. It fixes an issue a couple of people have had with adding and merging layers (described in canonical/pebble#349).
This PR moves layer/plan validation into dedicated functions, with
Layer.Validate
covering validation that is specific to a layer (such as an invalid value) andPlan.Validate
covering validation that covers the plan as a whole (such as cycles or missing values).Plan validation includes layer validation, and is done in the service manager's
updatePlanLayers
and inplan.CombineLayers
.We also use the check period as the upper bound for the timeout in checks, which was happening before, but less explicitly.
No additional validation is done - all of the validation code is moved rather than changed.
Fixes #349