The `can-i-deploy` command takes an `--ignore` par...
# pact-broker
a
The
can-i-deploy
command takes an
--ignore
parameter that allows me to specify multiple pacticipants to ignore for the purposes of the deploy check. Is it possible I can tell this command to treat absence of any pacticipant from the target environment as ignorable? The reason for this is twofold: • Its not necessarily an error that a given peer pacticipant isn't in the deployment environment; I have different environments that require different mixes of pacticipants. • Its very brittle to have to state what must be ignored because this might change over time as new components are added; I have to go through each environment figuring out whether new component X is expected for environment E and if not add it to the ignore list.
m
I don’t believe
can-i-deploy
will fail for a provider, if there are no consumers in a target environment
the other way around will fail of course
a
That's the case (consumer fail if provider not deployed) that I'm having the issues with; if the consumer is e.g. an API gateway with a configurable set of backends (the providers), each deployment may have a different mix of "required" providers. Having to do this by exclusion (i.e. the
--ignored
switch) is pessimal because every time a new provider appears we have to go through all deployments adjusting the ignore list. If we had a global "ignore missing" switch or even the opposite
--dontIgnore
that would be much less brittle.
m
I'm confused about why the gateway would be deployed with a contract to a non existent provider?
a
Think of the gateway as being deployment-time configurable in terms of what providers it will need; not all providers are needed in all deployments.
m
So I wonder if that can be delt with using other means (e.g. tags or environments)
I'm not saying the feature isn't doable or even desirable, but I worry about the use of it
In your case, how will you differentiate between a situation where a provider should be there but isn't, and a valid situation where a provider isn't there and isn't needed
a
The way I'm dealing with it at the moment is to associate different ignore lists with different environment (tags), but as I say its brittle. So I'm making that judgement already via the
ignore
flag (i.e. don't worry about this provider for this deployment). I think in practice this approach would be more tractable in my particular use case if I were able to use
dontIgnore
because as the number of environments grows it becomes harder to manage the arrival of new providers. But I understand your concerns around inadvertently missing a provider where it's needed; however I wouldn't suggest this kind of behaviour were the default - as with
ignore
its a case of caveat developer.
👍 1