Re: mailing list redirect for bug numbers? - Mailing list pgsql-www

From Jonathan S. Katz
Subject Re: mailing list redirect for bug numbers?
Date
Msg-id 9cfc2880-0623-7cc3-45f4-342c3af881fe@postgresql.org
Whole thread Raw
In response to mailing list redirect for bug numbers?  (Andres Freund <andres@anarazel.de>)
Responses Re: mailing list redirect for bug numbers?  (Magnus Hagander <magnus@hagander.net>)
List pgsql-www
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.

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.

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>/?"

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

- 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.

Thoughts?

Jonathan


Attachment

pgsql-www by date:

Previous
From: 이성민
Date:
Subject: Fwd: Wiki editor request
Next
From: Magnus Hagander
Date:
Subject: Re: mailing list redirect for bug numbers?