patchew-project / patchew

A patch email tracking and testing system
MIT License
72 stars 24 forks source link

Use git-publish to publish a single version are not recognized by patchew, I don't know if this is a git-publish issue or patchew issue #94 #127

Closed lygstate closed 3 years ago

lygstate commented 4 years ago

Patch https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg07570.html and https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg07571.html

https://github.com/stefanha/git-publish/issues/94

famz commented 3 years ago

With eyeball I don't see anything suspicious with the two patches. Will need to do some testing to tell...

famz commented 3 years ago

@bonzini The server spits this upon importing above patches:

    self.model._meta.object_name
api.models.DoesNotExist: Topic matching query does not exist.
Internal Server Error: /api/import/
Traceback (most recent call last):
  File "/opt/patchew/venv/lib64/python3.4/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/opt/patchew/venv/lib64/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/opt/patchew/venv/lib64/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/patchew/venv/lib64/python3.4/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/patchew/venv/lib64/python3.4/site-packages/django/utils/decorators.py", line 67, in _wrapper
    return bound_func(*args, **kwargs)
  File "/opt/patchew/venv/lib64/python3.4/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/opt/patchew/venv/lib64/python3.4/site-packages/django/utils/decorators.py", line 63, in bound_func
    return func.__get__(self, type(self))(*args2, **kwargs2)
  File "/opt/patchew/api/views.py", line 29, in dispatch
    return super(APIView, self).dispatch(request, *args, **kwargs)
  File "/opt/patchew/venv/lib64/python3.4/site-packages/django/views/generic/base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/patchew/api/views.py", line 47, in post
    r = self.handle(request, **params)
  File "/opt/patchew/api/views.py", line 195, in handle
    mbox, request.user
  File "/opt/patchew/api/models.py", line 509, in add_message_from_mbox
    if is_series_head
  File "/opt/patchew/api/models.py", line 552, in for_stripped_subject
    topic = self.get(pk=q[0]["topic"])
  File "/opt/patchew/venv/lib64/python3.4/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/opt/patchew/venv/lib64/python3.4/site-packages/django/db/models/query.py", line 380, in get
    self.model._meta.object_name
api.models.DoesNotExist: Topic matching query does not exist.

This seems to be part of the Topic work.

I am not sure about the assumptions made by for_stripped_subject here, we seem to only set topic for series heads in add_message_from_mbox but here we query all messages with the stripped subject.

Maybe we want:

@@ -543,7 +544,7 @@ class QueuedSeries(models.Model):
 class TopicManager(models.Manager):
     def for_stripped_subject(self, stripped_subject):
         q = (
-            Message.objects.filter(stripped_subject=stripped_subject)
+            Message.objects.filter(stripped_subject=stripped_subject, topic__isnull=False)
             .order_by("date")
             .reverse()[:1]
             .values("topic")

Paolo, could you confirm?

famz commented 3 years ago

Fixed by 6de904a6a92