Return proxied objects from all remaining factory methods
`LaunchpadObjectFactory` formerly issued `UnproxiedFactoryMethodWarning`
when its methods returned objects not wrapped in a security proxy, since
that tended to result in tests that are less accurate simulations of
production. This commit finishes ensuring that all factory methods
return proxied objects, and converts that warning into an error so that
we can't accidentally reintroduce this problem.
This required tightening up a few more tests to log in or to remove
security proxies before accessing proxied objects.
Fix handling of shared files when updating Artifactory properties
Some files (notably `.orig.tar.*` files in Debian-format source
packages) may be shared between multiple different package versions: for
example, `hello 1.0-1` and `hello 1.0-2` will normally share a file
called something like `hello_1.0.orig.tar.gz` containing the original
upstream source code.
For Artifactory publication, the publisher handled this case poorly. If
two versions were published that shared the same file, but then one of
those versions was removed, the shared file was correctly left in place
until there are no remaining publications using it; but
`Publisher.C_updateArtifactoryProperties` attempted to update properties
on all the files associated with the removed version rather than on just
the file that was still published, resulting in a `FileNotFoundError`.
Fixing this requires working out the `IPackageReleaseFile` and
`IPublishingView` objects to which a given Artifactory path "belongs",
which is somewhat complex: we have to go through all the possible
release objects, figure out what the paths of all their files would be
if published, build mappings of paths back to files and publications,
and use those mappings to update only the paths that are still published
with the correct properties.
The shared files end up still having `launchpad.release-id` properties
associated with the old version, but this seems to be a minor enough
problem that we can ignore it for now.