ref(preprod): Register endpoints on organization as well as project#106435
ref(preprod): Register endpoints on organization as well as project#106435
Conversation
|
🚨 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 |
1f4e559 to
7805c9b
Compare
8733f07 to
4344375
Compare
runningcode
left a comment
There was a problem hiding this comment.
LGTM aside from my comments!
|
|
||
|
|
||
| class ProjectPreprodArtifactPermission(ProjectPermission): | ||
| class OrganizationPreprodArtifactPermission(OrganizationPermission): |
There was a problem hiding this comment.
I'm wondering if there are any security implications here? like does sentry have project level access permissions that this might break?
Are there users that don't have the org permission where this would break?
There was a problem hiding this comment.
Tweaked the permissions a bit:
- Now we use event:* as the scope which is more correct I think
- We check in the body of the function that we have permission to access the given project
Also fixed a bug: - This ProjectPreprodArtifactPermission is only for the compare triggering not here.
There was a problem hiding this comment.
Oh, cool that event scope works!
5c90b8a to
1229601
Compare
39682fe to
d6aecc6
Compare
d71e780 to
8d0c243
Compare
4124491 to
8cc3f63
Compare
bbeb003 to
0a32e48
Compare
84acd9a to
68014c2
Compare
|
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
68014c2 to
a8d895b
Compare
69098d2 to
a5fc606
Compare
5f57b08 to
c909697
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
c909697 to
1b12900
Compare
Individual pages: /preprod/{install/size}/:artifact_id:/?project={project_id}
Compare pages: /preprod/size/compare/:head_id:/:base_id:/?project={project_id}
Rather than the current ones which look like:
Install pages are /preprod/:project_id:/:artifact_id:/install
Size pages are /preprod/:project_id:/:artifact_id
Making project a query param is more consistent with the existing frontend pages.
However this causes difficulties with the API paths.
This existing API paths look like this:
/api/0/project/:org/:project/preprodartifacts/:head_artifact_id/build-details/
That is they require the :project id/slug even though the :head_artifact_id is region unique.
This double registers each API endpoints:
once on /api/0/project/:org/:project/...
once on /api/0/organization/:org/...
We do this by adjusting the endpoint to make :project optional.
If missing it will be filled in from the head_artifact_id.
If present it will be checked against the head_artifact_id.
This allows us to refactor the endpoints to remove the :project without:
Doing each endpoint individually
Having a lot of duplicated code in the intermediate state
See EME-725 for context.
99e0c2b to
3e78b83
Compare
We would like the frontend to use paths like
/preprod/{install/size}/:artifact_id:/?project={project_id}/preprod/size/compare/:head_id:/:base_id:/?project={project_id}Rather than the current ones which look like:
/preprod/:project_id:/:artifact_id:/install/preprod/:project_id:/:artifact_idMaking project a query param is more consistent with the existing frontend pages.
However this causes difficulties with the API paths.
This existing API paths look like this:
/api/0/project/:org/:project/preprodartifacts/:head_artifact_id/build-details/That is they require the
:projectid/slug even though the :head_artifact_id is region unique.This double registers each API endpoints:
/api/0/project/:org/:project/.../api/0/organization/:org/...We do this by adjusting the endpoint to make
:projectoptional.If missing it will be filled in from the head_artifact_id.
If present it will be checked against the head_artifact_id.
This allows us to refactor the endpoints to remove the
:projectwithout:See EME-725 for context.