From 284ebf23657ae1974c7d0f02d9a74a36117f29cc Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 13 Apr 2021 08:46:14 -0400 Subject: [PATCH 01/26] register st2common resources for pants --- st2common/st2common/BUILD | 12 +++++++++++- st2common/st2common/bootstrap/BUILD | 6 +++++- st2common/st2common/conf/BUILD | 5 +++++ st2common/st2common/constants/BUILD | 6 +++++- st2common/st2common/policies/meta/BUILD | 5 +++++ st2common/st2common/util/schema/BUILD | 11 ++++++++++- 6 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 st2common/st2common/conf/BUILD create mode 100644 st2common/st2common/policies/meta/BUILD diff --git a/st2common/st2common/BUILD b/st2common/st2common/BUILD index db46e8d6c9..38259c4c32 100644 --- a/st2common/st2common/BUILD +++ b/st2common/st2common/BUILD @@ -1 +1,11 @@ -python_sources() +python_sources( + dependencies=[ + ":openapi_spec", + ] +) + +# These may be loaded with st2common.util.spec_loader +resources( + name="openapi_spec", + sources=["openapi.yaml", "openapi.yaml.j2"], +) diff --git a/st2common/st2common/bootstrap/BUILD b/st2common/st2common/bootstrap/BUILD index db46e8d6c9..e85d7581b5 100644 --- a/st2common/st2common/bootstrap/BUILD +++ b/st2common/st2common/bootstrap/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2common/st2common/policies/meta:policies_meta", + ] +) diff --git a/st2common/st2common/conf/BUILD b/st2common/st2common/conf/BUILD new file mode 100644 index 0000000000..3b89b94788 --- /dev/null +++ b/st2common/st2common/conf/BUILD @@ -0,0 +1,5 @@ +# used in st2common.constants.logging.DEFAULT_LOGGING_CONF_PATH +resource( + name="base.logging.conf", + source="base.logging.conf", +) diff --git a/st2common/st2common/constants/BUILD b/st2common/st2common/constants/BUILD index db46e8d6c9..f0ac5efd12 100644 --- a/st2common/st2common/constants/BUILD +++ b/st2common/st2common/constants/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2common/st2common/conf:base.logging.conf", + ] +) diff --git a/st2common/st2common/policies/meta/BUILD b/st2common/st2common/policies/meta/BUILD new file mode 100644 index 0000000000..7164261422 --- /dev/null +++ b/st2common/st2common/policies/meta/BUILD @@ -0,0 +1,5 @@ +# These are loaded by st2common.bootstrap.policiesregistrar +resources( + name="policies_meta", + sources=["*.yaml"], +) diff --git a/st2common/st2common/util/schema/BUILD b/st2common/st2common/util/schema/BUILD index db46e8d6c9..c579e7b49b 100644 --- a/st2common/st2common/util/schema/BUILD +++ b/st2common/st2common/util/schema/BUILD @@ -1 +1,10 @@ -python_sources() +python_sources( + dependencies=[ + ":jsonschema", + ] +) + +resources( + name="jsonschema", + sources=["*.json"], +) From d1d6269f3da62b32c1e46cc4f1345cc71174f06c Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 17 May 2021 11:04:27 -0500 Subject: [PATCH 02/26] pants: add some files targets for conf files --- st2tests/conf/BUILD | 19 +++++++++++++++++++ st2tests/integration/BUILD | 3 +++ st2tests/st2tests/BUILD | 8 +++++++- st2tests/st2tests/fixtures/conf/BUILD | 11 +++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 st2tests/conf/BUILD diff --git a/st2tests/conf/BUILD b/st2tests/conf/BUILD new file mode 100644 index 0000000000..8a3136d774 --- /dev/null +++ b/st2tests/conf/BUILD @@ -0,0 +1,19 @@ +files( + name="st2.conf", + sources=["st2.conf"], +) + +files( + name="st2_kvstore_tests.crypto.key.json", + sources=["st2_kvstore_tests.crypto.key.json"], +) + +files( + name="logging.conf", + sources=["logging.conf"], +) + +files( + name="other-logging-conf", + sources=["logging.*.conf"], +) diff --git a/st2tests/integration/BUILD b/st2tests/integration/BUILD index 3c3cd5dda1..a00e23342c 100644 --- a/st2tests/integration/BUILD +++ b/st2tests/integration/BUILD @@ -6,5 +6,8 @@ __defaults__( shell_sources( name="shell", + dependencies=[ + "st2tests/conf:st2.conf", + ], skip_shellcheck=True, ) diff --git a/st2tests/st2tests/BUILD b/st2tests/st2tests/BUILD index db46e8d6c9..cba49a8822 100644 --- a/st2tests/st2tests/BUILD +++ b/st2tests/st2tests/BUILD @@ -1 +1,7 @@ -python_sources() +python_sources( + dependencies=[ + "st2tests/conf:st2.conf", + "st2tests/conf:st2_kvstore_tests.crypto.key.json", + "st2tests/conf:logging.conf", + ], +) diff --git a/st2tests/st2tests/fixtures/conf/BUILD b/st2tests/st2tests/fixtures/conf/BUILD index db46e8d6c9..71049077f4 100644 --- a/st2tests/st2tests/fixtures/conf/BUILD +++ b/st2tests/st2tests/fixtures/conf/BUILD @@ -1 +1,12 @@ python_sources() + +resources( + name="st2.tests.conf", + sources=["st2.tests*.conf"], + dependencies=["st2tests/conf:other-logging-conf"], +) + +files( + name="logging-conf", + sources=["logging.*.conf"], +) From ab9531e977d2fa29c9da4b92b426ed99e14812fb Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 17 May 2021 19:08:54 -0500 Subject: [PATCH 03/26] pants: add resources for st2client unit tests --- st2client/tests/fixtures/BUILD | 14 +++++++++++++- st2client/tests/unit/BUILD | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/st2client/tests/fixtures/BUILD b/st2client/tests/fixtures/BUILD index db46e8d6c9..46d6247fa8 100644 --- a/st2client/tests/fixtures/BUILD +++ b/st2client/tests/fixtures/BUILD @@ -1 +1,13 @@ -python_sources() +resources( + name="execution_fixtures", + sources=["execution*.json", "execution*.txt"], +) + +resources( + name="st2client-ini", + sources=["*.ini"], +) + +python_sources( + dependencies=[":execution_fixtures"], +) diff --git a/st2client/tests/unit/BUILD b/st2client/tests/unit/BUILD index 9aaca5d249..1877fa7e1c 100644 --- a/st2client/tests/unit/BUILD +++ b/st2client/tests/unit/BUILD @@ -1,6 +1,7 @@ python_tests( name="tests", dependencies=[ + "st2client/tests/fixtures:st2client-ini", # most files import tests.base which is ambiguous. Tell pants which one to use. "st2client/tests/base.py", ], From fcec7ea9ecebab9fec72dbeda747ca57fcc53c9e Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Wed, 19 May 2021 20:54:58 -0500 Subject: [PATCH 04/26] pants: include runner.yaml files --- .../action_chain_runner/action_chain_runner/BUILD | 9 ++++++++- .../announcement_runner/announcement_runner/BUILD | 9 ++++++++- contrib/runners/http_runner/http_runner/BUILD | 9 ++++++++- contrib/runners/inquirer_runner/inquirer_runner/BUILD | 9 ++++++++- contrib/runners/local_runner/local_runner/BUILD | 9 ++++++++- contrib/runners/noop_runner/noop_runner/BUILD | 9 ++++++++- contrib/runners/orquesta_runner/orquesta_runner/BUILD | 9 ++++++++- contrib/runners/python_runner/python_runner/BUILD | 9 ++++++++- contrib/runners/remote_runner/remote_runner/BUILD | 9 ++++++++- contrib/runners/winrm_runner/winrm_runner/BUILD | 9 ++++++++- 10 files changed, 80 insertions(+), 10 deletions(-) diff --git a/contrib/runners/action_chain_runner/action_chain_runner/BUILD b/contrib/runners/action_chain_runner/action_chain_runner/BUILD index db46e8d6c9..dc04a89328 100644 --- a/contrib/runners/action_chain_runner/action_chain_runner/BUILD +++ b/contrib/runners/action_chain_runner/action_chain_runner/BUILD @@ -1 +1,8 @@ -python_sources() +resource( + name="runner_metadata", + source="runner.yaml", +) + +python_sources( + dependencies=[":runner_metadata"], +) diff --git a/contrib/runners/announcement_runner/announcement_runner/BUILD b/contrib/runners/announcement_runner/announcement_runner/BUILD index db46e8d6c9..dc04a89328 100644 --- a/contrib/runners/announcement_runner/announcement_runner/BUILD +++ b/contrib/runners/announcement_runner/announcement_runner/BUILD @@ -1 +1,8 @@ -python_sources() +resource( + name="runner_metadata", + source="runner.yaml", +) + +python_sources( + dependencies=[":runner_metadata"], +) diff --git a/contrib/runners/http_runner/http_runner/BUILD b/contrib/runners/http_runner/http_runner/BUILD index db46e8d6c9..dc04a89328 100644 --- a/contrib/runners/http_runner/http_runner/BUILD +++ b/contrib/runners/http_runner/http_runner/BUILD @@ -1 +1,8 @@ -python_sources() +resource( + name="runner_metadata", + source="runner.yaml", +) + +python_sources( + dependencies=[":runner_metadata"], +) diff --git a/contrib/runners/inquirer_runner/inquirer_runner/BUILD b/contrib/runners/inquirer_runner/inquirer_runner/BUILD index db46e8d6c9..dc04a89328 100644 --- a/contrib/runners/inquirer_runner/inquirer_runner/BUILD +++ b/contrib/runners/inquirer_runner/inquirer_runner/BUILD @@ -1 +1,8 @@ -python_sources() +resource( + name="runner_metadata", + source="runner.yaml", +) + +python_sources( + dependencies=[":runner_metadata"], +) diff --git a/contrib/runners/local_runner/local_runner/BUILD b/contrib/runners/local_runner/local_runner/BUILD index db46e8d6c9..dc04a89328 100644 --- a/contrib/runners/local_runner/local_runner/BUILD +++ b/contrib/runners/local_runner/local_runner/BUILD @@ -1 +1,8 @@ -python_sources() +resource( + name="runner_metadata", + source="runner.yaml", +) + +python_sources( + dependencies=[":runner_metadata"], +) diff --git a/contrib/runners/noop_runner/noop_runner/BUILD b/contrib/runners/noop_runner/noop_runner/BUILD index db46e8d6c9..dc04a89328 100644 --- a/contrib/runners/noop_runner/noop_runner/BUILD +++ b/contrib/runners/noop_runner/noop_runner/BUILD @@ -1 +1,8 @@ -python_sources() +resource( + name="runner_metadata", + source="runner.yaml", +) + +python_sources( + dependencies=[":runner_metadata"], +) diff --git a/contrib/runners/orquesta_runner/orquesta_runner/BUILD b/contrib/runners/orquesta_runner/orquesta_runner/BUILD index db46e8d6c9..dc04a89328 100644 --- a/contrib/runners/orquesta_runner/orquesta_runner/BUILD +++ b/contrib/runners/orquesta_runner/orquesta_runner/BUILD @@ -1 +1,8 @@ -python_sources() +resource( + name="runner_metadata", + source="runner.yaml", +) + +python_sources( + dependencies=[":runner_metadata"], +) diff --git a/contrib/runners/python_runner/python_runner/BUILD b/contrib/runners/python_runner/python_runner/BUILD index db46e8d6c9..dc04a89328 100644 --- a/contrib/runners/python_runner/python_runner/BUILD +++ b/contrib/runners/python_runner/python_runner/BUILD @@ -1 +1,8 @@ -python_sources() +resource( + name="runner_metadata", + source="runner.yaml", +) + +python_sources( + dependencies=[":runner_metadata"], +) diff --git a/contrib/runners/remote_runner/remote_runner/BUILD b/contrib/runners/remote_runner/remote_runner/BUILD index db46e8d6c9..dc04a89328 100644 --- a/contrib/runners/remote_runner/remote_runner/BUILD +++ b/contrib/runners/remote_runner/remote_runner/BUILD @@ -1 +1,8 @@ -python_sources() +resource( + name="runner_metadata", + source="runner.yaml", +) + +python_sources( + dependencies=[":runner_metadata"], +) diff --git a/contrib/runners/winrm_runner/winrm_runner/BUILD b/contrib/runners/winrm_runner/winrm_runner/BUILD index db46e8d6c9..dc04a89328 100644 --- a/contrib/runners/winrm_runner/winrm_runner/BUILD +++ b/contrib/runners/winrm_runner/winrm_runner/BUILD @@ -1 +1,8 @@ -python_sources() +resource( + name="runner_metadata", + source="runner.yaml", +) + +python_sources( + dependencies=[":runner_metadata"], +) From 26990c7913a8b587fbca845c24a200b5f3d6247c Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Sat, 10 Dec 2022 00:14:13 -0600 Subject: [PATCH 05/26] pants: add yaml files to st2tests.fixtures.history_views --- st2tests/st2tests/fixtures/history_views/BUILD | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/st2tests/st2tests/fixtures/history_views/BUILD b/st2tests/st2tests/fixtures/history_views/BUILD index db46e8d6c9..46408a38dc 100644 --- a/st2tests/st2tests/fixtures/history_views/BUILD +++ b/st2tests/st2tests/fixtures/history_views/BUILD @@ -1 +1,8 @@ -python_sources() +resources( + name="artifacts", + sources=["*.yaml"], +) + +python_sources( + dependencies=[":artifacts"], +) From 204ae8d2ea197dfc10af464bbb11f69dba447b1e Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 1 Jun 2021 21:48:40 -0500 Subject: [PATCH 06/26] pants: register rbac fixtures rbac fixtures are not used in st2.git They are used here: https://github.com/StackStorm/st2-rbac-backend/blob/master/tests/unit/test_rbac_loader.py --- st2tests/st2tests/fixtures/BUILD | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 st2tests/st2tests/fixtures/BUILD diff --git a/st2tests/st2tests/fixtures/BUILD b/st2tests/st2tests/fixtures/BUILD new file mode 100644 index 0000000000..010e795e35 --- /dev/null +++ b/st2tests/st2tests/fixtures/BUILD @@ -0,0 +1,8 @@ +resources( + # used by tests in st2-rbac-backend + name="rbac_fixtures", + sources=[ + "./rbac/**/*.yaml", + "./rbac_invalid/**/*.yaml", + ], +) From 3d46db941685babfa98ab7efd05d8ddb0375ce90 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 17 May 2021 11:52:46 -0500 Subject: [PATCH 07/26] pants: add files targets for benchmarks --- st2common/benchmarks/fixtures/json/BUILD | 3 +++ st2common/benchmarks/micro/BUILD | 1 + 2 files changed, 4 insertions(+) create mode 100644 st2common/benchmarks/fixtures/json/BUILD diff --git a/st2common/benchmarks/fixtures/json/BUILD b/st2common/benchmarks/fixtures/json/BUILD new file mode 100644 index 0000000000..acfa51487e --- /dev/null +++ b/st2common/benchmarks/fixtures/json/BUILD @@ -0,0 +1,3 @@ +files( + sources=["*.json"], +) diff --git a/st2common/benchmarks/micro/BUILD b/st2common/benchmarks/micro/BUILD index 828ec3ebba..de55e01dc8 100644 --- a/st2common/benchmarks/micro/BUILD +++ b/st2common/benchmarks/micro/BUILD @@ -1,4 +1,5 @@ python_sources( + dependencies=["st2common/benchmarks/fixtures/json"], skip_pylint=True, ) From f395cf0795fdef90f2c7b057a5aaa1f4238238a5 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Sat, 10 Dec 2022 00:40:00 -0600 Subject: [PATCH 08/26] pants: add yaml files to st2tests.policies.meta --- st2tests/st2tests/policies/meta/BUILD | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 st2tests/st2tests/policies/meta/BUILD diff --git a/st2tests/st2tests/policies/meta/BUILD b/st2tests/st2tests/policies/meta/BUILD new file mode 100644 index 0000000000..39cb33775a --- /dev/null +++ b/st2tests/st2tests/policies/meta/BUILD @@ -0,0 +1,4 @@ +resources( + name="policies-meta", + sources=["*.yaml"], +) From 36336c6ee131c87e0dbbd5f866d8304661173a11 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 17 May 2021 11:53:28 -0500 Subject: [PATCH 09/26] pants: add files targets for st2tests resources --- st2tests/st2tests/BUILD | 2 ++ st2tests/st2tests/resources/BUILD | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 st2tests/st2tests/resources/BUILD diff --git a/st2tests/st2tests/BUILD b/st2tests/st2tests/BUILD index cba49a8822..bdd44d7ac9 100644 --- a/st2tests/st2tests/BUILD +++ b/st2tests/st2tests/BUILD @@ -3,5 +3,7 @@ python_sources( "st2tests/conf:st2.conf", "st2tests/conf:st2_kvstore_tests.crypto.key.json", "st2tests/conf:logging.conf", + "./resources:ssh", + "./resources:packs", ], ) diff --git a/st2tests/st2tests/resources/BUILD b/st2tests/st2tests/resources/BUILD new file mode 100644 index 0000000000..b3cf3010e3 --- /dev/null +++ b/st2tests/st2tests/resources/BUILD @@ -0,0 +1,9 @@ +resources( + name="ssh", + sources=["ssh/*"], +) + +resources( + name="packs", + sources=["packs/**", "!packs/**/BUILD"], +) From 65f6072eb48d7447fba230402ef3b5ad46e1418f Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 1 Jun 2021 23:14:34 -0500 Subject: [PATCH 10/26] pants: add dependency on st2tests.fixtures.conf files Let pants know where to get these conf files. Note that these conf files are not the same as the files in the repo root: //conf/st2.tests*.conf --- st2tests/st2tests/fixtures/conf/BUILD | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/st2tests/st2tests/fixtures/conf/BUILD b/st2tests/st2tests/fixtures/conf/BUILD index 71049077f4..5d72716860 100644 --- a/st2tests/st2tests/fixtures/conf/BUILD +++ b/st2tests/st2tests/fixtures/conf/BUILD @@ -1,5 +1,3 @@ -python_sources() - resources( name="st2.tests.conf", sources=["st2.tests*.conf"], @@ -10,3 +8,9 @@ files( name="logging-conf", sources=["logging.*.conf"], ) + +python_sources( + dependencies=[ + ":st2.tests.conf", + ], +) From 8ca15940d22cb68c8bb34c9f126fc212886b38f5 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 1 Jun 2021 23:41:28 -0500 Subject: [PATCH 11/26] tell pants that fixture packs need their configs --- st2tests/st2tests/fixtures/packs/configs/BUILD | 3 +++ st2tests/st2tests/fixtures/packs/dummy_pack_1/BUILD | 6 +++++- st2tests/st2tests/fixtures/packs/dummy_pack_11/BUILD | 6 +++++- st2tests/st2tests/fixtures/packs/dummy_pack_19/BUILD | 6 +++++- st2tests/st2tests/fixtures/packs/dummy_pack_22/BUILD | 6 +++++- st2tests/st2tests/fixtures/packs/dummy_pack_5/BUILD | 6 +++++- st2tests/st2tests/fixtures/packs/dummy_pack_6/BUILD | 6 +++++- st2tests/st2tests/fixtures/packs/dummy_pack_7/BUILD | 6 +++++- .../packs/dummy_pack_schema_with_nested_object_1/BUILD | 6 +++++- .../packs/dummy_pack_schema_with_nested_object_2/BUILD | 6 +++++- .../packs/dummy_pack_schema_with_nested_object_3/BUILD | 6 +++++- .../packs/dummy_pack_schema_with_nested_object_4/BUILD | 6 +++++- 12 files changed, 58 insertions(+), 11 deletions(-) create mode 100644 st2tests/st2tests/fixtures/packs/configs/BUILD diff --git a/st2tests/st2tests/fixtures/packs/configs/BUILD b/st2tests/st2tests/fixtures/packs/configs/BUILD new file mode 100644 index 0000000000..0700f34cd5 --- /dev/null +++ b/st2tests/st2tests/fixtures/packs/configs/BUILD @@ -0,0 +1,3 @@ +resources( + sources=["*.yaml"], +) diff --git a/st2tests/st2tests/fixtures/packs/dummy_pack_1/BUILD b/st2tests/st2tests/fixtures/packs/dummy_pack_1/BUILD index db46e8d6c9..4a173b377b 100644 --- a/st2tests/st2tests/fixtures/packs/dummy_pack_1/BUILD +++ b/st2tests/st2tests/fixtures/packs/dummy_pack_1/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2tests/st2tests/fixtures/packs/configs/dummy_pack_1.yaml", + ], +) diff --git a/st2tests/st2tests/fixtures/packs/dummy_pack_11/BUILD b/st2tests/st2tests/fixtures/packs/dummy_pack_11/BUILD index db46e8d6c9..af53903c91 100644 --- a/st2tests/st2tests/fixtures/packs/dummy_pack_11/BUILD +++ b/st2tests/st2tests/fixtures/packs/dummy_pack_11/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2tests/st2tests/fixtures/packs/configs/dummy_pack_11.yaml", + ], +) diff --git a/st2tests/st2tests/fixtures/packs/dummy_pack_19/BUILD b/st2tests/st2tests/fixtures/packs/dummy_pack_19/BUILD index db46e8d6c9..a7cbcb14b2 100644 --- a/st2tests/st2tests/fixtures/packs/dummy_pack_19/BUILD +++ b/st2tests/st2tests/fixtures/packs/dummy_pack_19/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2tests/st2tests/fixtures/packs/configs/dummy_pack_19.yaml", + ], +) diff --git a/st2tests/st2tests/fixtures/packs/dummy_pack_22/BUILD b/st2tests/st2tests/fixtures/packs/dummy_pack_22/BUILD index db46e8d6c9..76fb2a9339 100644 --- a/st2tests/st2tests/fixtures/packs/dummy_pack_22/BUILD +++ b/st2tests/st2tests/fixtures/packs/dummy_pack_22/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2tests/st2tests/fixtures/packs/configs/dummy_pack_22.yaml", + ], +) diff --git a/st2tests/st2tests/fixtures/packs/dummy_pack_5/BUILD b/st2tests/st2tests/fixtures/packs/dummy_pack_5/BUILD index db46e8d6c9..e12c5b4ab9 100644 --- a/st2tests/st2tests/fixtures/packs/dummy_pack_5/BUILD +++ b/st2tests/st2tests/fixtures/packs/dummy_pack_5/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2tests/st2tests/fixtures/packs/configs/dummy_pack_5.yaml", + ], +) diff --git a/st2tests/st2tests/fixtures/packs/dummy_pack_6/BUILD b/st2tests/st2tests/fixtures/packs/dummy_pack_6/BUILD index db46e8d6c9..d5287b4ba2 100644 --- a/st2tests/st2tests/fixtures/packs/dummy_pack_6/BUILD +++ b/st2tests/st2tests/fixtures/packs/dummy_pack_6/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2tests/st2tests/fixtures/packs/configs/dummy_pack_6.yaml", + ], +) diff --git a/st2tests/st2tests/fixtures/packs/dummy_pack_7/BUILD b/st2tests/st2tests/fixtures/packs/dummy_pack_7/BUILD index db46e8d6c9..852ffa1b22 100644 --- a/st2tests/st2tests/fixtures/packs/dummy_pack_7/BUILD +++ b/st2tests/st2tests/fixtures/packs/dummy_pack_7/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2tests/st2tests/fixtures/packs/configs/dummy_pack_7.yaml", + ], +) diff --git a/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_1/BUILD b/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_1/BUILD index db46e8d6c9..f577a9434a 100644 --- a/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_1/BUILD +++ b/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_1/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2tests/st2tests/fixtures/packs/configs/dummy_pack_schema_with_nested_object_1.yaml", + ], +) diff --git a/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_2/BUILD b/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_2/BUILD index db46e8d6c9..6c3d0aff16 100644 --- a/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_2/BUILD +++ b/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_2/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2tests/st2tests/fixtures/packs/configs/dummy_pack_schema_with_nested_object_2.yaml", + ], +) diff --git a/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_3/BUILD b/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_3/BUILD index db46e8d6c9..7dacccd590 100644 --- a/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_3/BUILD +++ b/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_3/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2tests/st2tests/fixtures/packs/configs/dummy_pack_schema_with_nested_object_3.yaml", + ], +) diff --git a/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_4/BUILD b/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_4/BUILD index db46e8d6c9..80faba7d5c 100644 --- a/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_4/BUILD +++ b/st2tests/st2tests/fixtures/packs/dummy_pack_schema_with_nested_object_4/BUILD @@ -1 +1,5 @@ -python_sources() +python_sources( + dependencies=[ + "st2tests/st2tests/fixtures/packs/configs/dummy_pack_schema_with_nested_object_4.yaml", + ], +) From 2ae29a6c7620f0ba75f68548fd795601a29564b7 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 8 Jun 2021 14:35:51 -0500 Subject: [PATCH 12/26] pants: add resources target for st2reactor test fixtures --- st2reactor/tests/fixtures/BUILD | 4 ++++ st2reactor/tests/fixtures/fixture/BUILD | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 st2reactor/tests/fixtures/BUILD diff --git a/st2reactor/tests/fixtures/BUILD b/st2reactor/tests/fixtures/BUILD new file mode 100644 index 0000000000..6a2517a6a7 --- /dev/null +++ b/st2reactor/tests/fixtures/BUILD @@ -0,0 +1,4 @@ +resources( + name="metadata", + sources=["*.yaml"], +) diff --git a/st2reactor/tests/fixtures/fixture/BUILD b/st2reactor/tests/fixtures/fixture/BUILD index db46e8d6c9..4dd7080488 100644 --- a/st2reactor/tests/fixtures/fixture/BUILD +++ b/st2reactor/tests/fixtures/fixture/BUILD @@ -1 +1,3 @@ -python_sources() +python_sources( + dependencies=["st2reactor/tests/fixtures:metadata"], +) From 248d8d83c03a9ce62a34d034f7bbc50c5a960482 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Wed, 9 Jun 2021 00:03:24 -0500 Subject: [PATCH 13/26] pants: Add resources in scripts/github/ --- scripts/github/BUILD | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/github/BUILD b/scripts/github/BUILD index 6c95f66377..f5a89decc1 100644 --- a/scripts/github/BUILD +++ b/scripts/github/BUILD @@ -1 +1,11 @@ -shell_sources() +files( + name="artifacts", + sources=[ + "*.txt", + "*.conf", + ], +) + +shell_sources( + dependencies=[":artifacts"], +) From 8578c301511f4bb55f1cbf5c3c0c00869e4ba088 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Sat, 12 Jun 2021 18:12:10 -0500 Subject: [PATCH 14/26] pants: Inform pants about conf files --- conf/BUILD | 56 +++++++++++++++++++++++++++ st2actions/conf/BUILD | 14 +++++++ st2api/conf/BUILD | 19 +++++++++ st2api/tests/integration/BUILD | 3 ++ st2auth/conf/BUILD | 29 ++++++++++++++ st2common/tests/integration/BUILD | 5 +++ st2reactor/conf/BUILD | 14 +++++++ st2reactor/tests/integration/BUILD | 4 ++ st2stream/conf/BUILD | 19 +++++++++ st2tests/conf/BUILD | 17 +++++--- st2tests/integration/BUILD | 1 + st2tests/st2tests/fixtures/conf/BUILD | 16 ++++---- tools/BUILD | 3 ++ 13 files changed, 187 insertions(+), 13 deletions(-) create mode 100644 conf/BUILD create mode 100644 st2actions/conf/BUILD create mode 100644 st2api/conf/BUILD create mode 100644 st2auth/conf/BUILD create mode 100644 st2reactor/conf/BUILD create mode 100644 st2stream/conf/BUILD diff --git a/conf/BUILD b/conf/BUILD new file mode 100644 index 0000000000..ac66a6bbb8 --- /dev/null +++ b/conf/BUILD @@ -0,0 +1,56 @@ +file( + name="st2client_sample_config", + source="st2rc.sample.ini", +) + +file( + name="st2.conf.sample", + source="st2.conf.sample", +) + +file( + name="logrotate", + source="logrotate.conf", +) + +file( + name="nginx_sample_config", + source="nginx/st2.conf", +) + +file( + name="st2_kvstore_demo_crypto_key", + source="st2_kvstore_demo.crypto.key.json", +) + +files( + name="st2_tests_conf", + sources=[ + "st2.tests*.conf", + ], + dependencies=[ + "st2auth/conf:htpasswd", + "st2actions/conf:logging", + "st2reactor/conf:logging", + "st2tests/conf:other-logging-conf", + ], +) + +file( + name="st2_dev_conf", + source="st2.dev.conf", + dependencies=[ + ":st2_kvstore_demo_crypto_key", + "st2auth/conf:htpasswd", + "st2actions/conf:logging", + "st2api/conf:logging", + "st2auth/conf:logging", + "st2reactor/conf:logging", + "st2stream/conf:logging", + ], +) + +file( + name="st2_package_conf", + source="st2.package.conf", +) diff --git a/st2actions/conf/BUILD b/st2actions/conf/BUILD new file mode 100644 index 0000000000..57246fe48d --- /dev/null +++ b/st2actions/conf/BUILD @@ -0,0 +1,14 @@ +file( + name="logging_console", + source="console.conf", +) + +files( + name="logging", + sources=["logging*.conf"], +) + +files( + name="logging_syslog", + sources=["syslog*.conf"], +) diff --git a/st2api/conf/BUILD b/st2api/conf/BUILD new file mode 100644 index 0000000000..9c3668885c --- /dev/null +++ b/st2api/conf/BUILD @@ -0,0 +1,19 @@ +file( + name="logging_console", + source="console.conf", +) + +file( + name="logging", + source="logging.conf", +) + +file( + name="logging_gunicorn", + source="logging.gunicorn.conf", +) + +file( + name="logging_syslog", + source="syslog.conf", +) diff --git a/st2api/tests/integration/BUILD b/st2api/tests/integration/BUILD index 57341b1358..9cd1d7c3e2 100644 --- a/st2api/tests/integration/BUILD +++ b/st2api/tests/integration/BUILD @@ -1,3 +1,6 @@ python_tests( name="tests", + dependencies=[ + "conf/st2.tests.conf:st2_tests_conf", + ], ) diff --git a/st2auth/conf/BUILD b/st2auth/conf/BUILD new file mode 100644 index 0000000000..8fd094d9fa --- /dev/null +++ b/st2auth/conf/BUILD @@ -0,0 +1,29 @@ +file( + name="apache_sample_conf", + source="apache.sample.conf", +) + +file( + name="htpasswd", + source="htpasswd_dev", +) + +file( + name="logging_console", + source="console.conf", +) + +file( + name="logging", + source="logging.conf", +) + +file( + name="logging_gunicorn", + source="logging.gunicorn.conf", +) + +file( + name="logging_syslog", + source="syslog.conf", +) diff --git a/st2common/tests/integration/BUILD b/st2common/tests/integration/BUILD index 0eea8b1cf1..fc4f20c403 100644 --- a/st2common/tests/integration/BUILD +++ b/st2common/tests/integration/BUILD @@ -2,4 +2,9 @@ python_sources() python_tests( name="tests", + dependencies=[ + # used by test_register_content_script + "conf/st2.tests.conf:st2_tests_conf", + "conf/st2.tests1.conf:st2_tests_conf", + ], ) diff --git a/st2reactor/conf/BUILD b/st2reactor/conf/BUILD new file mode 100644 index 0000000000..57246fe48d --- /dev/null +++ b/st2reactor/conf/BUILD @@ -0,0 +1,14 @@ +file( + name="logging_console", + source="console.conf", +) + +files( + name="logging", + sources=["logging*.conf"], +) + +files( + name="logging_syslog", + sources=["syslog*.conf"], +) diff --git a/st2reactor/tests/integration/BUILD b/st2reactor/tests/integration/BUILD index 57341b1358..c0a9372515 100644 --- a/st2reactor/tests/integration/BUILD +++ b/st2reactor/tests/integration/BUILD @@ -1,3 +1,7 @@ python_tests( name="tests", + dependencies=[ + "conf/st2.tests.conf:st2_tests_conf", + "conf/st2.tests2.conf:st2_tests_conf", + ], ) diff --git a/st2stream/conf/BUILD b/st2stream/conf/BUILD new file mode 100644 index 0000000000..9c3668885c --- /dev/null +++ b/st2stream/conf/BUILD @@ -0,0 +1,19 @@ +file( + name="logging_console", + source="console.conf", +) + +file( + name="logging", + source="logging.conf", +) + +file( + name="logging_gunicorn", + source="logging.gunicorn.conf", +) + +file( + name="logging_syslog", + source="syslog.conf", +) diff --git a/st2tests/conf/BUILD b/st2tests/conf/BUILD index 8a3136d774..11adb94865 100644 --- a/st2tests/conf/BUILD +++ b/st2tests/conf/BUILD @@ -1,19 +1,24 @@ -files( +file( name="st2.conf", - sources=["st2.conf"], + source="st2.conf", ) -files( +file( name="st2_kvstore_tests.crypto.key.json", - sources=["st2_kvstore_tests.crypto.key.json"], + source="st2_kvstore_tests.crypto.key.json", ) -files( +file( name="logging.conf", - sources=["logging.conf"], + source="logging.conf", ) files( name="other-logging-conf", sources=["logging.*.conf"], ) + +file( + name="vagrant_ssh_key", + source="vagrant.privkey.insecure", +) diff --git a/st2tests/integration/BUILD b/st2tests/integration/BUILD index a00e23342c..f289067c07 100644 --- a/st2tests/integration/BUILD +++ b/st2tests/integration/BUILD @@ -8,6 +8,7 @@ shell_sources( name="shell", dependencies=[ "st2tests/conf:st2.conf", + "st2tests/conf:vagrant_ssh_key", ], skip_shellcheck=True, ) diff --git a/st2tests/st2tests/fixtures/conf/BUILD b/st2tests/st2tests/fixtures/conf/BUILD index 5d72716860..df80bc70a6 100644 --- a/st2tests/st2tests/fixtures/conf/BUILD +++ b/st2tests/st2tests/fixtures/conf/BUILD @@ -1,12 +1,14 @@ resources( name="st2.tests.conf", - sources=["st2.tests*.conf"], - dependencies=["st2tests/conf:other-logging-conf"], -) - -files( - name="logging-conf", - sources=["logging.*.conf"], + sources=[ + "st2.tests*.conf", + "logging.*.conf", # used by st2.tests*.conf + ], + dependencies=[ + "st2tests/conf:other-logging-conf", + # depending on st2auth from st2tests is not nice. + "st2auth/conf:htpasswd", + ], ) python_sources( diff --git a/tools/BUILD b/tools/BUILD index aa957dfd72..17e8df14c8 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -7,4 +7,7 @@ shell_sources( "st2-setup-*", ], skip_shellcheck=True, + dependencies=[ + "conf:st2_dev_conf", + ], ) From 38165f0f193d5de57f9cf755345090dfe9583c0d Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Sat, 10 Dec 2022 01:51:19 -0600 Subject: [PATCH 15/26] pants: more precise dependencies in st2common/st2common/bootstrap/BUILD --- st2common/st2common/bootstrap/BUILD | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/st2common/st2common/bootstrap/BUILD b/st2common/st2common/bootstrap/BUILD index e85d7581b5..37d827b2f1 100644 --- a/st2common/st2common/bootstrap/BUILD +++ b/st2common/st2common/bootstrap/BUILD @@ -1,5 +1,9 @@ python_sources( - dependencies=[ - "st2common/st2common/policies/meta:policies_meta", - ] + overrides={ + "policiesregistrar.py": { + "dependencies": [ + "st2common/st2common/policies/meta:policies_meta", + ], + }, + }, ) From d9946553abd6c74b774368fd808d71278557bb2a Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 31 May 2021 12:18:19 -0500 Subject: [PATCH 16/26] pants: add st2tests.fixtures.keyczar_keys resources target --- st2tests/st2tests/fixtures/keyczar_keys/BUILD | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/st2tests/st2tests/fixtures/keyczar_keys/BUILD b/st2tests/st2tests/fixtures/keyczar_keys/BUILD index db46e8d6c9..c92ebca906 100644 --- a/st2tests/st2tests/fixtures/keyczar_keys/BUILD +++ b/st2tests/st2tests/fixtures/keyczar_keys/BUILD @@ -1 +1,8 @@ -python_sources() +resources( + name="artifacts", + sources=["*.json"], +) + +python_sources( + dependencies=[":artifacts"], +) From 53394fd1688e2303d0ad25d3de51a5ab950ae363 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 1 Jun 2021 21:18:55 -0500 Subject: [PATCH 17/26] pants: Update executions fixture metadata so the fixture is actually included --- st2tests/st2tests/fixtures/packs/executions/BUILD | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/st2tests/st2tests/fixtures/packs/executions/BUILD b/st2tests/st2tests/fixtures/packs/executions/BUILD index db46e8d6c9..46408a38dc 100644 --- a/st2tests/st2tests/fixtures/packs/executions/BUILD +++ b/st2tests/st2tests/fixtures/packs/executions/BUILD @@ -1 +1,8 @@ -python_sources() +resources( + name="artifacts", + sources=["*.yaml"], +) + +python_sources( + dependencies=[":artifacts"], +) From 26212707bf22f48a75c7f954b1fbbd1a5442f3df Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 31 May 2021 12:20:27 -0500 Subject: [PATCH 18/26] pants: add openapi_specs target in st2tests/fixtures/specs --- st2tests/st2tests/fixtures/specs/BUILD | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 st2tests/st2tests/fixtures/specs/BUILD diff --git a/st2tests/st2tests/fixtures/specs/BUILD b/st2tests/st2tests/fixtures/specs/BUILD new file mode 100644 index 0000000000..090f612588 --- /dev/null +++ b/st2tests/st2tests/fixtures/specs/BUILD @@ -0,0 +1,4 @@ +resource( + name="openapi_specs", + source="openapi.yaml.j2", +) From e3dc578d30415a120619ff1e108ad28129245fdb Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 31 May 2021 12:24:54 -0500 Subject: [PATCH 19/26] pants: add st2tests.fitures.ssl_certs resources target --- st2tests/st2tests/fixtures/ssl_certs/BUILD | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/st2tests/st2tests/fixtures/ssl_certs/BUILD b/st2tests/st2tests/fixtures/ssl_certs/BUILD index db46e8d6c9..f2f2904594 100644 --- a/st2tests/st2tests/fixtures/ssl_certs/BUILD +++ b/st2tests/st2tests/fixtures/ssl_certs/BUILD @@ -1 +1,15 @@ -python_sources() +resources( + name="artifacts", + sources=[ + "**/*.cer", + "**/*.cnf", + "**/*.p12", + "**/*.pem", + "ca/index.txt*", + "ca/serial*", + ], +) + +python_sources( + dependencies=[":artifacts"], +) From 802717b74081a1a921fe602acd6e834ebc83963c Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Tue, 8 Jun 2021 16:07:46 -0500 Subject: [PATCH 20/26] Tell pants about chatops test fixtures --- contrib/chatops/tests/BUILD | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/chatops/tests/BUILD b/contrib/chatops/tests/BUILD index 86783f843c..e00129e8ce 100644 --- a/contrib/chatops/tests/BUILD +++ b/contrib/chatops/tests/BUILD @@ -1,3 +1,10 @@ +files( + name="fixtures", + sources=["fixtures/*.json"], +) + python_tests( + name="tests", + dependencies=[":fixtures"], skip_pylint=True, ) From 442faea7b1ffc3ea8d9970b55449b5d85150975b Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 14 Jun 2021 15:19:36 -0500 Subject: [PATCH 21/26] pants: Inform pants about powershell fixture --- contrib/runners/winrm_runner/tests/unit/fixtures/BUILD | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/runners/winrm_runner/tests/unit/fixtures/BUILD b/contrib/runners/winrm_runner/tests/unit/fixtures/BUILD index db46e8d6c9..d121b83f96 100644 --- a/contrib/runners/winrm_runner/tests/unit/fixtures/BUILD +++ b/contrib/runners/winrm_runner/tests/unit/fixtures/BUILD @@ -1 +1,8 @@ -python_sources() +files( + name="powershell", + sources=["*.ps1"], +) + +python_sources( + dependencies=[":powershell"], +) From cabe4106b759c73488d1a1abca6f7c8235c02561 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Sat, 10 Dec 2022 20:44:42 -0600 Subject: [PATCH 22/26] pants: add st2api files --- st2api/st2api/public/BUILD | 5 +++++ st2api/st2api/templates/BUILD | 1 + 2 files changed, 6 insertions(+) create mode 100644 st2api/st2api/public/BUILD create mode 100644 st2api/st2api/templates/BUILD diff --git a/st2api/st2api/public/BUILD b/st2api/st2api/public/BUILD new file mode 100644 index 0000000000..75f7f76214 --- /dev/null +++ b/st2api/st2api/public/BUILD @@ -0,0 +1,5 @@ +files( + sources=[ + "images/*.png", + ], +) diff --git a/st2api/st2api/templates/BUILD b/st2api/st2api/templates/BUILD new file mode 100644 index 0000000000..9e2968ec22 --- /dev/null +++ b/st2api/st2api/templates/BUILD @@ -0,0 +1 @@ +file(source="index.html") From e9c93461bf22e0c8960f179c5b52d97f528a1c95 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Sun, 11 Dec 2022 18:54:10 -0600 Subject: [PATCH 23/26] pants: be more consistent in naming targets with _ over - No technical reason. Just trying to be more consistent. --- conf/BUILD | 2 +- st2client/tests/fixtures/BUILD | 2 +- st2client/tests/unit/BUILD | 2 +- st2tests/conf/BUILD | 2 +- st2tests/st2tests/fixtures/conf/BUILD | 2 +- st2tests/st2tests/policies/meta/BUILD | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/conf/BUILD b/conf/BUILD index ac66a6bbb8..c434d58228 100644 --- a/conf/BUILD +++ b/conf/BUILD @@ -32,7 +32,7 @@ files( "st2auth/conf:htpasswd", "st2actions/conf:logging", "st2reactor/conf:logging", - "st2tests/conf:other-logging-conf", + "st2tests/conf:other_logging_conf", ], ) diff --git a/st2client/tests/fixtures/BUILD b/st2client/tests/fixtures/BUILD index 46d6247fa8..86e1157f5a 100644 --- a/st2client/tests/fixtures/BUILD +++ b/st2client/tests/fixtures/BUILD @@ -4,7 +4,7 @@ resources( ) resources( - name="st2client-ini", + name="st2client_ini", sources=["*.ini"], ) diff --git a/st2client/tests/unit/BUILD b/st2client/tests/unit/BUILD index 1877fa7e1c..4af5ab5d8d 100644 --- a/st2client/tests/unit/BUILD +++ b/st2client/tests/unit/BUILD @@ -1,7 +1,7 @@ python_tests( name="tests", dependencies=[ - "st2client/tests/fixtures:st2client-ini", + "st2client/tests/fixtures:st2client_ini", # most files import tests.base which is ambiguous. Tell pants which one to use. "st2client/tests/base.py", ], diff --git a/st2tests/conf/BUILD b/st2tests/conf/BUILD index 11adb94865..72352b12b1 100644 --- a/st2tests/conf/BUILD +++ b/st2tests/conf/BUILD @@ -14,7 +14,7 @@ file( ) files( - name="other-logging-conf", + name="other_logging_conf", sources=["logging.*.conf"], ) diff --git a/st2tests/st2tests/fixtures/conf/BUILD b/st2tests/st2tests/fixtures/conf/BUILD index df80bc70a6..5674cea485 100644 --- a/st2tests/st2tests/fixtures/conf/BUILD +++ b/st2tests/st2tests/fixtures/conf/BUILD @@ -5,7 +5,7 @@ resources( "logging.*.conf", # used by st2.tests*.conf ], dependencies=[ - "st2tests/conf:other-logging-conf", + "st2tests/conf:other_logging_conf", # depending on st2auth from st2tests is not nice. "st2auth/conf:htpasswd", ], diff --git a/st2tests/st2tests/policies/meta/BUILD b/st2tests/st2tests/policies/meta/BUILD index 39cb33775a..20f3688a97 100644 --- a/st2tests/st2tests/policies/meta/BUILD +++ b/st2tests/st2tests/policies/meta/BUILD @@ -1,4 +1,4 @@ resources( - name="policies-meta", + name="policies_meta", sources=["*.yaml"], ) From 95bdd9e7ebe0c9fa621bfa3c551a4ea2b1104753 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Sun, 11 Dec 2022 20:14:36 -0600 Subject: [PATCH 24/26] pants: prefer 'assets' as target name 'artifacts' refers more to distributable stuff like wheels. 'assets' encompasses 'file' and 'resource' targets. --- scripts/github/BUILD | 4 ++-- st2tests/st2tests/fixtures/history_views/BUILD | 4 ++-- st2tests/st2tests/fixtures/keyczar_keys/BUILD | 4 ++-- st2tests/st2tests/fixtures/ssl_certs/BUILD | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/github/BUILD b/scripts/github/BUILD index f5a89decc1..714f976026 100644 --- a/scripts/github/BUILD +++ b/scripts/github/BUILD @@ -1,5 +1,5 @@ files( - name="artifacts", + name="assets", sources=[ "*.txt", "*.conf", @@ -7,5 +7,5 @@ files( ) shell_sources( - dependencies=[":artifacts"], + dependencies=[":assets"], ) diff --git a/st2tests/st2tests/fixtures/history_views/BUILD b/st2tests/st2tests/fixtures/history_views/BUILD index 46408a38dc..a724ff3786 100644 --- a/st2tests/st2tests/fixtures/history_views/BUILD +++ b/st2tests/st2tests/fixtures/history_views/BUILD @@ -1,8 +1,8 @@ resources( - name="artifacts", + name="assets", sources=["*.yaml"], ) python_sources( - dependencies=[":artifacts"], + dependencies=[":assets"], ) diff --git a/st2tests/st2tests/fixtures/keyczar_keys/BUILD b/st2tests/st2tests/fixtures/keyczar_keys/BUILD index c92ebca906..63a281f0b7 100644 --- a/st2tests/st2tests/fixtures/keyczar_keys/BUILD +++ b/st2tests/st2tests/fixtures/keyczar_keys/BUILD @@ -1,8 +1,8 @@ resources( - name="artifacts", + name="assets", sources=["*.json"], ) python_sources( - dependencies=[":artifacts"], + dependencies=[":assets"], ) diff --git a/st2tests/st2tests/fixtures/ssl_certs/BUILD b/st2tests/st2tests/fixtures/ssl_certs/BUILD index f2f2904594..d5c05d1ede 100644 --- a/st2tests/st2tests/fixtures/ssl_certs/BUILD +++ b/st2tests/st2tests/fixtures/ssl_certs/BUILD @@ -1,5 +1,5 @@ resources( - name="artifacts", + name="assets", sources=[ "**/*.cer", "**/*.cnf", @@ -11,5 +11,5 @@ resources( ) python_sources( - dependencies=[":artifacts"], + dependencies=[":assets"], ) From 7663c79a8bd8ec2492b3b905c3537fd1d7879194 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Sun, 11 Dec 2022 21:59:35 -0600 Subject: [PATCH 25/26] include BUILD file in test's file list --- st2common/tests/unit/test_util_file_system.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/st2common/tests/unit/test_util_file_system.py b/st2common/tests/unit/test_util_file_system.py index e36fa85301..9ae8d1bc7a 100644 --- a/st2common/tests/unit/test_util_file_system.py +++ b/st2common/tests/unit/test_util_file_system.py @@ -34,6 +34,7 @@ def test_get_file_list(self): "mock_exception.py", "concurrency.py", "__init__.py", + "meta/BUILD", "meta/mock_exception.yaml", "meta/concurrency.yaml", "meta/__init__.py", @@ -49,6 +50,6 @@ def test_get_file_list(self): "meta/__init__.py", ] result = get_file_list( - directory=directory, exclude_patterns=["*.pyc", "*.yaml", "BUILD"] + directory=directory, exclude_patterns=["*.pyc", "*.yaml", "*BUILD"] ) self.assertItemsEqual(expected, result) From e0119dc174fe8bdbe5eec9f382a52a2e52e7581b Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Sun, 11 Dec 2022 21:03:50 -0600 Subject: [PATCH 26/26] update changelog entry --- CHANGELOG.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7d456f91f5..b324f52a6e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,7 @@ Added working on StackStorm, improve our security posture, and improve CI reliability thanks in part to pants' use of PEX lockfiles. This is not a user-facing addition. #5778 #5789 #5817 #5795 #5830 #5833 #5834 #5841 #5840 #5838 #5842 #5837 #5849 #5850 + #5846 Contributed by @cognifloyd * Added a joint index to solve the problem of slow mongo queries for scheduled executions. #5805