Re: mailing list redirect for bug numbers?

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL WWW <pgsql-www(at)postgresql(dot)org>
Subject: Re: mailing list redirect for bug numbers?
Date: 2019-01-15 10:57:21
Message-ID: CABUevEyOCL4JN6=Qc-dP96bhx292e7_qAKfC56wZe-RWu6snAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

On Tue, Jan 15, 2019 at 11:43 AM Jonathan S. Katz <jkatz(at)postgresql(dot)org>
wrote:

> Hi Andres,
>
> On 1/14/19 5:18 PM, Andres Freund wrote:
> > Hi,
> >
> > How hard would it be to have a redirect similar to
> > https://www.postgresql.org/message-id/<id>
> >
> > that accepted bug numbers instead of message ids? I don't know the
> > precise database schema of the archives, but I assume it could be done
> > with a prefix query that filters the sender to @postgresql.org, the list
> > to pgsql-bugs, and the prefix to "BUG #<bugno>" or such.
>
> The bug ID numbers are generated from pgweb using:
>
> SELECT nextval('bug_id_seq')
>
> And then prefixed to the email thread as per the above.
>

Worth noticing is that it's also prefixed to the message-id, but that's a
fairly new thing.

More on this in a second.
>
> > Or perhaps
> > there's a database table with bugs -> messageid mappings somewhere? Or
> > could be created using a query like the above?
>
> IMV that would be an excellent suggestion. My guess is in order to make
> that work, we would create the mapping when the initial bug report makes
> it into the archives.

> > It'd be neat to link to bugs from commit messages in a clearer format
> > (i.e. to the bug number, rather than it being one of potentially
> > multiple message ids), and it also makes manual lookup nicer.
>
> Agreed, that sounds like a nicer UX.
>
> The only big catch I see is that if someone emails -bugs directly, no
> number is assigned, so we would have to leave that be.
>

Yeah, those would be entirely out of scope.

I don't know if we would want to use "/message-id/" as the parent URL,
> just in case someone sent a message with an ID of just digits (for
> whatever reason). Dare I suggest something like "/bugs/<id>/?
>

Or would we perhaps want tp use the postgr.es urls-shorterner with just a
/b/ (like we have /m/ for messageids)?

> Assuming buy-in, what would need to be done is:
>
> - Adjust the message import script to parse inbound messages with above
> message beginning to -bugs. Determine if it is the first message to the
> thread / bug ID is already registered. If it does not exist, record the
> bug ID, message ID combo in a new table
>

That would suddenly put a very hard coded assumption into the archives code
about this format, which I think is a bad idea in general since the
archives code is not specific to the pgsql list usage *at all* today....

- Write a one time script to map old bug id to first message id in the
> thread.
>
> - Update the urls.py in pgarchives to handle said route and fail
> gracefully if bug ID does not exist
>
> - Note in pgweb where the email is generated that any changes to email
> subject could break things.
>
> And that should be that.
>

I think it would be easier to just have a simple piece of lookup code that
has access to the archives db. When fed a bug number, it first looks for a
messageid according to the new format messageid, and if its found (and just
one) then redirect to that. If not, then to a subject prefix search and
validate that the messageid is one that does match what it should do (e.g.
that it comes from the correct servers -- there haven't been many so far,
so it's easy to construct a whitelist) and returns exactly one, then
redirect to that, otherwise 404.

The difficulty in all those is we don't currently index the subject other
than as part of the full text. But that can probably be added pretty
cheaply.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Magnus Hagander 2019-01-15 11:00:04 Re: mailing list redirect for bug numbers?
Previous Message Jonathan S. Katz 2019-01-15 10:43:44 Re: mailing list redirect for bug numbers?