Skip to content

Silence the scie-pants version warning when NO_SCIE_WARNING=1#19660

Merged
huonw merged 1 commit intomainfrom
huonw/bugfix/no-warning-in-pants-repo
Aug 24, 2023
Merged

Silence the scie-pants version warning when NO_SCIE_WARNING=1#19660
huonw merged 1 commit intomainfrom
huonw/bugfix/no-warning-in-pants-repo

Conversation

@huonw
Copy link
Copy Markdown
Contributor

@huonw huonw commented Aug 23, 2023

Before this fix, #19654 was causing pants ... commands in the pants repo to explode and not work. This fixes it by silencing them in the pants repo, keying off the existing NO_SCIE_WARNING=1 mechanism.

Running scie-pants in the pants repo goes through a special bootstrap mechanism, that's bootstrapped outside the scie-pants processing on purpose. This in particular means that the scie-pants version check from #19600 / #19654 doesn't work, because it's not invoked via that mechanism. Fortunately, this can just be treated the same as the "am I running in scie-pants at all?" check, looking for the env var set by the pants repo bootstrapper.

The version check has to be strict about the SCIE_PANTS_VERSION environment variable, and it cannot just do nothing when that's not set. The goal with this check is to help people using upgrade to scie-pants 0.9+ before Pants 2.18 is released, because Pants 2.18 has a new distribution mechanism that's only supported by scie-pants 0.9+ (this is why we needed to land #19654 last minute, to be in Pants 2.17). scie-pants only sets the environment variable in version 0.9 too, so a user using scie-pants 0.8.0 will be running Pants 2.17 without setting SCIE_PANTS_VERSION, and so, to help them upgrade, we have to assume "doesn't exist" = "scie-pants is too old". The pants repo custom bootstrap doesn't set this env var, and hence used to fall into that trap.

@huonw huonw added the category:internal CI, fixes for not-yet-released features, etc. label Aug 23, 2023
@huonw huonw requested review from benjyw and thejcannon August 23, 2023 23:37
@huonw huonw merged commit 1d9886a into main Aug 24, 2023
@huonw huonw deleted the huonw/bugfix/no-warning-in-pants-repo branch August 24, 2023 00:04
@huonw huonw modified the milestones: 2.17.x, 2.18.x Aug 29, 2023
github-actions Bot pushed a commit that referenced this pull request Aug 29, 2023
Before this fix, #19654 was causing `pants ...` commands in the pants
repo to explode and not work. This fixes it by silencing them in the
pants repo, keying off the existing `NO_SCIE_WARNING=1` mechanism.

Running scie-pants in the pants repo goes through a special bootstrap
mechanism, that's bootstrapped outside the scie-pants processing on
purpose. This in particular means that the scie-pants version check from
#19600 / #19654 doesn't work, because it's not invoked via that
mechanism. Fortunately, this can just be treated the same as the "am I
running in scie-pants at all?" check, looking for the env var set by the
pants repo bootstrapper.

The version check has to be strict about the `SCIE_PANTS_VERSION`
environment variable, and it cannot just do nothing when that's not set.
The goal with this check is to help people using upgrade to scie-pants
0.9+ _before_ Pants 2.18 is released, because Pants 2.18 has a new
distribution mechanism that's only supported by scie-pants 0.9+ (this is
why we needed to land #19654 last minute, to be in Pants 2.17).
scie-pants only sets the environment variable in version 0.9 too, so a
user using scie-pants 0.8.0 will be running Pants 2.17 without setting
`SCIE_PANTS_VERSION`, and so, to help them upgrade, we have to assume
"doesn't exist" = "scie-pants is too old". The pants repo custom
bootstrap doesn't set this env var, and hence used to fall into that
trap.
@WorkerPants
Copy link
Copy Markdown
Member

I tried to automatically cherry-pick this change back to each relevant milestone, so that it is available in those older releases of Pants.

✔️ 2.18.x

Successfully opened #19702.


Thanks again for your contributions!

🤖 Beep Boop here's my run link

huonw added a commit that referenced this pull request Aug 29, 2023
…-pick of #19660) (#19702)

Before this fix, #19654 was causing `pants ...` commands in the pants
repo to explode and not work. This fixes it by silencing them in the
pants repo, keying off the existing `NO_SCIE_WARNING=1` mechanism.

Running scie-pants in the pants repo goes through a special bootstrap
mechanism, that's bootstrapped outside the scie-pants processing on
purpose. This in particular means that the scie-pants version check from
#19600 / #19654 doesn't work, because it's not invoked via that
mechanism. Fortunately, this can just be treated the same as the "am I
running in scie-pants at all?" check, looking for the env var set by the
pants repo bootstrapper.

The version check has to be strict about the `SCIE_PANTS_VERSION`
environment variable, and it cannot just do nothing when that's not set.
The goal with this check is to help people using upgrade to scie-pants
0.9+ _before_ Pants 2.18 is released, because Pants 2.18 has a new
distribution mechanism that's only supported by scie-pants 0.9+ (this is
why we needed to land #19654 last minute, to be in Pants 2.17).
scie-pants only sets the environment variable in version 0.9 too, so a
user using scie-pants 0.8.0 will be running Pants 2.17 without setting
`SCIE_PANTS_VERSION`, and so, to help them upgrade, we have to assume
"doesn't exist" = "scie-pants is too old". The pants repo custom
bootstrap doesn't set this env var, and hence used to fall into that
trap.

Co-authored-by: Huon Wilson <huon@exoflare.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:internal CI, fixes for not-yet-released features, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants