Skip to content

Commit fe43ef0

Browse files
ci(api): Stop mirroring the spec to sentry-api-schema (#131177)
`@sentry/api` now releases from `static/packages/api` (#130472, first release `api@2.5.0`), and getsentry/sentry-api-schema no longer publishes (getsentry/sentry-api-schema#156). Nothing reads the spec copy this workflow pushes there anymore. - `openapi.yml`: remove the sentry-api-schema checkout, the copy step, the `git-auto-commit-action` push, and the `SENTRY_API_SCHEMA_UPDATER` app token that only that push used. `bump-sentry-docs.yml` still uses those credentials for the sentry-docs dispatch. The `api-spec` and `api-schemas` artifact uploads are unchanged. - `release-api-package` drops `!cancelled()` and its comment. Both existed only so a failed mirror push didn't block the release. - `openapi-diff.sh` (used by the openapi-diff workflow and `make diff-api-docs`): the baseline drops its last fallback, sentry-api-schema `main`. It now reads the merge-base's `api-schemas` artifact, falling back to the newest `api@` release. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A69da19b385017e68b7f9eace56e9477f --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A69da19b385017e68b7f9eace56e9477f) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A69da19b385017e68b7f9eace56e9477f/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <126780+BYK@users.noreply.github.com>
1 parent 7409b7f commit fe43ef0

2 files changed

Lines changed: 3 additions & 50 deletions

File tree

‎.github/workflows/openapi.yml‎

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ jobs:
1717
outputs:
1818
api_client: ${{ steps.changes.outputs.api_client }}
1919
steps:
20-
- name: github app token
21-
id: app-token
22-
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
23-
with:
24-
client-id: ${{ vars.SENTRY_API_SCHEMA_UPDATER_APP_CLIENT_ID }}
25-
private-key: ${{ secrets.SENTRY_API_SCHEMA_UPDATER_PRIVATE_KEY }}
26-
repositories: |
27-
sentry
28-
sentry-api-schema
29-
3020
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3121

3222
- name: Check for python file changes
@@ -42,17 +32,6 @@ jobs:
4232
mode: migrations
4333
if: steps.changes.outputs.api_client == 'true'
4434

45-
- name: Checkout getsentry/sentry-api-schema
46-
if: steps.changes.outputs.api_client == 'true'
47-
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
48-
with:
49-
ref: 'main'
50-
repository: getsentry/sentry-api-schema
51-
path: sentry-api-schema
52-
# using app token so that `Git Commit & Push` step has the right permissions
53-
# https://github.com/stefanzweifel/git-auto-commit-action/tree/master?tab=readme-ov-file#push-to-protected-branches
54-
token: ${{ steps.app-token.outputs.token }}
55-
5635
- uses: ./.github/actions/setup-node-pnpm
5736

5837
- name: Build OpenAPI Derefed JSON
@@ -91,28 +70,12 @@ jobs:
9170
if-no-files-found: error
9271
retention-days: 30
9372

94-
- name: Copy artifacts into getsentry/sentry-api-schema
95-
if: steps.changes.outputs.api_client == 'true'
96-
run: cp static/packages/api/spec/* sentry-api-schema
97-
98-
- name: Git Commit & Push
99-
uses: stefanzweifel/git-auto-commit-action@0049e3fa4059ca715255fbbcb7dea4516f02ce0a # v4.15.3
100-
if: steps.changes.outputs.api_client == 'true'
101-
with:
102-
repository: sentry-api-schema
103-
branch: main
104-
commit_message: Generated
105-
commit_user_email: 271575301+sentry-api-schema-updater[bot]@users.noreply.github.com
106-
commit_user_name: sentry-api-schema-updater[bot]
107-
10873
# Releases @sentry/api (static/packages/api) when this commit changed what
10974
# the package ships. The preflight script skips the run until a person has
11075
# cut the first `api@` release with the Release workflow.
11176
release-api-package:
11277
needs: build_and_deref_json
113-
# The spec files upload before the push to getsentry/sentry-api-schema, so
114-
# a failed push does not hold up the release.
115-
if: ${{ !cancelled() && needs.build_and_deref_json.outputs.api_client == 'true' }}
78+
if: needs.build_and_deref_json.outputs.api_client == 'true'
11679
runs-on: ubuntu-24.04
11780
timeout-minutes: 30
11881
permissions:

‎.github/workflows/scripts/openapi-diff.sh‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
# DIR/source.txt. Tries, in order:
1010
# 1. the `api-schemas` artifact of the openapi workflow run for the
1111
# merge-base, or for the closest earlier master commit that has one;
12-
# 2. the newest `api@` GitHub release;
13-
# 3. getsentry/sentry-api-schema main, while it still receives the spec.
12+
# 2. the newest `api@` GitHub release.
1413
# With BASE_SHA and HEAD_SHA set (CI), the merge-base comes from the
1514
# GitHub API. Otherwise it is `git merge-base origin/master HEAD`.
1615
# openapi-diff.sh changelog BASE_SPEC PR_SPEC
@@ -27,7 +26,6 @@ set -eu
2726
repo=${GITHUB_REPOSITORY:-getsentry/sentry}
2827
artifact=api-schemas
2928
oasdiff_image=ghcr.io/getsentry/image-mirror-tufin-oasdiff:v1.33.0
30-
legacy_raw=https://raw.githubusercontent.com/getsentry/sentry-api-schema/main
3129
# How many master commits before the merge-base to search for an artifact.
3230
# Every commit that can change the schemas uploads one.
3331
max_commits=30
@@ -100,20 +98,12 @@ from_release() {
10098
printf 'the %s release, which can be newer than the merge-base\n' "$tag" > "$dest/source.txt"
10199
}
102100

103-
from_legacy_repo() {
104-
dest=$1
105-
for name in openapi-derefed.json rpc_method_schema.json; do
106-
timeout 300 curl --fail --silent --show-error --location -o "$dest/$name" "$legacy_raw/$name" || return 1
107-
done
108-
echo 'getsentry/sentry-api-schema main, which can be newer than the merge-base' > "$dest/source.txt"
109-
}
110-
111101
baseline() {
112102
out=$1
113103
# Each source starts from an empty directory, so a source that fails
114104
# halfway leaves nothing behind for the next one.
115105
work="$out.partial"
116-
for source in from_artifact from_release from_legacy_repo; do
106+
for source in from_artifact from_release; do
117107
rm -rf "$work"
118108
mkdir -p "$work"
119109
if "$source" "$work"; then

0 commit comments

Comments
 (0)