StackStorm / st2

StackStorm (aka "IFTTT for Ops") is event-driven automation for auto-remediation, incident responses, troubleshooting, deployments, and more for DevOps and SREs. Includes rules engine, workflow, 160 integration packs with 6000+ actions (see https://exchange.stackstorm.org) and ChatOps. Installer at https://docs.stackstorm.com/install/index.html
https://stackstorm.com/
Apache License 2.0
6.09k stars 746 forks source link

Pantsbuild: Add BUILD dependencies for logging.conf #6251

Closed cognifloyd closed 1 month ago

cognifloyd commented 1 month ago

This PR has commits cherry-picked from #6202

I'm working towards getting pants to run our tests via pytest. While running unit tests, I found that the logging.conf files depend on python code, but pants cannot infer dependencies in conf files.

For example, this logging.conf snippet uses 3 classes from st2common.logging.formatters: https://github.com/StackStorm/st2/blob/b534bf2089502ea865f5da654c16e21f781121e2/st2stream/conf/logging.conf#L32-L44

And this snippet uses st2common.log.ConfigurableSyslogHandler: https://github.com/StackStorm/st2/blob/b534bf2089502ea865f5da654c16e21f781121e2/st2stream/conf/syslog.conf#L14-L18

Recording these dependencies for every conf file would be very repetitive, though, so I added 3 pants macros to simplify defining the dependencies in BUILD metadata: