Hi,
yesterday I spent an afternoon debugging a failing CI tests on ansible-core, and
noticed that it is caused by this setting in
/etc/apt/preferences.d/90autopkgtest:
Package: *
Pin: origin ""
Pin-Priority: 1002
The ansible CI test in question creates a local apt repository with several
package versions, and then tests installation/upgrade paths using the ansible
apt module (which internally uses python3-apt). When this pinning is set, the
local apt repo is affected by the pin, and every versioned installation will
fail with e.g. "Task failed: Module failed: no available installation candidate
for foo=1.0.0". The reproducer is described here:
https://github.com/ansible/ansible/issues/85147
My workaround is to delete the file before running the tests.
While I believe it's a bug in python3-apt or ansible-core, I think we should be
more cautious about setting the pin priority, as this might also affect other
software doing similar tests. AFAICS this pinning shouldn't be needed, as the
package being tested should always have a higher version number than the one in
the apt archive.
So my questions are: Is this really needed? And if yes, could we instead do a
narrower apt pinning at runtime to the specific packages in question?
Greets,
Lee