-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(apis): commit auto generated code #56698
Conversation
8ca5350
to
934cbce
Compare
.github/workflows/openapi-diff.yml
Outdated
@@ -47,13 +47,27 @@ jobs: | |||
if: steps.changes.outputs.api_docs == 'true' | |||
|
|||
- name: Build OpenAPI Derefed JSON | |||
if: steps.changes.outputs.api_docs == 'true' | |||
# if: steps.changes.outputs.api_docs == 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented temporarily to make sure build-api-docs runs every time
24dcd06
to
ee020ef
Compare
ee020ef
to
64ed59d
Compare
64ed59d
to
20be643
Compare
@@ -653,6 +653,7 @@ | |||
"OrganizationStatsEndpointV2::GET" | |||
], | |||
"private": [ | |||
"NotificationActionsIndexEndpoint::GET", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the changes by the workflow and looks right.
private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }} | ||
|
||
- name: Apply API Publish Status or Ownership Changes | ||
# if: env.SECRET_ACCESS == 'true' && startsWith(github.ref, 'refs/pull') && always() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I need this line? The step is not called when this is not commented now 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't be checking in build outputs in the first place -- why are these managed by git?
I'm building a bunch of accountability measures for apis to know what teams own what and what apis are reviewed and published vs. not. I figured it's also the best place to keep the ownership file updated. If not with git workflow, what's another way that I can autogenerate code and push with people's PRs? |
Can we just make this a pre-commit check instead of doing this in github actions? |
@mikejihbe I believe we can. We can also add it to the openapi.yml which is already a github action that commits to a different repo. I don't mind having the ownership file stored in a different repo. @asottile-sentry what do you think? |
yeah a separate repo is better -- still should ideally be an actual datastore but it won't impact sentry devs unless they are cloning that other repo 👍 |
8097340
to
33c15f7
Compare
33c15f7
to
dc63a55
Compare
.github/workflows/openapi.yml
Outdated
push: | ||
branches: | ||
- master | ||
pull_request: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not going to merge this change, only here so we can see the action on this PR.
@@ -28,14 +28,15 @@ | |||
"SourceMapDebugEndpoint::GET" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file won't be here if they don't run make build-api-docs
locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, I put it in git ignore so people don't even see it.
@@ -10,7 +10,7 @@ | |||
@control_silo_endpoint | |||
class NotificationDefaultsEndpoints(Endpoint): | |||
publish_status = { | |||
"GET": ApiPublishStatus.PRIVATE, | |||
"GET": ApiPublishStatus.EXPERIMENTAL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will not merge this change. This is only to show these changes will be applied to the other repo. They are: https://github.com/getsentry/sentry-api-schema/blob/main/api_ownership_stats_dont_modify.json#L37
make build-api-docs makes some file changes now, before this change the changes wouldn't get added to the commit in the PR. This new workflow adds them to the PR.