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

detect older versions of scie-pants and emit deprecation warning if too old #19600

Closed
tdyas opened this issue Aug 14, 2023 · 2 comments · Fixed by #19654
Closed

detect older versions of scie-pants and emit deprecation warning if too old #19600

tdyas opened this issue Aug 14, 2023 · 2 comments · Fixed by #19654
Assignees
Milestone

Comments

@tdyas
Copy link
Contributor

tdyas commented Aug 14, 2023

With the source of truth for Pants releases moving to GitHub from PyPi, scie-pants will need to be upgraded to v0.9.x(?) in order to consume GitHub releases. To help inform users, we should consider having Pants detect the scie-pants versions it is running under and emit a deprecation warning to inform the user about the need to upgrade.

@thejcannon thejcannon added this to the 2.17.x milestone Aug 14, 2023
@thejcannon
Copy link
Member

I'm going to add this to 2.17.x unless we decide otherwise so that it doesn't slip through the cracks.

@huonw
Copy link
Contributor

huonw commented Aug 22, 2023

@thejcannon suggests a good place to start for this would be:

if "SCIE" not in os.environ and "NO_SCIE_WARNING" not in os.environ:

I'll see if I have time for this later today.

@huonw huonw self-assigned this Aug 22, 2023
huonw added a commit to pantsbuild/scie-pants that referenced this issue Aug 23, 2023
This sets the `SCIE_PANTS_VERSION` env var when invoking pants, so that
pants can read it and encourage users to upgrade if they need to.

For example, 2.17 will be the last release that supports the PyPI-based
distribution model and Pants 2.18 will require scie-pants 0.9 or
greater. So, in pantsbuild/pants#19600, we're
planning to have pants 2.17 encourage users to upgrade `scie-pants` if
it's too old.

This PR preps for the release too, by bumping the version and adding a
changelog entry. As part of this, I noticed the 0.9.0 release was
accidentally configured as 0.9.1 in Cargo.toml, so updated the changelog
to mention this.
huonw added a commit that referenced this issue Aug 23, 2023
This updates Pants to require and check for the scie-pants launcher
binary version: we need version 0.9 or earlier, to have support for the
new distribution model. This syncs with
pantsbuild/scie-pants#246 (which will become
scie-pants 0.9.2 / 0.9.3), which sets the `SCIE_PANTS_VERSION`
environment variable when running pants.

This will be cherry-picked back as far as we support, to help users
upgrade their launcher earlier.

Fixes #19600
huonw added a commit to huonw/pants that referenced this issue Aug 23, 2023
…uild#19654)

This updates Pants to require and check for the scie-pants launcher
binary version: we need version 0.9 or earlier, to have support for the
new distribution model. This syncs with
pantsbuild/scie-pants#246 (which will become
scie-pants 0.9.2 / 0.9.3), which sets the `SCIE_PANTS_VERSION`
environment variable when running pants.

This will be cherry-picked back as far as we support, to help users
upgrade their launcher earlier.

Fixes pantsbuild#19600
thejcannon pushed a commit that referenced this issue Aug 23, 2023
…-pick of #19654) (#19655)

This updates Pants to require and check for the scie-pants launcher
binary version: we need version 0.9 or earlier, to have support for the
new distribution model. This syncs with
pantsbuild/scie-pants#246 (which will become
scie-pants 0.9.2 / 0.9.3), which sets the `SCIE_PANTS_VERSION`
environment variable when running pants.

This will be cherry-picked back as far as we support, to help users
upgrade their launcher earlier.

Fixes #19600
huonw added a commit that referenced this issue Aug 24, 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.
github-actions bot pushed a commit that referenced this issue Aug 29, 2023
This updates Pants to require and check for the scie-pants launcher
binary version: we need version 0.9 or earlier, to have support for the
new distribution model. This syncs with
pantsbuild/scie-pants#246 (which will become
scie-pants 0.9.2 / 0.9.3), which sets the `SCIE_PANTS_VERSION`
environment variable when running pants.

This will be cherry-picked back as far as we support, to help users
upgrade their launcher earlier.

Fixes #19600
huonw added a commit that referenced this issue Aug 29, 2023
…-pick of #19654) (#19694)

This updates Pants to require and check for the scie-pants launcher
binary version: we need version 0.9 or later, to have support for the
new distribution model. This syncs with
pantsbuild/scie-pants#246 (which will become
scie-pants 0.9.2 / 0.9.3), which sets the `SCIE_PANTS_VERSION`
environment variable when running pants.

This will be cherry-picked back as far as we support, to help users
upgrade their launcher earlier.

Fixes #19600

Co-authored-by: Huon Wilson <huon@exoflare.io>
github-actions bot pushed a commit that referenced this issue 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.
huonw added a commit that referenced this issue 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
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants