-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(issues): adds backend for "resolve in upcoming release" #70990
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
Changes from all commits
a803e50
7f8f8db
4d77a7b
3518a0a
8773aa4
e057c34
cca7bbf
2110d6d
5ed0193
e74c9d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -225,7 +225,6 @@ def update_groups( | |
) | ||
if user_options: | ||
self_assign_issue = user_options[0].value | ||
|
||
if search_fn and not group_ids: | ||
try: | ||
cursor_result, _ = search_fn( | ||
|
@@ -300,6 +299,34 @@ def update_groups( | |
res_type = GroupResolution.Type.in_next_release | ||
res_type_str = "in_next_release" | ||
res_status = GroupResolution.Status.pending | ||
elif status_details.get("inUpcomingRelease"): | ||
if len(projects) > 1: | ||
return Response( | ||
{"detail": "Cannot set resolved in upcoming release for multiple projects."}, | ||
status=400, | ||
) | ||
release = ( | ||
status_details.get("inUpcomingRelease") | ||
or Release.objects.filter( | ||
projects=projects[0], organization_id=projects[0].organization_id | ||
) | ||
.extra(select={"sort": "COALESCE(date_released, date_added)"}) | ||
.order_by("-sort")[0] | ||
Comment on lines
+312
to
+314
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does this mean semantically, and is this still the correct behavior for "resolve in upcoming release"? (the case where there is no release passed in.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this query is used in a couple places to find the most recent release for a project, which we still need for this because in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. got it |
||
) | ||
activity_type = ActivityType.SET_RESOLVED_IN_RELEASE.value | ||
activity_data = {"version": ""} | ||
|
||
serialized_user = user_service.serialize_many( | ||
filter=dict(user_ids=[user.id]), as_user=user | ||
) | ||
new_status_details = { | ||
"inUpcomingRelease": True, | ||
} | ||
if serialized_user: | ||
new_status_details["actor"] = serialized_user[0] | ||
res_type = GroupResolution.Type.in_upcoming_release | ||
res_type_str = "in_upcoming_release" | ||
res_status = GroupResolution.Status.pending | ||
elif status_details.get("inRelease"): | ||
# TODO(jess): We could update validation to check if release | ||
# applies to multiple projects, but I think we agreed to punt | ||
|
@@ -606,6 +633,7 @@ def update_groups( | |
if res_type in ( | ||
GroupResolution.Type.in_next_release, | ||
GroupResolution.Type.in_release, | ||
GroupResolution.Type.in_upcoming_release, | ||
): | ||
result["activity"] = serialize( | ||
Activity.objects.get_activities_for_group( | ||
|
Uh oh!
There was an error while loading. Please reload this page.