get_target_packages has dependencies in the wrong direction

We are adding dependencies during changes:

answer = answer.union(PKG_DEPENDENCIES.get(package, set()))

but this makes a build with logging only changes trigger BigQuery, Pub / Sub and Storage:

$ #!/bin/bash -eo pipefail
  python3.6 test_utils/scripts/get_target_packages.py > ~/target_packages
  cat ~/target_packages

bigquery
logging
pubsub
storage
  • logging depends on bigquery, pubsub, storage
  • error_reporting depends on logging

So the real output should be a reverse of the dependency map:

{'logging', 'error_reporting'}