Repository navigation
feat(api-docs): Build the API reference from @sentry/api/docs #20679
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
Open
sentry-junior
wants to merge
21
commits into
master
Choose a base branch
from
feat/api-docs-from-sentry-api
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+211
−334
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f8dbde4
feat(api-docs): Build the API reference from @sentry/api/docs
sentry-junior[bot] f2a7c9f
docs(api): Describe the merge-base openapi-diff check
sentry-junior[bot] 929ad28
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] 9f4c186
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] eb0db02
ci(api-docs): Run the @sentry/api bump script through sh
sentry-junior[bot] a4fb800
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] 66386c3
fix(api-docs): Let the @sentry/api bump finish a stranded run
sentry-junior[bot] afdfb28
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] 9b1d58a
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] c259aa5
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] ee49f2e
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] 6f7b857
Merge branch 'master' into feat/api-docs-from-sentry-api
sentry-junior[bot] 1be2e94
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] 6fdf45f
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] 6706316
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] f6a3708
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] 3de209a
Bump @sentry/api to 2.1.0
sentry-junior[bot] c58490c
fix(algolia): Resolve @sentry/api/docs under tsx's CJS resolver
sentry-junior[bot] 95509eb
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] 8016d1e
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] 9490fe3
Merge remote-tracking branch 'origin/master' into feat/api-docs-from-…
sentry-junior[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #!/bin/sh | ||
| # Pin @sentry/api, which the API reference is built from, to its newest npm | ||
| # release, then open and merge a PR for it. | ||
| # | ||
| # Environment: | ||
| # GITHUB_TOKEN A token that can push branches and merge PRs. A GitHub App | ||
| # token, unlike github.token, also starts CI on the new PR. | ||
| set -eu | ||
|
|
||
| package=@sentry/api | ||
|
|
||
| latest=$(timeout 60 npm view "$package" version) | ||
| case $latest in | ||
| '' | *[!0-9.]*) | ||
| echo "::error::Expected a release version of $package from npm, got: $latest" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| current=$(node -p 'require("./package.json").dependencies[process.argv[1]]' "$package") | ||
| if [ "$current" = "$latest" ]; then | ||
| echo "$package is already $latest, skipping." | ||
| exit 0 | ||
| fi | ||
| echo "Bumping $package from $current to $latest" | ||
|
|
||
| timeout 600 pnpm add --save-exact --lockfile-only "$package@$latest" | ||
|
|
||
| git config user.email "271575301+sentry-api-schema-updater[bot]@users.noreply.github.com" | ||
| git config user.name "sentry-api-schema-updater[bot]" | ||
|
|
||
| # A run that stopped before the merge leaves this branch, and maybe its PR, | ||
| # behind. Overwrite the branch and reuse an open PR so the next run finishes. | ||
| branch="bot/bump-sentry-api-to-$latest" | ||
| git checkout -B "$branch" | ||
| git add package.json pnpm-lock.yaml | ||
| git commit -m "Bump $package to $latest" | ||
| timeout 120 git push --force --set-upstream origin "$branch" | ||
|
|
||
| open_prs=$(timeout 60 gh pr list --head "$branch" --state open --json number --jq length) | ||
| if [ "$open_prs" = 0 ]; then | ||
| timeout 60 gh pr create --fill --head "$branch" | ||
| fi | ||
| timeout 120 gh pr merge "$branch" --squash --admin -d | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,18 @@ | ||
| { | ||
| // Used only when running scripts/algolia.ts via `tsx` (see .github/workflows/algolia-index.yml). | ||
| // tsx loads .ts files through Node's CJS resolver. `rehype-prism-diff` (imported transitively | ||
| // via src/mdx.ts) only declares an "import" condition in its package.json `exports` map, so the | ||
| // CJS resolver fails with ERR_PACKAGE_PATH_NOT_EXPORTED. Aliasing the bare specifier to the | ||
| // package's real dist file makes tsx resolve it as a plain file and bypass the exports map. | ||
| // via src/mdx.ts) and `@sentry/api/docs` (via src/build/resolveOpenAPI.ts) only declare an | ||
| // "import" condition in their package.json `exports` maps, so the CJS resolver fails with | ||
| // ERR_PACKAGE_PATH_NOT_EXPORTED. Aliasing each bare specifier to the package's real dist file | ||
| // makes tsx resolve it as a plain file and bypass the exports map. | ||
| // Bun (the previous runner) tolerated the import-only exports map; tsx does not. | ||
| "extends": "../tsconfig.json", | ||
| "compilerOptions": { | ||
| "baseUrl": "..", | ||
| "paths": { | ||
| "sentry-docs/*": ["src/*"], | ||
| "rehype-prism-diff": ["node_modules/rehype-prism-diff/dist/index.js"] | ||
| "rehype-prism-diff": ["node_modules/rehype-prism-diff/dist/index.js"], | ||
| "@sentry/api/docs": ["node_modules/@sentry/api/dist/docs.js"] | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.