Repository navigation
Fix UI for latest deploys in Release page - #65587
Conversation
…ch the ReleaseProjectEnvironment rather than the deploy.
…rrect list of deploys for a version now.
|
🚨 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 |
nhsiehgit
left a comment
There was a problem hiding this comment.
nice, can we get a test?
|
|
||
| project_id = request.GET.get("project", None) | ||
| if project_id: | ||
| releases.filter(project_id=project_id) |
There was a problem hiding this comment.
Ah - do we need to account for -1 here as well for "all projects"?
There was a problem hiding this comment.
Hopefully this isn't the case because we force the user to select a project for the release details page?
but maybe add a check just in case?
There was a problem hiding this comment.
👍 i'll add a test for this
the thought here is that we just don't filter if we don't have a project_id so by default we would select all projects and adding the project=.... to the url would filter.
Hopefully this isn't the case because we force the user to select a project for the release details page?
Yeah it's required on the project release page right now -- i was thinking by defaulting to it being the full list it'd show whatever the latest is for any of those releases (handy on things like the list view for all projects)
There was a problem hiding this comment.
🙏
Yea - on other pages, we have project=-1 to signify all projects which is an annoying legacy decision we need to deal with :(
I might still add a check in case where project_id == ALL_ACCESS_PROJECT_ID then skip the filter or something :/
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #65587 +/- ##
==========================================
+ Coverage 80.56% 84.16% +3.60%
==========================================
Files 5259 5271 +12
Lines 231980 235797 +3817
Branches 45501 40818 -4683
==========================================
+ Hits 186886 198460 +11574
+ Misses 39000 37118 -1882
+ Partials 6094 219 -5875
|
0e8547a to
dc7d29a
Compare
| release__version=version, | ||
| ) | ||
|
|
||
| project_id = request.GET.get("project", None) |
There was a problem hiding this comment.
please do not access projects directly. This is a security issue as we are not checking that the user has access to the project passed in.
use self.get_projects like in
There was a problem hiding this comment.
@JoshFerge thanks for the heads up about this helper function! How's it look now?
There was a problem hiding this comment.
looks great thank you! going forward will try and figure out a solution where project perms get checked automatically. thanks for the change!
Description
Fixes: https://github.com/getsentry/team-core-product-foundations/issues/59
Previously, we weren't filtering the latest deploys by project By using the ReleaseProjectEnvironment, we can map all the filters correctly.
Before
Before, we weren't filtering by project id, so we could have a release to a single project and it'd show up on all release pages as a deploy.
After
Now, we look at the ReleaseProjectEnvrinoments to map the org, version, and project_id to filter per release project view.