Wondering about this... I've helped a few people w...
# development
g
Wondering about this... I've helped a few people with this before, messed it up myself, and it leads to weirdness like this:
Copy code
@rule(desc="Noop package", level=LogLevel.DEBUG)
async def package_nothing(field_set: MirrorImageFieldSet) -> BuiltPackage:
    return BuiltPackage(
        digest=EMPTY_DIGEST,
        artifacts=tuple(),
    )
when there's nothing to put on disk but you can still upload it. The docker backend is arguably a weird case here, for example, since the "package" is only a metadata file.
It seems intuitive that you'd need to package before you publish, when we talk about "classic" artifacts. When e.g. talking about a Kubernetes manifest, a docker image, etc etc, it seems quite roundabout. My above example is a mirroring plugin for my oci backend, where I explicitly do not want to package it - just download and immediately upload.
So I'm wondering whether we could run the package command if existing and otherwise just continue
Or maybe even a flag on the request/fieldset to opt-out
c
I have a plugin for that… planning on upstreaming it, but won’t be until early 2024
but yea, was going to suggest that we probably want to have a flag on the publish field set so we can influence this: https://github.com/pantsbuild/pants/blob/57a3b7c38ed370a7c863a79fe320015fbe00c9eb/src/python/pants/core/goals/publish.py#L210-L213
g
A plugin for what? 😄
c
sorry, prob not exactly the same, but sounded very familiar.. a plugin that basically does
Copy code
docker pull x
docker tag x y
docker push y
g
Ah, yeah. That's what I do pretty much, but in a no-docker world. 😉
👍 1
Anyways, was mostly an example of where I don't want a package goal but have to have one.
c
I don’t recall having a dummy package step in there.. but I may just have memory glitches..
I’m currently in no access to that code, hence why the upstreaming won’t happen atm