prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Issues resolved via UI do not appear in releases overview
  To reproduce:
  
  * Navigate to an issue
  * Click "Resolve in current release (abc123)"
  * Navigate to that release (abc123)
  * Issue does not appear under "New Issues in this Release"
  
  
  </issue>
  <code>
  [start of src/sentry/api/endpoints/issues_resolved_in_release.py]
  1 from __future__ import absolute_import
  2 
  3 from rest_framework.response import Response
  4 
  5 from sentry.api.base import DocSection
  6 from sentry.api.bases.project import ProjectEndpoint, ProjectPermission
  7 from sentry.api.exceptions import ResourceDoesNotExist
  8 from sentry.api.serializers import serialize
  9 from sentry.api.serializers.models.group import StreamGroupSerializer
  10 from sentry.models import (
  11     Group,
  12     GroupCommitResolution,
  13     Release,
  14     ReleaseCommit,
  15 )
  16 
  17 
  18 class IssuesResolvedInReleaseEndpoint(ProjectEndpoint):
  19     doc_section = DocSection.RELEASES
  20     permission_classes = (ProjectPermission, )
  21 
  22     def get(self, request, project, version):
  23         """
  24         List issues to be resolved in a particular release
  25         ````````````````````````
  26 
  27         Retrieve a list of issues to be resolved in a given release.
  28 
  29         :pparam string organization_slug: the slug of the organization the
  30                                           release belongs to.
  31         :pparam string project_slug: the slug of the project associated with the release.
  32         :pparam string version: the version identifier of the release.
  33         :auth: required
  34         """
  35         try:
  36             release = Release.objects.get(version=version, organization=project.organization)
  37         except Release.DoesNotExist:
  38             raise ResourceDoesNotExist
  39 
  40         groups = Group.objects.filter(
  41             project=project,
  42             id__in=GroupCommitResolution.objects.filter(
  43                 commit_id__in=ReleaseCommit.objects.filter(
  44                     release=release,
  45                 ).values_list('commit_id', flat=True),
  46             ).values_list('group_id', flat=True),
  47         )
  48 
  49         context = serialize(list(groups), request.user, StreamGroupSerializer(stats_period=None))
  50         return Response(context)
  51
  [end of src/sentry/api/endpoints/issues_resolved_in_release.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/src/sentry/api/endpoints/issues_resolved_in_release.py b/src/sentry/api/endpoints/issues_resolved_in_release.py
  --- a/src/sentry/api/endpoints/issues_resolved_in_release.py
  +++ b/src/sentry/api/endpoints/issues_resolved_in_release.py
  @@ -10,6 +10,7 @@
   from sentry.models import (
       Group,
       GroupCommitResolution,
  +    GroupResolution,
       Release,
       ReleaseCommit,
   )
  @@ -37,14 +38,27 @@
           except Release.DoesNotExist:
               raise ResourceDoesNotExist
   
  -        groups = Group.objects.filter(
  -            project=project,
  -            id__in=GroupCommitResolution.objects.filter(
  +        group_ids = set()
  +        group_ids |= set(
  +            GroupResolution.objects.filter(
  +                release=release,
  +            ).values_list('group_id', flat=True)
  +        )
  +        group_ids |= set(
  +            GroupCommitResolution.objects.filter(
                   commit_id__in=ReleaseCommit.objects.filter(
                       release=release,
  -                ).values_list('commit_id', flat=True),
  -            ).values_list('group_id', flat=True),
  +                ).values_list(
  +                    'commit_id',
  +                    flat=True,
  +                )
  +            ).values_list(
  +                'group_id',
  +                flat=True,
  +            )
           )
   
  +        groups = Group.objects.filter(project=project, id__in=group_ids)
  +
           context = serialize(list(groups), request.user, StreamGroupSerializer(stats_period=None))
           return Response(context)
  
verification_info: {"golden_diff": "diff --git a/src/sentry/api/endpoints/issues_resolved_in_release.py b/src/sentry/api/endpoints/issues_resolved_in_release.py\n--- a/src/sentry/api/endpoints/issues_resolved_in_release.py\n+++ b/src/sentry/api/endpoints/issues_resolved_in_release.py\n@@ -10,6 +10,7 @@\n from sentry.models import (\n     Group,\n     GroupCommitResolution,\n+    GroupResolution,\n     Release,\n     ReleaseCommit,\n )\n@@ -37,14 +38,27 @@\n         except Release.DoesNotExist:\n             raise ResourceDoesNotExist\n \n-        groups = Group.objects.filter(\n-            project=project,\n-            id__in=GroupCommitResolution.objects.filter(\n+        group_ids = set()\n+        group_ids |= set(\n+            GroupResolution.objects.filter(\n+                release=release,\n+            ).values_list('group_id', flat=True)\n+        )\n+        group_ids |= set(\n+            GroupCommitResolution.objects.filter(\n                 commit_id__in=ReleaseCommit.objects.filter(\n                     release=release,\n-                ).values_list('commit_id', flat=True),\n-            ).values_list('group_id', flat=True),\n+                ).values_list(\n+                    'commit_id',\n+                    flat=True,\n+                )\n+            ).values_list(\n+                'group_id',\n+                flat=True,\n+            )\n         )\n \n+        groups = Group.objects.filter(project=project, id__in=group_ids)\n+\n         context = serialize(list(groups), request.user, StreamGroupSerializer(stats_period=None))\n         return Response(context)\n", "issue": "Issues resolved via UI do not appear in releases overview\nTo reproduce:\r\n\r\n* Navigate to an issue\r\n* Click \"Resolve in current release (abc123)\"\r\n* Navigate to that release (abc123)\r\n* Issue does not appear under \"New Issues in this Release\"\r\n\n", "before_files": [{"content": "from __future__ import absolute_import\n\nfrom rest_framework.response import Response\n\nfrom sentry.api.base import DocSection\nfrom sentry.api.bases.project import ProjectEndpoint, ProjectPermission\nfrom sentry.api.exceptions import ResourceDoesNotExist\nfrom sentry.api.serializers import serialize\nfrom sentry.api.serializers.models.group import StreamGroupSerializer\nfrom sentry.models import (\n    Group,\n    GroupCommitResolution,\n    Release,\n    ReleaseCommit,\n)\n\n\nclass IssuesResolvedInReleaseEndpoint(ProjectEndpoint):\n    doc_section = DocSection.RELEASES\n    permission_classes = (ProjectPermission, )\n\n    def get(self, request, project, version):\n        \"\"\"\n        List issues to be resolved in a particular release\n        ````````````````````````\n\n        Retrieve a list of issues to be resolved in a given release.\n\n        :pparam string organization_slug: the slug of the organization the\n                                          release belongs to.\n        :pparam string project_slug: the slug of the project associated with the release.\n        :pparam string version: the version identifier of the release.\n        :auth: required\n        \"\"\"\n        try:\n            release = Release.objects.get(version=version, organization=project.organization)\n        except Release.DoesNotExist:\n            raise ResourceDoesNotExist\n\n        groups = Group.objects.filter(\n            project=project,\n            id__in=GroupCommitResolution.objects.filter(\n                commit_id__in=ReleaseCommit.objects.filter(\n                    release=release,\n                ).values_list('commit_id', flat=True),\n            ).values_list('group_id', flat=True),\n        )\n\n        context = serialize(list(groups), request.user, StreamGroupSerializer(stats_period=None))\n        return Response(context)\n", "path": "src/sentry/api/endpoints/issues_resolved_in_release.py"}]}