From 682657fd5b03749df9a826f7b5253a66abeda1f8 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 30 Mar 2023 18:18:15 -0500 Subject: [PATCH 1/2] chore: standardize format of BUILD overrides --- BUILD | 24 +++++++++++----------- contrib/core/tests/BUILD | 6 +++--- contrib/examples/actions/bash_random/BUILD | 2 +- pants-plugins/uses_services/BUILD | 6 +++--- st2actions/conf/BUILD | 6 +++--- st2common/bin/BUILD | 16 +++++++-------- st2common/st2common/bootstrap/BUILD | 6 +++--- tools/BUILD | 6 +++--- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/BUILD b/BUILD index 166f72c009..179cc680c4 100644 --- a/BUILD +++ b/BUILD @@ -3,30 +3,30 @@ python_requirements( source="requirements-pants.txt", overrides={ # flex and stevedore uses pkg_resources w/o declaring the dep - ("flex", "stevedore"): { - "dependencies": [ + ("flex", "stevedore"): dict( + dependencies=[ "//:reqs#setuptools", ] - }, + ), # do not use the prance[flex] extra as that pulls in an old version of flex - "prance": { - "dependencies": [ + "prance": dict( + dependencies=[ "//:reqs#flex", ] - }, + ), # tooz needs one or more backends (tooz is used by the st2 coordination backend) - "tooz": { - "dependencies": [ + "tooz": dict( + dependencies=[ "//:reqs#redis", "//:reqs#zake", ] - }, + ), # make sure anything that uses st2-auth-ldap gets the st2auth constant - "st2-auth-ldap": { - "dependencies": [ + "st2-auth-ldap": dict( + dependencies=[ "st2auth/st2auth/backends/constants.py", ] - }, + ), }, ) diff --git a/contrib/core/tests/BUILD b/contrib/core/tests/BUILD index d756f45b31..c39f12967f 100644 --- a/contrib/core/tests/BUILD +++ b/contrib/core/tests/BUILD @@ -1,13 +1,13 @@ python_tests( skip_pylint=True, overrides={ - "test_action_sendmail.py": { - "dependencies": [ + "test_action_sendmail.py": dict( + dependencies=[ # contrib/core is symlinked to st2tests/st2tests/fixtures/packs/core # so pants thinks "mail-parser" is defined twice, making it ambiguous. # Use contrib/core as the canonical copy. "contrib/core:reqs#mail-parser", ], - } + ), }, ) diff --git a/contrib/examples/actions/bash_random/BUILD b/contrib/examples/actions/bash_random/BUILD index 787e6c8c11..3acab1965b 100644 --- a/contrib/examples/actions/bash_random/BUILD +++ b/contrib/examples/actions/bash_random/BUILD @@ -1,5 +1,5 @@ shell_sources( overrides={ - "random2.sh": {"skip_shellcheck": True}, + "random2.sh": dict(skip_shellcheck=True), }, ) diff --git a/pants-plugins/uses_services/BUILD b/pants-plugins/uses_services/BUILD index c04e91a0fa..8c63bf16d4 100644 --- a/pants-plugins/uses_services/BUILD +++ b/pants-plugins/uses_services/BUILD @@ -14,8 +14,8 @@ python_tests( # is somehow broken, then any failures would prevent these tests # from running to tell us what is wrong. # overrides={ - # "mongo_rules_test.py": {"uses": ["mongo"]}, - # "rabbitmq_rules_test.py": {"uses": ["rabbitmq"]}, - # "redis_rules_test.py": {"uses": ["redis"]}, + # "mongo_rules_test.py": dict(uses=["mongo"]), + # "rabbitmq_rules_test.py": dict(uses=["rabbitmq"]), + # "redis_rules_test.py": dict(uses=["redis"]), # }, ) diff --git a/st2actions/conf/BUILD b/st2actions/conf/BUILD index 571554c281..42e57e0d5a 100644 --- a/st2actions/conf/BUILD +++ b/st2actions/conf/BUILD @@ -7,11 +7,11 @@ files( name="logging", sources=["logging*.conf"], overrides={ - "logging.conf": { - "dependencies": [ + "logging.conf": dict( + dependencies=[ "//:reqs#python-json-logger", ], - }, + ), }, ) diff --git a/st2common/bin/BUILD b/st2common/bin/BUILD index 69f1ac4102..6370d99f54 100644 --- a/st2common/bin/BUILD +++ b/st2common/bin/BUILD @@ -10,21 +10,21 @@ st2_shell_sources_and_resources( sources=["st2ctl", "st2-self-check", "st2-run-pack-tests"], skip_shellcheck=True, overrides={ - "st2ctl": { - "dependencies": [ + "st2ctl": dict( + dependencies=[ "./st2-register-content", "./st2-cleanup-db", ], - }, - "st2-self-check": { - "dependencies": [ + ), + "st2-self-check": dict( + dependencies=[ "./st2ctl:shell", # TODO: dep on st2client cli? ], - }, + ), # st2-run-pack-tests creates its own virtualenv on the fly and - # installs its dependencies, so they don't need to be listed here. + # installs its dependencies, so most don't need to be listed here. # It can optionally use the deps installed with st2tests package. - # "st2-run-pack-tests": {}, + # "st2-run-pack-tests": dict(), }, ) diff --git a/st2common/st2common/bootstrap/BUILD b/st2common/st2common/bootstrap/BUILD index 37d827b2f1..79c9b40f15 100644 --- a/st2common/st2common/bootstrap/BUILD +++ b/st2common/st2common/bootstrap/BUILD @@ -1,9 +1,9 @@ python_sources( overrides={ - "policiesregistrar.py": { - "dependencies": [ + "policiesregistrar.py": dict( + dependencies=[ "st2common/st2common/policies/meta:policies_meta", ], - }, + ), }, ) diff --git a/tools/BUILD b/tools/BUILD index 0270ed5b21..24229a0bde 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -12,8 +12,8 @@ python_requirement( python_sources( overrides={ - "config_gen.py": { - "dependencies": [ + "config_gen.py": dict( + dependencies=[ # the auth backends get listed in the conf file "//:auth_backends", # We are using string import detection to gather the imports @@ -21,7 +21,7 @@ python_sources( # helpful in validating that dependencies include everything: # grep -rl '^def register_opts(ignore_errors=False):' st2* ] - }, + ), }, ) From 00a2a332150cd61b815453a841bf2e8128728dab Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 30 Mar 2023 21:54:17 -0500 Subject: [PATCH 2/2] update changelog entry --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 748df0e577..b00e2d84c1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,7 +17,7 @@ Added #5778 #5789 #5817 #5795 #5830 #5833 #5834 #5841 #5840 #5838 #5842 #5837 #5849 #5850 #5846 #5853 #5848 #5847 #5858 #5857 #5860 #5868 #5871 #5864 #5874 #5884 #5893 #5891 #5890 #5898 #5901 #5906 #5899 #5907 #5909 #5922 #5926 #5927 #5925 #5928 #5929 #5930 - #5931 #5932 + #5931 #5932 #5948 Contributed by @cognifloyd * Added a joint index to solve the problem of slow mongo queries for scheduled executions. #5805