resolve() returns no error for a package the pool could not supply #10
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/fab#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while inventorying the call sites for #8. Not introduced by #9, and not
a blocker for it; filed because it is the thing that turns a missing package
into a silently wrong image rather than a build failure.
resolve()cannot report a missing packagefablib/plan.py:missingis initialised at:366and never mutated afterwards.brokendepsis built by iteratingmissingat:421-422.resolve()returns(spec, [])even whenall_missingis non-empty.A plan entry the pool cannot supply is dropped from the spec and the caller is
told nothing.
fab-plan-resolveexits 0 and the build carries on without thepackage.
And a virtual package can never resolve
Two things, both at the same layer:
:205-206derives the package name from the pool's answer withpackage_name = fname.split("_")[0]and then indexesdeps[package_name].The first field of the
.debfilename has to be string-equal to the namethat was requested, so a provider returned under a different name raises an
uncaught
KeyErrorrather than resolving._get_providedat:329readsProvidesonly from packages that havealready been fetched, and its result is used only at
:406to subtract fromall_missing. Nothing in that path can cause a provider to be fetched in thefirst place.
So
Provides:is not a mechanism a plan can rely on, and the first defectmeans that when it fails, it fails quietly.
Why it matters now
tkldev/plan/main:3is a barefab, the only plan in the organization thatnames the package. After #9 the package is
keel-fab, andProvides: fabdoes not help a plan. That is Keel-Linux/tkldev#4, which fixes the plan line;
this issue is about the resolver telling the truth when a plan line is wrong.
What closes this
resolve()reports what it could not supply, with a test that drives itagainst a pool missing a requested package and asserts a non-zero result
rather than an empty
brokendeps.plan entry that only matches a
Provideswith a message saying so. Refusingloudly is worth more than resolving quietly here.
KeyErrorpath at:205-206becomes a diagnosederror rather than a traceback.
Coverage:
fablib/plan.pyis 314 lines and currently has no unit test at all(
COVERAGE.md, priority 2 of the plan to reach 90 percent). This is a goodreason to start there.