Fix transitive depends_on with oneshot/healthy conditions and podma… - #1476
Open
allen-munsch wants to merge 2 commits into
Open
Fix transitive depends_on with oneshot/healthy conditions and podma…#1476allen-munsch wants to merge 2 commits into
depends_on with oneshot/healthy conditions and podma…#1476allen-munsch wants to merge 2 commits into
Conversation
allen-munsch
marked this pull request as draft
June 16, 2026 22:31
allen-munsch
force-pushed
the
fix/depends_on_transitive
branch
3 times, most recently
from
June 16, 2026 23:30
dda833d to
214f360
Compare
allen-munsch
marked this pull request as ready for review
June 16, 2026 23:49
Contributor
Author
|
sorry for burning up build minutes its just a rough sketch, but was a big friction point, seemed to fix the issue, doing a drop in replacement of docker ran into some issues with some cert gen sidecars when switching over |
p12tic
reviewed
Jun 20, 2026
p12tic
reviewed
Jun 20, 2026
p12tic
reviewed
Jun 20, 2026
allen-munsch
force-pushed
the
fix/depends_on_transitive
branch
from
June 20, 2026 16:31
214f360 to
909dc4f
Compare
1. `container_to_args` - only add `--requires` for `service_started` (RUNNING) deps; oneshot/healthy handled
by `check_dep_conditions`
2. `ServiceDependency` -> frozen `@dataclass` with `__post_init__` enum conversion
3. `calc_dependents` - `cast()` for mypy type narrowing
4. `flat_deps` - `condition` field in `ServiceDependency()` constructor
5. `check_dep_conditions` - version-aware skip for health-check conditions on podman < 4.6.0
6. `compose_up` - `restart` field filter for dependents
7. `compose_up` detach - batch-start all containers in one `podman start` call (fixes podman 6.x regression),
retry Created containers, sequential `check_dep_conditions` calls
`tests/unit/test_depends_on.py` - updated `test_depends_on_properties` to compare full `ServiceDependency`
objects
`newsfragments/fix_transitive_depends_on_oneshot_healthy.bugfix` - release note
Signed-off-by: allen-munsch <james.a.munsch@gmail.com>
allen-munsch
force-pushed
the
fix/depends_on_transitive
branch
from
June 20, 2026 16:44
909dc4f to
bff78d1
Compare
p12tic
approved these changes
Jul 17, 2026
Collaborator
|
Looks great, thank you! Please resorve merge conflict and I can then merge the PR. |
Signed-off-by: allen-munsch <james.a.munsch@gmail.com>
Contributor
Author
|
resolved the conflict, is this flake, related, or a separate thing? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…n 5.x/6.x dependency graph bugs
Changes:
Only add
--requiresforservice_started(RUNNING) dependencies. Oneshot (service_completed_successfully) and health-checked (service_healthy) dependencies are handled bycheck_dep_conditionsat start time, avoiding broken transitive--requireschains when intermediate containers have already exited (podman 5.x dependency graph bug).Parse
requiredandrestartproperties fromdepends_onentries (defaulttrue).required: falseallows a dependency to be absent without error.restart: falseprevents a dependency change from restarting dependents.Batch-start all containers in a single
podman startcall so podman can resolve the full--requiresgraph atomically, fixing a podman 6.x regression where one-at-a-time starts fail when a transitive dependency is already running.After batch start, retry containers stuck in "Created" state up to 3 times — podman's graph resolver can fail on them when transitive dependencies are already running, but a retry after the batch succeeds.
check_dep_conditionswaits per-container withasyncio.gatherinstead of a single blocking loop for all deps, so a missing non-required dependency doesn't block others.Only restart dependents when
dep.restartisTrue.Tests: 423/423 unit tests pass. Manual integration verified against podman 4.9.3 linux/amd64, 5.4.2 linux/arm64 engine.
several representative matrices were tested via nekto act
repro compose yaml: