Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor DEFAULT_LOGGING_CONF_PATH calculation to allow fine-grained pants dep inference #5858

Merged
merged 4 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +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 #5853 #5848 #5847
#5846 #5853 #5848 #5847 #5858
Contributed by @cognifloyd

* Added a joint index to solve the problem of slow mongo queries for scheduled executions. #5805
Expand Down
4 changes: 4 additions & 0 deletions st2common/st2common/conf/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ resource(
name="base.logging.conf",
source="base.logging.conf",
)

python_sources(
dependencies=[":base.logging.conf"],
)
18 changes: 18 additions & 0 deletions st2common/st2common/conf/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2023 The StackStorm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

CONF_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
BASE_LOGGING_CONF_PATH = os.path.join(CONF_DIR, "base.logging.conf")
6 changes: 1 addition & 5 deletions st2common/st2common/constants/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
python_sources(
dependencies=[
"st2common/st2common/conf:base.logging.conf",
]
)
python_sources()
7 changes: 1 addition & 6 deletions st2common/st2common/constants/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
# limitations under the License.

from __future__ import absolute_import
import os
from st2common.conf import BASE_LOGGING_CONF_PATH as DEFAULT_LOGGING_CONF_PATH

__all__ = ["DEFAULT_LOGGING_CONF_PATH"]

BASE_PATH = os.path.dirname(os.path.abspath(__file__))

DEFAULT_LOGGING_CONF_PATH = os.path.join(BASE_PATH, "../conf/base.logging.conf")
DEFAULT_LOGGING_CONF_PATH = os.path.abspath(DEFAULT_LOGGING_CONF_PATH)