Skip to content

Use org auth token in JS and Sentry CLI docs #7714

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

Merged
merged 12 commits into from
Sep 1, 2023

Conversation

lforst
Copy link
Contributor

@lforst lforst commented Aug 31, 2023

Updates the docs for JavaScript and Sentry CLI source maps upload to use org auth tokens when applicable.

Closes getsentry/team-webplatform-meta#62

@vercel
Copy link

vercel bot commented Aug 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs 🛑 Canceled (Inspect) Sep 1, 2023 10:46am

@lforst lforst requested review from mydea and Lms24 August 31, 2023 09:01
@lforst lforst self-assigned this Aug 31, 2023
@@ -28,7 +28,7 @@ sentry-cli --url https://myserver.invalid/ login

## To authenticate manually:

Visit your [auth token user settings page](https://sentry.io/settings/account/api/auth-tokens/) and create or copy an existing token. Then either:
Visit the [Organization Auth Token Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/) and create a new token or copy an existing one. Then either:
Copy link
Member

Choose a reason for hiding this comment

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

m: You can't copy an existing one anymore 😅 so:

Suggested change
Visit the [Organization Auth Token Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/) and create a new token or copy an existing one. Then either:
Visit the [Organization Auth Token Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/) and create a new token. Then either:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah right

Comment on lines 18 to 20
SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
SENTRY_ORG=___ORG_SLUG___
SENTRY_PROJECT=___PROJECT_SLUG___
Copy link
Member

Choose a reason for hiding this comment

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

we should move always move this below the org/project slug, as in the UI they are kind of coupled together - selecting the org/project influences where you create the token for. So IMHO it is a better flow to always make this:

Suggested change
SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
SENTRY_ORG=___ORG_SLUG___
SENTRY_PROJECT=___PROJECT_SLUG___
SENTRY_ORG=___ORG_SLUG___
SENTRY_PROJECT=___PROJECT_SLUG___
SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___

Visit the [auth token user settings page](https://sentry.io/settings/account/api/auth-tokens/) to find your auth tokens.

</Note>
<OrgAuthTokenNote />

<SignInNote />
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<SignInNote />

OrgAuthTokenNote is kind of a more detailed version of SignInNote, so when we show this we can skip the sign in note!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The sign in note needs to come before every instance where we use ___ORG_SLUG___ or ___PROJECT_SLUG___.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They describe two different things

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I guess it's true... but - it's a bit weird to have two of these note boxes over each other that both show similar-but-not-quite-the-same info 🤔

What about just updating the not-signed-in test of the <OrgAuthTokenNote> from:

You can manually create an Auth Token or sign in to create a token directly from the docs.

to something like

You can manually create an Auth Token or sign in to create a token directly from the docs. Once you sign in, you will be able to select your personal config from a dropdown.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With #7716 we can make this all a bit more cleaner

@@ -197,7 +197,7 @@ You can set them as environment variables, for example in a `.env` file:

- `SENTRY_ORG` your Sentry org slug
- `SENTRY_PROJECT` your Sentry project slug
- `SENTRY_AUTH_TOKEN` your Sentry auth token
- `SENTRY_AUTH_TOKEN` your Sentry auth token (can be obtained from https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- `SENTRY_AUTH_TOKEN` your Sentry auth token (can be obtained from https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/)
- `SENTRY_AUTH_TOKEN` your Sentry auth token (can be obtained from [your Organization Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/))

Maybe something like this? The link is kind of ugly...

Copy link
Contributor

@lizokm lizokm left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -129,7 +129,7 @@ module.exports = {
org: "___ORG_SLUG___",
project: "___PROJECT_SLUG___",

// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
// Auth tokens can be obtained from the your User Settings
// and need `project:releases` and `org:read` scopes
Copy link
Member

Choose a reason for hiding this comment

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

Whats the reason we are not replacing this with org tokens here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is in the legacy docs. People here may use a self hosted version that is not yet compatible with org auth tokens.

Copy link
Member

Choose a reason for hiding this comment

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

ah, makes sense! 👍

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

:shipit: great work!

@lforst lforst enabled auto-merge (squash) September 1, 2023 10:30
@lforst lforst merged commit 4bce792 into master Sep 1, 2023
@lforst lforst deleted the lforst-org-auth-token-cli-js branch September 1, 2023 10:50
@github-actions github-actions bot locked and limited conversation to collaborators Sep 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOCS] Upload Source Maps
3 participants