concourse / pool-resource

atomically manages the state of the world (e.g. external environments)
Apache License 2.0
57 stars 36 forks source link

feature request: custom rules for checking #47

Closed fredwangwang closed 3 years ago

fredwangwang commented 5 years ago

Problem

Currently, check will return ref for any change happens to the targeted pool. This is not desirable for some pipeline designs. For example: a job triggers on pool-resource to retrive a claimed resource, it works fine. But if the resource is removed, the job will be triggered and will fail. So it would be nice if it can only be triggered by certain operations.

Proposed solution

git log supports --diff-filter which allows to filter certain types of operation. It does not have a one-to-one mapping to the operations supported by pool-resource, but should be pretty close (For example, A for add or add_claimed).

So a new param named check_config or something similar can be introduced to control the behavior of check to only output a new ref for certain operations.