Hey, Why does the `run` goal fail when the applie...
# general
Hey, Why does the
goal fail when the applied filters return nothing? I am trying to run DB migrations if there is any change detected in my microservice migrations, but if I use the
flag and nothing is detected, it fails my ci. I also tried the
goal and piped the result into a run, same thing. Any ideas?
Had to do it the hard way
Copy code
for line in $(./pants --tag=migration --changed-since=tags/${{steps.get-latest-tag.outputs.tag}} --changed-dependees=transitive list); do
            echo "Running migration for $line"
            ./pants run $line -- migrate app
It comes down to expecatations, Pants has behaved different ways in its past: Do you silently do nothing for
./pants <verb>
when no targets / changes apply to that verb? Or do you error. We are currently erroring, assuming
./pants run
is a signal you want something to run; so the absence of a run must be an error. This choice is highly debatable of course.
Basically, our current choice is maybe good for interactive use / newer users and its hostile to automation. Your case is automation.
In either case, having an option to override the default is very useful and would please everyone. I also agree that failing is safer as a default.
I actually am not a fan of failing as the default, but my opinion is in the minority on that one!
it is newbie proof. But as you get more comfortable with a tool, yes it becomes annoying