hey is there a standard way of handling fields tha...
# development
c
hey is there a standard way of handling fields that are common to multiple targets? I'm adding a reusable "publish dependencies" as a way for
experimental-deploy
to publish packages before deploying. Currently I have
Copy code
class MockDeployTarget(Target):
    core_fields = (
        *DeployFieldSet.fields.values(),
        ...
    )
It works but feels like I'm abusing the machinery
f
The "common pattern" has been to just define a constant (like
COMMON_TARGET_FIELDS
) and use that, but that does not seem right here.
You could modify the deploy goal to check whether a target can be published as well. Request
UnionMembership.get(PublishFieldSet)
and see if the target matches at least one of the returned field sets.
If so, then activate the publish goal programmatically with that matching field set and target.
c
It's exactly
DeployProcess.publish_dependencies
, but with a way to hook into that manually. I think the only thing that fill that attribute is
helm_deployment
publishing inferred `docker_image`s. I want to provide a generic field that we can use to manually specify those. I'm thinking in particular of an issue where the user wanted docker images to be pushed before a Terraform deployment. I need to look into
publish_process_for_target
. Also yeah, it would be good to check that the things specified for publishing are actually publishable.
f
And is the intent for users to able to specify target addresses to publish? Or just look for publishable transitive dependencies?
c
for users to specify targets they want published. I think looking through the normal
dependencies
and publishing anything publishable would be surprising. I thought of this implementation in analogy with
runtime_package_dependencies
for tests. Although, it looks like the implementation there is to just have targets include that field in their
core_fields
manually