Skip to content

Conversation

@ryan953
Copy link
Member

@ryan953 ryan953 commented Oct 16, 2025

This throws the command into it's own CI step, so that it can do all the setup stuff only if a urls.py file is changed, and it will still auto-update the PR if changes are needed.
This keeps CI fast for the bulk of PRs where we don't need to run setup, and don't need to do the check.
With pre-commit i could only figure out how to do the setup step unconditionally before pre-commit ran, it would've been some extra coupling to make that conditional and it would be non-obvious which pre-commit step needs it. So no more pre-commit for now.

@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Oct 16, 2025
@github-actions
Copy link
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@ryan953 ryan953 changed the title Ryan953/test ci linting ci: Fix CI step that generates Typescript enums based on api urls Oct 16, 2025
@ryan953 ryan953 marked this pull request as ready for review October 16, 2025 19:44
@ryan953 ryan953 requested review from a team as code owners October 16, 2025 19:44
- name: Apply any file changes
# note: this runs "always" or else it's skipped when pre-commit fails
if: env.SECRET_ACCESS == 'true' && startsWith(github.ref, 'refs/pull') && always()
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Token Generation Fails Due to Undefined Variable

The api-url-typescript job's token generation and commit steps use env.SECRET_ACCESS == 'true'. Since SECRET_ACCESS is undefined, these steps are always skipped, preventing the job from obtaining a token or committing generated TypeScript changes. This differs from the pattern in other similar jobs.

Fix in Cursor Fix in Web

Comment on lines +50 to +51
backend_api_urls: &backend_api_urls
- '**/urls.py'
Copy link
Member

Choose a reason for hiding this comment

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

This might mis-match some things. Not huge problem but I wonder if we can be slightly more specific.

Copy link
Member Author

Choose a reason for hiding this comment

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

it kinda mis-matches on purpose, there are gaps too.

The main entry file is src/sentry/api/urls.py but that also imports from:

  • src/sentry/workflow_engine/endpoints/urls.py
  • src/sentry/notifications/platform/api/endpoints/urls.py
  • src/sentry/preprod/api/endpoints/urls.py
  • and maybe more in the future.

So i'm trying to catch them all for now. Like i said before, the script is sus, but good enough to get started adopting getApiUrl() imo

Copy link
Member

Choose a reason for hiding this comment

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

we can add a comment maybe too

Copy link
Member Author

Choose a reason for hiding this comment

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

@ryan953 ryan953 enabled auto-merge (squash) October 16, 2025 19:49
@ryan953 ryan953 merged commit 35c756b into master Oct 16, 2025
73 checks passed
@ryan953 ryan953 deleted the ryan953/test-ci-linting branch October 16, 2025 20:04
ryan953 added a commit that referenced this pull request Oct 16, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants