Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
284ebf2
register st2common resources for pants
cognifloyd Apr 13, 2021
d1d6269
pants: add some files targets for conf files
cognifloyd May 17, 2021
ab9531e
pants: add resources for st2client unit tests
cognifloyd May 18, 2021
fcec7ea
pants: include runner.yaml files
cognifloyd May 20, 2021
26990c7
pants: add yaml files to st2tests.fixtures.history_views
cognifloyd Dec 10, 2022
204ae8d
pants: register rbac fixtures
cognifloyd Jun 2, 2021
3d46db9
pants: add files targets for benchmarks
cognifloyd May 17, 2021
f395cf0
pants: add yaml files to st2tests.policies.meta
cognifloyd Dec 10, 2022
36336c6
pants: add files targets for st2tests resources
cognifloyd May 17, 2021
65f6072
pants: add dependency on st2tests.fixtures.conf files
cognifloyd Jun 2, 2021
8ca1594
tell pants that fixture packs need their configs
cognifloyd Jun 2, 2021
2ae29a6
pants: add resources target for st2reactor test fixtures
cognifloyd Jun 8, 2021
248d8d8
pants: Add resources in scripts/github/
cognifloyd Jun 9, 2021
8578c30
pants: Inform pants about conf files
cognifloyd Jun 12, 2021
38165f0
pants: more precise dependencies in st2common/st2common/bootstrap/BUILD
cognifloyd Dec 10, 2022
d994655
pants: add st2tests.fixtures.keyczar_keys resources target
cognifloyd May 31, 2021
53394fd
pants: Update executions fixture metadata so the fixture is actually …
cognifloyd Jun 2, 2021
2621270
pants: add openapi_specs target in st2tests/fixtures/specs
cognifloyd May 31, 2021
e3dc578
pants: add st2tests.fitures.ssl_certs resources target
cognifloyd May 31, 2021
802717b
Tell pants about chatops test fixtures
cognifloyd Jun 8, 2021
442faea
pants: Inform pants about powershell fixture
cognifloyd Jun 14, 2021
cabe410
pants: add st2api files
cognifloyd Dec 11, 2022
e9c9346
pants: be more consistent in naming targets with _ over -
cognifloyd Dec 12, 2022
95bdd9e
pants: prefer 'assets' as target name
cognifloyd Dec 12, 2022
7663c79
include BUILD file in test's file list
cognifloyd Dec 12, 2022
e0119dc
update changelog entry
cognifloyd Dec 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
56 changes: 56 additions & 0 deletions conf/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
file(
name="st2client_sample_config",
source="st2rc.sample.ini",
)

file(
name="st2.conf.sample",
source="st2.conf.sample",
)
Comment on lines +6 to +9
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A future PR will add pants-plugins/sample_conf which will wire this up so that it gets regenerated whenever someone runs the fmt goal with something like: ./pants fmt conf/st2.conf.sample. That will take advantage of the fine-grained caching so that this always gets updated when the files used to generate it change.


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",
)
7 changes: 7 additions & 0 deletions contrib/chatops/tests/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
files(
name="fixtures",
sources=["fixtures/*.json"],
)

python_tests(
name="tests",
dependencies=[":fixtures"],
skip_pylint=True,
)
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
python_sources()
resource(
name="runner_metadata",
source="runner.yaml",
)

python_sources(
dependencies=[":runner_metadata"],
)
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
python_sources()
resource(
name="runner_metadata",
source="runner.yaml",
)

python_sources(
dependencies=[":runner_metadata"],
)
9 changes: 8 additions & 1 deletion contrib/runners/http_runner/http_runner/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
python_sources()
resource(
name="runner_metadata",
source="runner.yaml",
)

python_sources(
dependencies=[":runner_metadata"],
)
9 changes: 8 additions & 1 deletion contrib/runners/inquirer_runner/inquirer_runner/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
python_sources()
resource(
name="runner_metadata",
source="runner.yaml",
)

python_sources(
dependencies=[":runner_metadata"],
)
9 changes: 8 additions & 1 deletion contrib/runners/local_runner/local_runner/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
python_sources()
resource(
name="runner_metadata",
source="runner.yaml",
)

python_sources(
dependencies=[":runner_metadata"],
)
9 changes: 8 additions & 1 deletion contrib/runners/noop_runner/noop_runner/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
python_sources()
resource(
name="runner_metadata",
source="runner.yaml",
)

python_sources(
dependencies=[":runner_metadata"],
)
9 changes: 8 additions & 1 deletion contrib/runners/orquesta_runner/orquesta_runner/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
python_sources()
resource(
name="runner_metadata",
source="runner.yaml",
)

python_sources(
dependencies=[":runner_metadata"],
)
9 changes: 8 additions & 1 deletion contrib/runners/python_runner/python_runner/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
python_sources()
resource(
name="runner_metadata",
source="runner.yaml",
)

python_sources(
dependencies=[":runner_metadata"],
)
9 changes: 8 additions & 1 deletion contrib/runners/remote_runner/remote_runner/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
python_sources()
resource(
name="runner_metadata",
source="runner.yaml",
)

python_sources(
dependencies=[":runner_metadata"],
)
9 changes: 8 additions & 1 deletion contrib/runners/winrm_runner/tests/unit/fixtures/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
python_sources()
files(
name="powershell",
sources=["*.ps1"],
)

python_sources(
dependencies=[":powershell"],
)
9 changes: 8 additions & 1 deletion contrib/runners/winrm_runner/winrm_runner/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
python_sources()
resource(
name="runner_metadata",
source="runner.yaml",
)

python_sources(
dependencies=[":runner_metadata"],
)
12 changes: 11 additions & 1 deletion scripts/github/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
shell_sources()
files(
name="assets",
sources=[
"*.txt",
"*.conf",
],
)

shell_sources(
dependencies=[":assets"],
)
14 changes: 14 additions & 0 deletions st2actions/conf/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
file(
name="logging_console",
source="console.conf",
)

files(
name="logging",
sources=["logging*.conf"],
)

files(
name="logging_syslog",
sources=["syslog*.conf"],
)
19 changes: 19 additions & 0 deletions st2api/conf/BUILD
Original file line number Diff line number Diff line change
@@ -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",
)
5 changes: 5 additions & 0 deletions st2api/st2api/public/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
files(
sources=[
"images/*.png",
],
)
1 change: 1 addition & 0 deletions st2api/st2api/templates/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
file(source="index.html")
3 changes: 3 additions & 0 deletions st2api/tests/integration/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
python_tests(
name="tests",
dependencies=[
"conf/st2.tests.conf:st2_tests_conf",
],
)
29 changes: 29 additions & 0 deletions st2auth/conf/BUILD
Original file line number Diff line number Diff line change
@@ -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",
)
14 changes: 13 additions & 1 deletion st2client/tests/fixtures/BUILD
Original file line number Diff line number Diff line change
@@ -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"],
)
1 change: 1 addition & 0 deletions st2client/tests/unit/BUILD
Original file line number Diff line number Diff line change
@@ -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",
],
Expand Down
3 changes: 3 additions & 0 deletions st2common/benchmarks/fixtures/json/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
files(
sources=["*.json"],
)
1 change: 1 addition & 0 deletions st2common/benchmarks/micro/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
python_sources(
dependencies=["st2common/benchmarks/fixtures/json"],
skip_pylint=True,
)

Expand Down
12 changes: 11 additions & 1 deletion st2common/st2common/BUILD
Original file line number Diff line number Diff line change
@@ -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"],
)
Comment on lines +8 to +11
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A future PR will add pants-plugins/api_spec which will wire this up so that it gets regenerated whenever someone runs the fmt goal with something like: ./pants fmt st2common/st2comon/openapi.yaml. That will take advantage of the fine-grained caching so that openapi.yaml always gets updated when the files used to generate it change.

10 changes: 9 additions & 1 deletion st2common/st2common/bootstrap/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
python_sources()
python_sources(
overrides={
"policiesregistrar.py": {
"dependencies": [
"st2common/st2common/policies/meta:policies_meta",
],
},
},
)
5 changes: 5 additions & 0 deletions st2common/st2common/conf/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# used in st2common.constants.logging.DEFAULT_LOGGING_CONF_PATH
resource(
name="base.logging.conf",
source="base.logging.conf",
)
6 changes: 5 additions & 1 deletion st2common/st2common/constants/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
python_sources()
python_sources(
dependencies=[
"st2common/st2common/conf:base.logging.conf",
]
)
5 changes: 5 additions & 0 deletions st2common/st2common/policies/meta/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These are loaded by st2common.bootstrap.policiesregistrar
resources(
name="policies_meta",
sources=["*.yaml"],
)
11 changes: 10 additions & 1 deletion st2common/st2common/util/schema/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
python_sources()
python_sources(
dependencies=[
":jsonschema",
]
)

resources(
name="jsonschema",
sources=["*.json"],
)
Comment on lines +1 to +10
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required before I can submit the pants plugin that wires up pants to manage building the schemas in contrib/schemas.

5 changes: 5 additions & 0 deletions st2common/tests/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)
3 changes: 2 additions & 1 deletion st2common/tests/unit/test_util_file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)
Loading