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

Add remote_oauth_bearer_token option, deprecating remote_oauth_bearer_token_path #20116

Merged
merged 3 commits into from
Nov 21, 2023

Conversation

huonw
Copy link
Contributor

@huonw huonw commented Oct 29, 2023

This adds a new global option remote_oauth_bearer_token, that allows setting the remote store OAuth token directly. This is easier to work with in CI contexts (and similar), where setting an environment variable is often quite simple, and having a direct option allows setting this via PANTS_REMOTE_OAUTH_BEARER_TOKEN.

For instance, it simplifies how one can configure the token for the GitHub Actions Cache remote cache provider.

I believe this replaces remote_oauth_bearer_token_path fully: I think remote_oauth_bearer_token_path = "/path/to/token.txt" can become remote_oauth_bearer_token = "@/path/to/token.txt". Thus, I have deprecated the ..._path option, for removal in a couple of versions.

(This is part of #19902.)

Copy link
Contributor

@tgolsson tgolsson left a comment

Choose a reason for hiding this comment

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

Nice, no major complaints from my side! A bit messy with the temporary dict to check for which variants are enabled, but I think it's mostly the variable name lengths that cause that due to the extra line breaks + casting.

@huonw
Copy link
Contributor Author

huonw commented Nov 21, 2023

I'm gonna get this in. It'll be in 2.20 (~12 weeks away, at least?), so lots of time to undo if I've got something wonky here.

@huonw huonw merged commit 924076e into main Nov 21, 2023
@huonw huonw deleted the huonw/19902-token-option branch November 21, 2023 21:52
huonw added a commit that referenced this pull request Feb 27, 2024
…n=partial (#20616)

There were three deprecations originally scheduled for 2.21 (#20609),
two of will have only been deprecated for one release, and aren't a
significant burden to support, so we can ease users life for a little
longer:

| description                                          | deprecation started in | what could be removed                                                                           |
|------------------------------------------------------|------------------------|-------------------------------------------------------------------------------------------------|
| the `[GLOBAL].remote_oauth_bearer_token_path` option | 2.20.0.dev1 (#20116)   | configuration for the option, plus some a few small `if` statements, all in `global_options.py` |
| passing `crossversion="partial"` for scala artifacts | 2.20.0 (#20264) ^      | an extra enum variant, and a test                                                               |

^ NB. due to an easy-to-make misuse of `start_version` I believe people will only be getting the deprecation warnings in 2.20.0 stable, not any of the release candidates.

The third (`python_awslambda`) is removed in #20619.
WorkerPants pushed a commit that referenced this pull request Feb 27, 2024
…n=partial (#20616)

There were three deprecations originally scheduled for 2.21 (#20609),
two of will have only been deprecated for one release, and aren't a
significant burden to support, so we can ease users life for a little
longer:

| description                                          | deprecation started in | what could be removed                                                                           |
|------------------------------------------------------|------------------------|-------------------------------------------------------------------------------------------------|
| the `[GLOBAL].remote_oauth_bearer_token_path` option | 2.20.0.dev1 (#20116)   | configuration for the option, plus some a few small `if` statements, all in `global_options.py` |
| passing `crossversion="partial"` for scala artifacts | 2.20.0 (#20264) ^      | an extra enum variant, and a test                                                               |

^ NB. due to an easy-to-make misuse of `start_version` I believe people will only be getting the deprecation warnings in 2.20.0 stable, not any of the release candidates.

The third (`python_awslambda`) is removed in #20619.
huonw added a commit that referenced this pull request Feb 27, 2024
…n=partial (Cherry-pick of #20616) (#20623)

There were three deprecations originally scheduled for 2.21 (#20609),
two of will have only been deprecated for one release, and aren't a
significant burden to support, so we can ease users life for a little
longer:

| description                                          | deprecation started in | what could be removed                                                                           |
|------------------------------------------------------|------------------------|-------------------------------------------------------------------------------------------------|
| the `[GLOBAL].remote_oauth_bearer_token_path` option | 2.20.0.dev1 (#20116)   | configuration for the option, plus some a few small `if` statements, all in `global_options.py` |
| passing `crossversion="partial"` for scala artifacts | 2.20.0 (#20264) ^      | an extra enum variant, and a test                                                               |

^ NB. due to an easy-to-make misuse of `start_version` I believe people will only be getting the deprecation warnings in 2.20.0 stable, not any of the release candidates

The third (`python_awslambda`) is removed in #20619.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants