Skip to content

Conversation

@cognifloyd
Copy link
Member

Background

This is another part of introducing pants, as discussed in various TSC meetings.

Related PRs can be found in:

Overview of this PR

This is primarily a follow-up to:

Unlike the simple BUILD config added in #5846, this PR refactors one constant so that pants can better use python imports to precisely detect who needs st2common/st2common/conf/base.logging.conf.

Before this PR, anything that uses any of the constants had a hard-coded dependency on base.logging.conf:

python_sources(
dependencies=[
"st2common/st2common/conf:base.logging.conf",

After this PR, each file will only get an inferred dependency if it actually imports the DEFAULT_LOGGING_CONF_PATH constant that refers to that file.

This also has the benefit of moving the constant calculation closer to the file it references. But, it still maintains backwards compatibility by also making the constant available in the old location.

@cognifloyd cognifloyd added this to the pants milestone Jan 5, 2023
@cognifloyd cognifloyd requested review from a team, amanda11, arm4b, nzlosh, rush-skills and winem January 5, 2023 06:20
@cognifloyd cognifloyd self-assigned this Jan 5, 2023
@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines. Good size to review. label Jan 5, 2023
@cognifloyd cognifloyd requested review from a team and amanda11 January 5, 2023 17:12
Copy link
Contributor

@amanda11 amanda11 left a comment

Choose a reason for hiding this comment

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

LGTM

@cognifloyd cognifloyd requested a review from a team January 5, 2023 17:46
@cognifloyd cognifloyd enabled auto-merge (squash) January 5, 2023 18:10
@cognifloyd cognifloyd merged commit 09191a2 into master Jan 10, 2023
@cognifloyd cognifloyd deleted the pants-BASE_LOGGING_CONF_PATH branch January 10, 2023 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pantsbuild refactor size/M PR that changes 30-99 lines. Good size to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants