Public contributor profile pages

Поиск
Список
Период
Сортировка
Искать

Public contributor profile pages

От:
Melanie Plageman <melanieplageman@gmail.com>
Дата:
Вложения:
Hello,

The Contributors Committee is working on a new program to recognize
specific contributions (e.g. "volunteered at PGConf.dev 2024" or
"contributed code to PostgreSQL 18"). These would be listed on an
individual contributor's profile. As a step toward that, we are
proposing to add public contributor profile pages.

Attached is a patch set which implements this by:
1) allowing all those with pgo user accounts to edit their
"contributions" (currently only enabled for recognized contributors)
2) adds a public contributor profile view accessible via
postgresql.org/community/contributors/[username]
3) links all recognized contributors on [1] to their public contributor profile

There are quite a few details to work out. A few I know of are:
- How should opting into a public profile work? What about existing
recognized contributors, do we opt them all in automatically? Or just
opt-in Major Contributors since their "Contributions" are already on a
public web page? (see patch 0003)
- How to make the public profile URL scheme work for contributors who
do not have a pgo user account? Or should it work at all?

This is my first real web patch, so I'm sure I did some things in a
non-pgweb-idiomatic (or non web-idiomatic) way and didn't think of
lots of things. I'll probably need lots of guidance.

- Melanie

[1] https://www.postgresql.org/community/contributors/

Re: Public contributor profile pages

От:
Magnus Hagander <magnus@hagander.net>
Дата:


On Wed, 17 Dec 2025 at 01:24, Melanie Plageman <melanieplageman@gmail.com> wrote:
Hello,

The Contributors Committee is working on a new program to recognize
specific contributions (e.g. "volunteered at PGConf.dev 2024" or
"contributed code to PostgreSQL 18"). These would be listed on an
individual contributor's profile. As a step toward that, we are
proposing to add public contributor profile pages.

Attached is a patch set which implements this by:
1) allowing all those with pgo user accounts to edit their
"contributions" (currently only enabled for recognized contributors)
2) adds a public contributor profile view accessible via
postgresql.org/community/contributors/[username]
3) links all recognized contributors on [1] to their public contributor profile

There are quite a few details to work out. A few I know of are:
- How should opting into a public profile work? What about existing
recognized contributors, do we opt them all in automatically? Or just
opt-in Major Contributors since their "Contributions" are already on a
public web page? (see patch 0003)
- How to make the public profile URL scheme work for contributors who
do not have a pgo user account? Or should it work at all?

This is my first real web patch, so I'm sure I did some things in a
non-pgweb-idiomatic (or non web-idiomatic) way and didn't think of
lots of things. I'll probably need lots of guidance.

Hi!

A couple of comments!

AFAICS with this patch, *every* user who visits their profile gets a Contributor object created. And they do that even if they don't save their profile? And the contributions part of the profile shows up for all users, whether they are contributors at all or not -- not just "all levels of contributors". That doesn't seem right, surely only those who are recognized at *some* level should be getting that, and the change is to list all levels, but not random non-contributors? (And even if it's shown for non-contributors intentionally, we shouldn't create a database record for people just viewing things)

Also, when making changes to a model that only changes fields that aren't actually in the database (such as the change of help_text), instead of making a migration for that it's better to "backpatch" it into the latest existing migration. Otherwise we just collect a lot of no-op migrations that over time will start costing time and annoyance.

And finally, when adding URLs that contain items from a model, you need to add those URLs to purge_urls() otherwise it will stay cached when edited. See for example news.NewsArticle as an example of how that's done dynamically.


As for the questions - I think we should absolutely do opt-in, and I do think it makes sense to auto-opt-in the current major contributors since "it's been like that forever and they haven't complained", but listing the others and in a more visible way there are sure to be some who might not want it. In particular, maybe we should make the listing of *email* a separate opt-in/opt-out? That is you can opt-out of being listed completely, or you can say "list me, but not my email"?

I've thought a bit about it and I do think listing the profiles with the username in the URL as you have done is in the end good. I don't think people would care about exposing that one -- and it's already exposed on for example the commitfest app. But based on that I would go with "does not show at all if they don't have an account". They won't be able to edit any information on it anyway, and if they care enough to do that they will create an account. We will presumably continue to list them in the list of contributors, just not provide a details page.

I wonder if we really need a separate "report inappropriate profile"? We should be getting notifications for them, but in particular if we are seriously worried about this case, we should make the records moderated. But these are known contributors - I think we can trust them?


--

Re: Public contributor profile pages

От:
Melanie Plageman <melanieplageman@gmail.com>
Дата:
Thanks for taking a look! A few follow-up questions before I edit the patch:

On Wed, Dec 17, 2025 at 9:03 AM Magnus Hagander  wrote:
>
> AFAICS with this patch, *every* user who visits their profile gets a Contributor object created. And they do that even if they don't save their profile? And the contributions part of the profile shows up for all users, whether they are contributors at all or not -- not just "all levels of contributors". That doesn't seem right, surely only those who are recognized at *some* level should be getting that, and the change is to list all levels, but not random non-contributors? (And even if it's shown for non-contributors intentionally, we shouldn't create a database record for people just viewing things)

What we are envisioning once we add "Contribution Badges" (or whatever
we call them) is that anybody who is approved for a badge (e.g.
volunteered at PGConf EU) would have that badge listed on their
profile. These may or may not be considered "Recognized Contributors",
and we aren't sure whether or not their names will be listed on the
Contributors Profile page or another page or not linked to a main pgo
page at all. But either way, it makes sense for these profiles to be
publicly viewable since they were awarded to the person.

Since we don't have the badges yet, we are considering the text of the
"Contribution" field to be the equivalent. So anyone that lists
"Contribution"s should have a publicly accessible profile. It isn't
approved by a moderator like badges would be, which does make it more
fraught, though.

The reason I thought every user profile should have a Contributor
object is that 1) it seemed easier from an implementation standpoint
than creating one only once someone has edited the contribution fields
of the form 2) most of the use cases for a pgo account seem related to
contributing (signing up for mailing lists, etc) -- I don't know if
they are used for other things like downloading postgres binaries etc.

Is there a good way to avoid making the Contributor object unless they
edit the "Contributions" field? Maybe there should be some kind of way
of saying "I contribute to Postgres" and "Contributions" is a required
field and then that makes the Contributor object and also kicks the
profile to some moderation queue for the Contributors team?

> Also, when making changes to a model that only changes fields that aren't actually in the database (such as the change of help_text), instead of making a migration for that it's better to "backpatch" it into the latest existing migration. Otherwise we just collect a lot of no-op migrations that over time will start costing time and annoyance.

The latest existing migration that includes that field or just the
latest existing migration?

> As for the questions - I think we should absolutely do opt-in, and I do think it makes sense to auto-opt-in the current major contributors since "it's been like that forever and they haven't complained", but listing the others and in a more visible way there are sure to be some who might not want it. In particular, maybe we should make the listing of *email* a separate opt-in/opt-out? That is you can opt-out of being listed completely, or you can say "list me, but not my email"?

So there would be a separate opt-in for being listed on the recognized
contributor page and for having a public individual contributor
profile? And we would only auto opt-in major contributors to the
public individual contributor profiles?

And email display would be separately opt-in and if you opt-in it
displays on both the individual contributor profile page and on the
main recognized contributor profile page for major contributors and we
would auto opt-in email display for major contributors?

> I've thought a bit about it and I do think listing the profiles with the username in the URL as you have done is in the end good. I don't think people would care about exposing that one -- and it's already exposed on for example the commitfest app. But based on that I would go with "does not show at all if they don't have an account". They won't be able to edit any information on it anyway, and if they care enough to do that they will create an account. We will presumably continue to list them in the list of contributors, just not provide a details page.

That makes sense. Maybe we should start calling the Contributor
Profiles page [1] the Recognized Contributors page or Sustained
Contributors page instead of the Contributor Profiles page to
disambiguate it from individual contributor profiles. If only to make
spec'ing out this feature easier.

> I wonder if we really need a separate "report inappropriate profile"? We should be getting notifications for them, but in particular if we are seriously worried about this case, we should make the records moderated. But these are known contributors - I think we can trust them?

I think we want people who are not recognized significant or major
contributors to be able to have profiles so that they can build them
up and eventually make the case for being a recognized significant or
major contributor. This would significantly increase the number of
people with profiles so moderation may get tricky.

What does it mean that we would get notifications for them? Is "we"
the contributors committee?

I would be okay with having them moderated if we thought the volume
would be like one a day (with more at the beginning). And maybe if it
is more, we could add another community member outside the
contributors committee to help moderate.

- Melanie

[1] https://www.postgresql.org/community/contributors/


Re: Public contributor profile pages

От:
Christoph Berg <myon@debian.org>
Дата:
Re: Melanie Plageman
> And email display would be separately opt-in and if you opt-in it
> displays on both the individual contributor profile page and on the
> main recognized contributor profile page for major contributors and we
> would auto opt-in email display for major contributors?

Since the email is user-editable, and separate from the account email,
people could just leave that field empty. We just need to update the
description so they know when editing their profile. Same for all the
other fields)

> That makes sense. Maybe we should start calling the Contributor
> Profiles page [1] the Recognized Contributors page or Sustained
> Contributors page instead of the Contributor Profiles page to
> disambiguate it from individual contributor profiles. If only to make
> spec'ing out this feature easier.

We seem to have started using "Recognized Contributors" in the team,
even if we didn't ever consciously decide about it.

> > I wonder if we really need a separate "report inappropriate profile"? We should be getting notifications for them, but in particular if we are seriously worried about this case, we should make the records moderated. But these are known contributors - I think we can trust them?

That button looks a bit odd at the moment. Perhaps having it is
appropriate, but it should be much less prominent so the page looks
good when people show it around.

> I think we want people who are not recognized significant or major
> contributors to be able to have profiles so that they can build them
> up and eventually make the case for being a recognized significant or
> major contributor.

Maybe we could actually base our decisions on that...

> This would significantly increase the number of
> people with profiles so moderation may get tricky.
> 
> What does it mean that we would get notifications for them? Is "we"
> the contributors committee?

Perhaps passive moderation is good enough, i.e. things get put live
automatically, but we can review the notifications and kick anything
bad.

Christoph


Re: Public contributor profile pages

От:
Magnus Hagander <magnus@hagander.net>
Дата:


On Wed, 17 Dec 2025 at 16:18, Melanie Plageman <melanieplageman@gmail.com> wrote:
Thanks for taking a look! A few follow-up questions before I edit the patch:

On Wed, Dec 17, 2025 at 9:03 AM Magnus Hagander <magnus@hagander.net> wrote:
>
> AFAICS with this patch, *every* user who visits their profile gets a Contributor object created. And they do that even if they don't save their profile? And the contributions part of the profile shows up for all users, whether they are contributors at all or not -- not just "all levels of contributors". That doesn't seem right, surely only those who are recognized at *some* level should be getting that, and the change is to list all levels, but not random non-contributors? (And even if it's shown for non-contributors intentionally, we shouldn't create a database record for people just viewing things)

What we are envisioning once we add "Contribution Badges" (or whatever
we call them) is that anybody who is approved for a badge (e.g.
volunteered at PGConf EU) would have that badge listed on their
profile. These may or may not be considered "Recognized Contributors",
and we aren't sure whether or not their names will be listed on the
Contributors Profile page or another page or not linked to a main pgo
page at all. But either way, it makes sense for these profiles to be
publicly viewable since they were awarded to the person.

If they are not based on the recognized contributors, they should probably not be part of that in the data model either. But in particular, we shouldn't start creating empty contributor profiles before we even *knoiw* that it would.


Since we don't have the badges yet, we are considering the text of the
"Contribution" field to be the equivalent. So anyone that lists
"Contribution"s should have a publicly accessible profile. It isn't
approved by a moderator like badges would be, which does make it more
fraught, though.

So any user without any confirmation can just add themselves as a contributor, without even moderation, and publish data? That sounds like a *really* bad idea, tbh.

If it's data published by users where we have at one point added them to the contributors list and therefore pre-moderated to some point that is reasonable. But allowing random people to add records and then edit them and then it turns out to be published is going to be a hard no -- we've spent many hundreds of hours dealing with that on the wiki for example, and we will definitely not open up another venue for that. If it's things that not-specifically-approved users can add, then it *must* be moderated.


The reason I thought every user profile should have a Contributor
object is that 1) it seemed easier from an implementation standpoint
than creating one only once someone has edited the contribution fields
of the form 2) most of the use cases for a pgo account seem related to
contributing (signing up for mailing lists, etc) -- I don't know if
they are used for other things like downloading postgres binaries etc.

No, the vast majority of pgo accounts are not in any way contributors. Subscribers to mailinglists, by a large majority, don't post/contribute. Attendees of conferences are mostly consumers and not contributors, etc etc way outnumber those who are actually logging in to the sites that are for contributors. We definitely don't have 175,000+ contributors...


Is there a good way to avoid making the Contributor object unless they
edit the "Contributions" field? Maybe there should be some kind of way
of saying "I contribute to Postgres" and "Contributions" is a required
field and then that makes the Contributor object and also kicks the
profile to some moderation queue for the Contributors team?

If the goal is the users can add themselves rather than the contributors team adding them, then yeah I think the process should be more similar to how users add a news article for example, or an organization (though they should have a 1-1 mapping of course). That is, it should be a separate "register me as a contributor" button which takes them to a separate form that specifically creates it. This can then also easily be moderated -- see the use of moderation mixins on for example organisations or professional services (news are a little special because they have dual-moderation, and that seems like overkill here).
 


> Also, when making changes to a model that only changes fields that aren't actually in the database (such as the change of help_text), instead of making a migration for that it's better to "backpatch" it into the latest existing migration. Otherwise we just collect a lot of no-op migrations that over time will start costing time and annoyance.

The latest existing migration that includes that field or just the
latest existing migration?

The latest one that includes that field. Doing that makes the "manage.py makemigration" no longer think there are any changes and stop emitting anything for that object.


> As for the questions - I think we should absolutely do opt-in, and I do think it makes sense to auto-opt-in the current major contributors since "it's been like that forever and they haven't complained", but listing the others and in a more visible way there are sure to be some who might not want it. In particular, maybe we should make the listing of *email* a separate opt-in/opt-out? That is you can opt-out of being listed completely, or you can say "list me, but not my email"?

So there would be a separate opt-in for being listed on the recognized
contributor page and for having a public individual contributor
profile? And we would only auto opt-in major contributors to the
public individual contributor profiles?

When writing that I was not aware that you were intending to have both a "recognized contributor" and a "self-claimed contributor". That does change it a bit. If it's a self-claimed contributor then it doesn't make much sense to opt-out.


And email display would be separately opt-in and if you opt-in it
displays on both the individual contributor profile page and on the
main recognized contributor profile page for major contributors and we
would auto opt-in email display for major contributors?

I think Christoph made a good point about this -- once the contributor profile requires an account, which it does in order to get published here, they can opt out by just changing their email to being empty. It's only for contributors that do not have an account connected that *we* need the email (so we can reach them), but with the discussed plan those wouldn't be listed anyway  since a username is needed in order to get listed. So that should leave us without needing a separate opt-out.
 

> I've thought a bit about it and I do think listing the profiles with the username in the URL as you have done is in the end good. I don't think people would care about exposing that one -- and it's already exposed on for example the commitfest app. But based on that I would go with "does not show at all if they don't have an account". They won't be able to edit any information on it anyway, and if they care enough to do that they will create an account. We will presumably continue to list them in the list of contributors, just not provide a details page.

That makes sense. Maybe we should start calling the Contributor
Profiles page [1] the Recognized Contributors page or Sustained
Contributors page instead of the Contributor Profiles page to
disambiguate it from individual contributor profiles. If only to make
spec'ing out this feature easier.

Yeah, I think that makes sense. If we're trying to add a whole new concept, we shouldn't try to force it in under the same name/umbrella. Let's make it clear.


> I wonder if we really need a separate "report inappropriate profile"? We should be getting notifications for them, but in particular if we are seriously worried about this case, we should make the records moderated. But these are known contributors - I think we can trust them?

I think we want people who are not recognized significant or major
contributors to be able to have profiles so that they can build them
up and eventually make the case for being a recognized significant or
major contributor. This would significantly increase the number of
people with profiles so moderation may get tricky.

Per above, if it is a field that any user can directly edit and it goes to publication, it must be moderated. That's a hard requirement. Before we made the whole "make me an editor" requirement for the wiki, for examples, we had upwards of 10,000 new accounts signed up every day just to post spam when it hit the peak.

We might need to add more moderators for it, but it needs to be moderated :)


What does it mean that we would get notifications for them? Is "we"
the contributors committee?

Right now, there's just the one moderation team and address that gets it for all types of objects. But it would probably be relatively easy to split that up so there could be multiple moderation-and-notification teams.


I would be okay with having them moderated if we thought the volume
would be like one a day (with more at the beginning). And maybe if it
is more, we could add another community member outside the
contributors committee to help moderate.

I don't know what an expected volume would be for "real" contributions, but even one per day sounds high to me -- obviously once you are past a peak when it's new. And as long as they don't go direct-to-publish spam publications tend to be fairly low, but they can certainly reach one or a couple per day. It's only with direct-to-publish we end up with thousands.
 
//Magnus

Introduce contributor badges

От:
Christoph Berg <myon@debian.org>
Дата:
Вложения:
Over the holidays, I used the time to implement the badges idea. We've
discussed in the team and we are happy with how it looks like now, and
I'm attaching the version with the changes from the last contributors
team meeting.

The technical description is in the commit message, so I'm not
duplicating that here. It's obviously a larger patch, but since the
badges are new, I'm not sure it's possible to split it up.

To make rollout less disruptive, we could deploy everything, but leave
out the part that creates links to the new parts
(pgweb/util/contexts.py, anything else?). That way we could test
everything, prefill some initial badges and badge holders, and put in
the links once everything is confirmed to work.

I also plan to present the design at the dev meeting in Brussels.


Re: Magnus Hagander
> If they are not based on the recognized contributors, they should probably
> not be part of that in the data model either. But in particular, we
> shouldn't start creating empty contributor profiles before we even *knoiw*
> that it would.

That part works like this in the patch:
- badges are awarded to users (not to contributors)
- users who have at least one badge are offered to create a profile
  page (creates the contributors object)
- these users can then fill in the data fields

> So any user without any confirmation can just add themselves as a
> contributor, without even moderation, and publish data? That sounds like a
> *really* bad idea, tbh.
> 
> If it's data published by users where we have at one point added them to
> the contributors list and therefore pre-moderated to some point that is
> reasonable. But allowing random people to add records and then edit them
> and then it turns out to be published is going to be a hard no -- we've
> spent many hundreds of hours dealing with that on the wiki for example, and
> we will definitely not open up another venue for that. If it's things that
> not-specifically-approved users can add, then it *must* be moderated.

The moderation part is that people have to convince a badge-issuing
organisation to add their pg.o account as badge holder. This is
possibly a lot of organisations and people, but everyone involved
should be a recognised community member. Also, the worst harm would be
that could publish a random text on a ..../username/ sub-page that is
easily deleted again if we monitor changes. (Afaict any changes to
contributor objects are mailed somewhere. Not sure if that includes
the bio part already, but it could certainly made to be.)

> The latest one that includes that field. Doing that makes the "manage.py
> makemigration" no longer think there are any changes and stop emitting
> anything for that object.

I haven't included the migrations in the patch yet, will do that after
review of the general feature.

> > As for the questions - I think we should absolutely do opt-in, and I do
> > think it makes sense to auto-opt-in the current major contributors since
> > "it's been like that forever and they haven't complained", but listing the
> > others and in a more visible way there are sure to be some who might not
> > want it. In particular, maybe we should make the listing of *email* a
> > separate opt-in/opt-out? That is you can opt-out of being listed
> > completely, or you can say "list me, but not my email"?
> >
> > So there would be a separate opt-in for being listed on the recognized
> > contributor page and for having a public individual contributor
> > profile? And we would only auto opt-in major contributors to the
> > public individual contributor profiles?
> 
> When writing that I was not aware that you were intending to have both a
> "recognized contributor" and a "self-claimed contributor". That does change
> it a bit. If it's a self-claimed contributor then it doesn't make much
> sense to opt-out.

The listing is opt-in. If the user never clicks the "create a profile
page" button, their name is not shown. Not even in the list of badge
holders on the badge page.

Once we have this system, the expectation would be that anyone who
we'd want to promote to a recognized contributor would already have a
profile page created. (If not, we should ask them first why.)

> I think Christoph made a good point about this -- once the contributor
> profile requires an account, which it does in order to get published here,
> they can opt out by just changing their email to being empty. It's only for
> contributors that do not have an account connected that *we* need the email
> (so we can reach them), but with the discussed plan those wouldn't be
> listed anyway  since a username is needed in order to get listed. So that
> should leave us without needing a separate opt-out.

Contributor.email is currently still "null=False, blank=True", should
probably change that to null=True.

> Per above, if it is a field that any user can directly edit and it goes to
> publication, it must be moderated. That's a hard requirement. Before we
> made the whole "make me an editor" requirement for the wiki, for examples,
> we had upwards of 10,000 new accounts signed up every day just to post spam
> when it hit the peak.
> 
> We might need to add more moderators for it, but it needs to be moderated :)

(See above) Even if that's people who have already proven to have
contributed something useful?

> What does it mean that we would get notifications for them? Is "we"
> > the contributors committee?
> 
> Right now, there's just the one moderation team and address that gets it
> for all types of objects. But it would probably be relatively easy to split
> that up so there could be multiple moderation-and-notification teams.

That might make sense. Or some of the contributors team members get an
extra job at pgweb moderation...

Christoph

Re: Introduce contributor badges

От:
Andrey Borodin <x4mmm@yandex-team.ru>
Дата:


> On 19 Jan 2026, at 21:28, Christoph Berg  wrote:
> 
> Over the holidays, I used the time to implement the badges idea. We've
> discussed in the team and we are happy with how it looks like now, and
> I'm attaching the version with the changes from the last contributors
> team meeting.

Thanks for working on this! Looks great!
I've setup preview version to test how things will look like. There's some generated sample data.

http://89.169.141.31:8000/community/people/alice/
ogin:moderator pwd:moderator123 
orgmanager1 manager123 
orgmanager2 manager123 
alice alice123 -- Has 3 badges + profile page
bob bob123 -- Has 2 bandges
charlie charlie123 -- 2 badges, without profile


I'm slightly worried that user does not approve their badges.
Also do we plan to add a page where user can claim a badge so org admin can approve their claim?

And I find it a bit oxymoron: "Basic contributor, not recognized"


Best regards, Andrey Borodin.

Re: Introduce contributor badges

От:
Christoph Berg <myon@debian.org>
Дата:
Re: Andrey Borodin
> Thanks for working on this! Looks great!
> I've setup preview version to test how things will look like. There's some generated sample data.
> 
> http://89.169.141.31:8000/community/people/alice/

Thanks, that makes review a bit easier for everyone else I guess.

The "people" page there has a problem:
http://89.169.141.31:8000/community/people/
It's not happening here, so I can't say if that's a bug in the patch.

> I'm slightly worried that user does not approve their badges.

The idea is that the badge itself needs approval and then is trusted.
So I think the worst thing that could happen is that someone
legitimately creates a "PostgreSQL Conf Antarctica Speaker", awards it
to you, but you don't want to publicly admit that you've been there.
Anything I'm missing?

> Also do we plan to add a page where user can claim a badge so org admin can approve their claim?

I think the basic workflow is that people contribute, an organisation
creates a badge for it and awards it to these people. For example,
after the PG19 release, we would create a "PostgreSQL 19 Contributor"
badge and award it to everyone listed in the release notes. Similarly
for conference speakers.

Maybe the other way round shouldn't be too easy so badge issuers don't
get flooded with requests. That's why we put the email link there.

Perhaps we need to make sure all approved badges have clear criteria
for badge holders. For example, "Has said something useful on the
mailing list" would be very fuzzy and invite request spam too much.

> And I find it a bit oxymoron: "Basic contributor, not recognized"

That's there to make the distinction to recognized contributors clear.
Better suggestions welcome.

Christoph


Re: Introduce contributor badges

От:
Christoph Berg <myon@debian.org>
Дата:
Re: To Andrey Borodin
> It's not happening here, so I can't say if that's a bug in the patch.

My mail client recoded the attachment as latin1. I'll replace the "·"
there by · , that's cleaner anyway.

Christoph


Re: Introduce contributor badges

От:
Christoph Berg <myon@debian.org>
Дата:
Вложения:
Re: To Andrey Borodin
> My mail client recoded the attachment as latin1. I'll replace the "·"
> there by · , that's cleaner anyway.

New version attached, with ^ this change and rebased.

Christoph

Re: Introduce contributor badges

От:
Christoph Berg <myon@debian.org>
Дата:
Вложения:
More polishing done, now including the database migration script.

Christoph

Re: Introduce contributor badges

От:
Christoph Berg <myon@debian.org>
Дата:
New version attached. Not much change, the biggest one is perhaps that
lists of badges are no longer rendered as html table, but in a CSS
grid. Everything seems to work as it should now.

My plan is to commit this, minus the menu change in
pgweb/util/contexts.py. That way, we can create the first badges and
check if everything really works without things already being visible
to users (unless they know the URLs).

Christoph


Re: Introduce contributor badges

От:
Christoph Berg <myon@debian.org>
Дата:
Вложения:
Re: To pgsql-www@lists.postgresql.org
> New version attached. Not much change, the biggest one is perhaps that
> lists of badges are no longer rendered as html table, but in a CSS
> grid. Everything seems to work as it should now.

Well, attached now.

Christoph

Re: Introduce contributor badges

От:
Magnus Hagander <magnus@hagander.net>
Дата:
On Fri, 24 Apr 2026 at 18:45, Christoph Berg <myon@debian.org> wrote:
New version attached. Not much change, the biggest one is perhaps that
lists of badges are no longer rendered as html table, but in a CSS
grid. Everything seems to work as it should now.

My plan is to commit this, minus the menu change in
pgweb/util/contexts.py. That way, we can create the first badges and
check if everything really works without things already being visible
to users (unless they know the URLs).


Given the fairly substantial concerns raised ofer this during in-person discussions at FOSDEM, please do *not* commit this until you have signoff from those involved. (It might be that it's fine, but given the concerns and discussions around it, let's make sure those are resolved).

//Magnus
 

Re: Introduce contributor badges

От:
Christoph Berg <myon@debian.org>
Дата:
Вложения:
Re: Magnus Hagander
> Given the fairly substantial concerns raised ofer this during in-person
> discussions at FOSDEM, please do *not* commit this until you have signoff
> from those involved. (It might be that it's fine, but given the concerns
> and discussions around it, let's make sure those are resolved).

I said in the other thread:

> The last result (from the lunch discussion in Brussels) was that we
> need handling of retired people from "permanent" badges like "Sysadmin
> Team". That's not included yet, but in the team, we concluded that
> instead of some complicated date range handling (perhaps that's what
> you remember as plenty?) we can just add a single boolean "retired"
> flag. We don't have that yet, but that's not a big blocker.

I've now implemented retiring from badges. Internally it's tracked by
filling in a date_retired field, but in order not to overcomplicate
the user interface, it's treated as a boolean. Retirees still show up
in badge listing, but are marked as retired.

Removing people from badges is now a two-stage process, retire them
and then remove them. To un-retire someone, add their email address
again (which NULLs the date_retired field).

I'm attaching that as a separate commit for better review. It would
get squashed before committing, of course.

I believe that addresses the concerns from Brussels, or was there
anything else?

Christoph

Re: Introduce contributor badges

От:
Christoph Berg <myon@debian.org>
Дата:
Вложения:
Hi,

thanks Magnus for the in-depth patch review during the Lowlands PGday.

I'm attaching v11.

> I also note that patch 2 doesn't have the changes that went into pgeu. We should probably merge patches 1 and 2 as a single "import frm pgeu-system" and just grab the current head there, since it has progressed since. I can do that when the time comes.

I merged the two patches into 0001, but I don't see any new pgeu
changes that would affect this. What am I missing?

> Is there a reason that OneToOne change to the User model can't be done as a separate thing before this? In the interest of keeping things into easily reviewable pieces?

This is 0002 now.

> nitpick is you can save a bunch of html padding by not adding badges-cell to each cell and instead just use a css rule anchored in badges-grid I think, similar to how you're already doing it for the img just one step higher.
> and since some of these pages can get large quickly...

Done. Please check if I understood that correctly and did the correct
change, though :)

> Patch also contains 73aab7456 which has already been applied... So needs some rebasing.

That should have resolved itself.

> Queries for badges should avoid reading the imagedata in every query that doesn't need it. Using defer — probably by defining a default defer.

Fixed.

> UserModelMultipleChoiceField seems to be a bad name for something that checks Contributors, not Users?

Changed.

> Purging definitely needs to be more specific, we don't want to purge everything including all the images when a contributor is edited.

Also done. Since purges can be limited to specific pages by '...$', I
did not move any URLs around.

> (sprite discussion, will do that one in person )

I took a mental note of the problem - we'll revisit that once we have
too many badges (or better a bit before that).

> For the "list all people" view if we don't want to do pagination at this time can we at least put a temporary ceiling on it so we don't generate an absolutely ginormous page. as in only show the first 500 or something. It'll take time to reach that point, but it will get increasingly painful on the way there.

There's limits now, but I went with 2000. There are 1700 distinct
names mentioned in the release notes since PG10 and I think we would
hit 500 rather quickly.

Christoph

Re: Introduce contributor badges

От:
Christoph Berg <myon@debian.org>
Дата:
Re: To Magnus Hagander
> Hi,
> 
> I'm attaching v11.

I am not aware of any open issues - I would like start merging this
next week so we still have some time before pgconf.eu to evaluate.

Christoph


Re: Introduce contributor badges

От:
Daniel Gustafsson <daniel@yesql.se>
Дата:
> On 2 Oct 2026, at 13:42, Christoph Berg  wrote:

> I would like start merging this next week so we still have some time before
> pgconf.eu to evaluate.

Having this in well before .eu sounds like a very good plan.

--
Daniel Gustafsson



Re: Introduce contributor badges

От:
Christoph Berg <myon@debian.org>
Дата:
Re: Daniel Gustafsson
> > I would like start merging this next week so we still have some time before
> > pgconf.eu to evaluate.
> 
> Having this in well before .eu sounds like a very good plan.

Thanks. :)

I pushed the first three patches now. Over the weekend I had done more
polishing and fixing of some minor details, as well as several AI
sessions walking through all workflows and confirming things worked.
(They did.) This made me confident to proceed (and Magnus review at
Lowlands sounded like he was ok with the general shape and I believe I
addressed all the points he raised).

The one non-trivial change still done was that badge URLs are now
readable slugs instead of boring IDs. That change was small and
targeted so it didn't feel like requiring another round of reviews.
The slug is fixed on badge creation, so even renaming the badge title
doesn't change it. (It is still admin-editable in the django
interface.)

So the badges infrastructure is in place now on postgresql.org. As
said in the original plan, there are no links to it yet, so we can
still check if everything really works as intended.

Magnus remarked that he wants more review of the patch before we start
adding actual badges, so please everyone check that everything is ok.
The contributors committee still wants to announce the feature at
pgconf.eu (which is 2 weeks from now), so it would be awesome if we
had an answer by the end of this week, and we could add the first
badges (PostgreSQL 19 Contributor?) next week.

The point he raised from a 30s look was that changing the slug doesn't
invalidate the URL from varnish. My stance on that is we don't really
need to cover that because slug changes are rare (admin-interface
only), and we can simply agree to not rename a badge slug after any
users have been added. Also, the new URL works immediately, and the
old one will eventually time out, and there should be nothing in there
that needs immediate deletion (or else we should just edit it and that
is properly purged). We could cover that, but that's more of an
infrastructure change in the pgweb system handling news/events/.../and
now badges.

Christoph


Re: Introduce contributor badges

От:
Melanie Plageman <melanieplageman@gmail.com>
Дата:
On Mon, Oct 5, 2026 at 10:55 AM Christoph Berg  wrote:
>
> So the badges infrastructure is in place now on postgresql.org. As
> said in the original plan, there are no links to it yet, so we can
> still check if everything really works as intended.

Yes, I clicked on the links that do work now and looks good to me and
seems as we discussed.

> Magnus remarked that he wants more review of the patch before we start
> adding actual badges, so please everyone check that everything is ok.
> The contributors committee still wants to announce the feature at
> pgconf.eu (which is 2 weeks from now), so it would be awesome if we
> had an answer by the end of this week, and we could add the first
> badges (PostgreSQL 19 Contributor?) next week.

Yes, the Contributors Committee would love to be able to add a few
badges next week before EU. We think it will be fun for contributors
who attend the event to be able to get an initial badge and show them
off to each other at the event.

- Melanie


Re: Introduce contributor badges

От:
Daniel Gustafsson <daniel@yesql.se>
Дата:
> On 5 Oct 2026, at 16:54, Christoph Berg  wrote:

> I pushed the first three patches now.

Thanks for working on this.  I did a first postcommit review and have a few small
comments.

	+    (
	+        "badge",
	+        models.CharField(
	+            help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".',
	+            max_length=32,

Will 32 characters be enough for all purposes?  A "Nordic PGDay 2026 Program
Committee" badge as an example would require more than 32, and I can imagine
others like that.  It's good that submissions need to be creative to fit within
a constraint, but we also don't want to end up with needlessly abbreviated
badges.


	+        pgweb.util.fields.ImageBinaryField(
	+            blank=True,
	+            help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.",

While Slony was a great tool back i the day, I think you mean "Slonik logo"
here =) I wonder though, will everyone be familiar with "Slonik" or should we
just say "PostgreSQL logo"?  I also fear that allowing 1MB large image files
opens the risk for getting detailed and feature rich submissions which will
look terrible in 150x150.


	+        models.CharField(
	+            blank=True,
	+            help_text="Contact address (email, URL, other) for people who want to be added as badge holder",

Should we keep it simple and limit this to email for now?  If we encourage
people to visit third party sites we don't control in order to control behavior
on our site then we need to verify said sites.


	-        help_text='This description is currently used for major contributors only')
	+        help_text='Describe what you did in the PostgreSQL community')

This reads like focusing on the past like adding an Alumni entry, shouldn't
this be more like "Describe your involvement in the PostgreSQL community"?

	+      {%for u in holders.all%}
	+        
  • {%if u.date_retired%}{%endif%}{{u.user.contributor.firstname}} {{u.user.contributor.lastname}}{%if u.date_retired%} (retired from this activity){%endif%}
  • + {%endfor%} Rather than wrapping the entry with a conditional it seems like a cleaner solution to use the condition to set a CSS class which controls the rendering. This is more a nice-to-have of course. +

    People are listed in alphabetical order.

    s/People/Contributors/ ? + If you are listed and want to claim your profile page, write a mail including your community account name to + contributors@postgresql.org. Shouldn't this (and a previous instance of webmaster@) use the hidemail filter for consistency? contribution = models.TextField(null=True, blank=True, - help_text='This description is currently used for major contributors only') + help_text='Describe what you did in the PostgreSQL community') When opening this up to a lot more people than the major contributors, this field should probably be sanitized when saved (and possibly when read as well) to keep malicious content out. Maybe that's already done today and I'm plain missing that, but if not we need to do that IMO. I'll revisit the remaining parts in a follow-up look. -- Daniel Gustafsson

    Re: Introduce contributor badges

    От:
    Christoph Berg <myon@debian.org>
    Дата:
    Re: Daniel Gustafsson
    > 	+        "badge",
    > 	+        models.CharField(
    > 	+            help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".',
    > 	+            max_length=32,
    > 
    > Will 32 characters be enough for all purposes?  A "Nordic PGDay 2026 Program
    > Committee" badge as an example would require more than 32, and I can imagine
    > others like that.  It's good that submissions need to be creative to fit within
    > a constraint, but we also don't want to end up with needlessly abbreviated
    > badges.
    
    Thanks for the example. One goal here is to have the titles not make
    the grid of badges on the people page not explode, but it should of
    course not be too restrictive. I guess we need to bump this. (I would
    rather limit the length per moderation than technically.)
    
    > 	+        pgweb.util.fields.ImageBinaryField(
    > 	+            blank=True,
    > 	+            help_text="Square image, will be auto-scaled to 150×150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.",
    > 
    > While Slony was a great tool back i the day, I think you mean "Slonik logo"
    > here =) I wonder though, will everyone be familiar with "Slonik" or should we
    > just say "PostgreSQL logo"?
    
    PostgreSQL logo is better, yes.
    
    > I also fear that allowing 1MB large image files
    > opens the risk for getting detailed and feature rich submissions which will
    > look terrible in 150x150.
    
    Is that the problem of the limit? People could submit terrible things
    even at smaller scales. (Again, perhaps a question for moderation.)
    
    > 	+        models.CharField(
    > 	+            blank=True,
    > 	+            help_text="Contact address (email, URL, other) for people who want to be added as badge holder",
    > 
    > Should we keep it simple and limit this to email for now?  If we encourage
    > people to visit third party sites we don't control in order to control behavior
    > on our site then we need to verify said sites.
    
    This would usually be something like https://2026.pgconf.eu/contact/,
    so be in community control. It's also shown at moderation time and
    part of the notification emails sent when edited post-moderation (I
    think, I don't get moderation email yet). So I think we don't need to
    be overly restrictive here. Allowing URLs also enables events without
    a persistent email address.
    
    > 	-        help_text='This description is currently used for major contributors only')
    > 	+        help_text='Describe what you did in the PostgreSQL community')
    > 
    > This reads like focusing on the past like adding an Alumni entry, shouldn't
    > this be more like "Describe your involvement in the PostgreSQL community"?
    
    Sounds good.
    
    > 	+      {%for u in holders.all%}
    > 	+        
  • {%if u.date_retired%}{%endif%}{{u.user.contributor.firstname}} {{u.user.contributor.lastname}}{%if u.date_retired%} (retired from this activity){%endif%}
  • > + {%endfor%} > > Rather than wrapping the entry with a conditional it seems like a cleaner > solution to use the condition to set a CSS class which controls the rendering. > This is more a nice-to-have of course. Ack. > +

    People are listed in alphabetical order.

    > > s/People/Contributors/ ? We deliberately don't say "Contributor" there to keep the perceived distance to the original now-"recognized" contributors list greater. Of course everyone in that list did contribute, so this is maybe splitting hairs... > + If you are listed and want to claim your profile page, write a mail including your community account name to > + contributors@postgresql.org. > > Shouldn't this (and a previous instance of webmaster@) use the hidemail filter > for consistency? Ack. > contribution = models.TextField(null=True, blank=True, > - help_text='This description is currently used for major contributors only') > + help_text='Describe what you did in the PostgreSQL community') > > When opening this up to a lot more people than the major contributors, this > field should probably be sanitized when saved (and possibly when read as well) > to keep malicious content out. Maybe that's already done today and I'm plain > missing that, but if not we need to do that IMO. It's already html-escaped. I was thinking of allowing markdown in the future (and render only the first paragraph in the recognized contributors page), but then we'll have the question of links etc again. The answer we settled on when we discussed that with Magnus was that post-moderation by reading the change emails is good enough. Anyone on that list did something positive for the community, and they will not want to get kicked out for doing something evil with their profile page. > I'll revisit the remaining parts in a follow-up look. Thanks! Christoph

    Re: Introduce contributor badges

    От:
    Daniel Gustafsson <daniel@yesql.se>
    Дата:
    > On 9 Oct 2026, at 20:40, Christoph Berg  wrote:
    > 
    > Re: Daniel Gustafsson
    >> +        "badge",
    >> +        models.CharField(
    >> +            help_text='Title of this badge, e.g. "PGConf.EU 2025 Speaker".',
    >> +            max_length=32,
    >> 
    >> Will 32 characters be enough for all purposes?  A "Nordic PGDay 2026 Program
    >> Committee" badge as an example would require more than 32, and I can imagine
    >> others like that.  It's good that submissions need to be creative to fit within
    >> a constraint, but we also don't want to end up with needlessly abbreviated
    >> badges.
    > 
    > Thanks for the example. One goal here is to have the titles not make
    > the grid of badges on the people page not explode, but it should of
    > course not be too restrictive. I guess we need to bump this. (I would
    > rather limit the length per moderation than technically.)
    
    Sounds sensible, bumping the limit and making moderation stricter sounds like a
    plan forwards.
    
    >> I also fear that allowing 1MB large image files
    >> opens the risk for getting detailed and feature rich submissions which will
    >> look terrible in 150x150.
    > 
    > Is that the problem of the limit? People could submit terrible things
    > even at smaller scales. (Again, perhaps a question for moderation.)
    
    They can, but it's a lot easier to mess up when working with an intermediate
    representation where the end result is a product of transformation.  I would
    start with a more restrictive limit and possibly increase later rather than the
    other way around.
    
    >> +

    People are listed in alphabetical order.

    >> >> s/People/Contributors/ ? > > We deliberately don't say "Contributor" there to keep the perceived > distance to the original now-"recognized" contributors list greater. > Of course everyone in that list did contribute, so this is maybe > splitting hairs... That's a fair argument, but "people" sound very generic and more like a decription of an unknown group. Maybe "Community members" or something else? >> contribution = models.TextField(null=True, blank=True, >> - help_text='This description is currently used for major contributors only') >> + help_text='Describe what you did in the PostgreSQL community') >> >> When opening this up to a lot more people than the major contributors, this >> field should probably be sanitized when saved (and possibly when read as well) >> to keep malicious content out. Maybe that's already done today and I'm plain >> missing that, but if not we need to do that IMO. > > It's already html-escaped. Good, I missed that when skimming the pgweb code. > I was thinking of allowing markdown in the > future (and render only the first paragraph in the recognized > contributors page), but then we'll have the question of links etc > again. Markdown would be nice as a future improvement, if it can be restricted to not include links. > The answer we settled on when we discussed that with Magnus was that > post-moderation by reading the change emails is good enough. Anyone on > that list did something positive for the community, and they will not > want to get kicked out for doing something evil with their profile > page. Agreed.. >> I'll revisit the remaining parts in a follow-up look. A few further comments from a second read-through. I am not particularly Django-literate so I might well have missed something there. + re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile), Shouldn't this match the regexp for allowed characters in the username? -

    You can edit the information that's shown on the contributors page. +

    You can edit the information that's shown on your profile page. Maybe nitpicking, but this will still be published on the community/contributors page for a subset of users. Should the text reflect that, possibly conditional on the the logged in users controbutor status? +

    + Create publicly visible profile page +
    To be consistent with modern HTML (where we are going with pgweb) I think the should have an id attributed and a for that attribute. +

    Getting added

    +{% if badge.org %} +

    This badge is issued by {{badge.org}}.

    +{%endif%} + +

    If you think you should be listed + here, check your account profile page if the + badge is present there and activate your contribution profile page. If not, + contact the badge issuing organisation and ask to be added.

    + +{% if badge.contact %} +

    Contact information: {{badge.contact}}.

    +{%endif%} A badge can be without both a contact and an org IIUC which, although highly unlikely, should probably be reflected in the template. Maybe the entire "Getting added" section should be omitted if .org and .contact are both blank? + All tags must have alt attributes to keep our accessibility score. -- Daniel Gustafsson

    Re: Introduce contributor badges

    От:
    Christoph Berg <myon@debian.org>
    Дата:
    Вложения:
    Re: Daniel Gustafsson
    > Will 32 characters be enough for all purposes?  A "Nordic PGDay 2026 Program
    > Committee" badge as an example would require more than 32, and I can imagine
    > others like that.  It's good that submissions need to be creative to fit within
    > a constraint, but we also don't want to end up with needlessly abbreviated
    > badges.
    
    I've staged a bump to 64 (to match the max slug length). To keep the
    migrations churn down, we should bundle that with the next database
    update (or when we actually run into the limit).
    
    > While Slony was a great tool back i the day, I think you mean "Slonik logo"
    > here =) I wonder though, will everyone be familiar with "Slonik" or should we
    > just say "PostgreSQL logo"?  I also fear that allowing 1MB large image files
    > opens the risk for getting detailed and feature rich submissions which will
    > look terrible in 150x150.
    
    Changed to "PostgreSQL logo" in the attached patch.
    
    > This reads like focusing on the past like adding an Alumni entry, shouldn't
    > this be more like "Describe your involvement in the PostgreSQL community"?
    
    Same.
    
    > Rather than wrapping the entry with a conditional  it seems like a cleaner
    > solution to use the condition to set a CSS class which controls the rendering.
    > This is more a nice-to-have of course.
    
    ... same.
    
    > Shouldn't this (and a previous instance of webmaster@) use the
    > hidemail filter for consistency?
    
    None of the other static appearances of email addresses in the
    codebase does that, the @postgresql.org strings are all there in
    plain.
    
    
    Re: Daniel Gustafsson
    > >> I also fear that allowing 1MB large image files
    > >> opens the risk for getting detailed and feature rich submissions which will
    > >> look terrible in 150x150.
    > > 
    > > Is that the problem of the limit? People could submit terrible things
    > > even at smaller scales. (Again, perhaps a question for moderation.)
    > 
    > They can, but it's a lot easier to mess up when working with an intermediate
    > representation where the end result is a product of transformation.  I would
    > start with a more restrictive limit and possibly increase later rather than the
    > other way around.
    
    I'm unsure here. Which size limit would you suggest?
    
    (TBH I think we shouldn't micro-manage this. If the badge logo looks
    terrible, the submitter can still swap it later.)
    
    > That's a fair argument, but "people" sound very generic and more like a
    > decription of an unknown group.  Maybe "Community members" or something else?
    
    It currently looks like this:
    
      http://localhost:8000/community/people/
    
      People in the PostgreSQL Community
    
      These are the fine people who have made contributions to PostgreSQL over the years.
    
      Recognized Significant and Major Contributors are listed on the PostgreSQL Recognized Contributors page.
    
      Bob Badgeholder · Christoph Berg · Pat Holder
    
    
    ... so before we say "fine people" there the heading and the URL that
    already have "people" and put that into context. The wording isn't
    mine, it's taken from the existing /community/contributors/ page and
    frankly, "the fine community members" isn't that snappy.
    
    > > I was thinking of allowing markdown in the
    > > future (and render only the first paragraph in the recognized
    > > contributors page), but then we'll have the question of links etc
    > > again.
    > 
    > Markdown would be nice as a future improvement, if it can be restricted to not
    > include links.
    
    Ack. I'll keep that for the next iteration.
    
    > >> I'll revisit the remaining parts in a follow-up look.
    > 
    > A few further comments from a second read-through.  I am not particularly
    > Django-literate so I might well have missed something there.
    > 
    > 	+    re_path(r'^community/people/([^/]+)/$', pgweb.contributors.views.profile),
    > 
    > Shouldn't this match the regexp for allowed characters in the username?
    
    Most URL patterns in that file don't do that either, and if someone
    tries a username that doesn't exist, they just get a 404 error.
    
    > 	-    

    You can edit the information that's shown on the contributors page. > +

    You can edit the information that's shown on your profile page. > > Maybe nitpicking, but this will still be published on the > community/contributors page for a subset of users. Should the text reflect > that, possibly conditional on the the logged in users controbutor status? The form and this text is only shown if the user already has a contributor object in the database. Was that the question? > To be consistent with modern HTML (where we are going with pgweb) I think the > should have an id attributed and a for that attribute. Done. > +

    Getting added

    > +{% if badge.org %} > +

    This badge is issued by {{badge.org}}.

    > +{%endif%} > + > +

    If you think you should be listed > + here, check your account profile page if the > + badge is present there and activate your contribution profile page. If not, > + contact the badge issuing organisation and ask to be added.

    > + > +{% if badge.contact %} > +

    Contact information: {{badge.contact}}.

    > +{%endif%} > > A badge can be without both a contact and an org IIUC which, although highly > unlikely, should probably be reflected in the template. Maybe the entire > "Getting added" section should be omitted if .org and .contact are both blank? The contact information might still be obvious from the context (like asking the conference organizers), so I'd tend to leave it like it is. (This is probably a question that is better answered once we have the first concrete badges in to see how it feels in practise.) > + > > All tags must have alt attributes to keep our accessibility score. Done. Thanks for the review! What do you think about the open ends? Attachments: v12-0001-Contributor-copy-editing.patch - the stuff from this mail v12-0001-Make-contributor-badges-discoverable.patch - what will actually put the badges live v12-0001-Extend-badge-title-to-64-chars.patch - future database fix Assuming v12-0001-Contributor-copy-editing.patch is ok, would you think that we can proceed with adding some badges now? My hope would be to have at least "PostgreSQL 18 Contributor" live for Valencia. Timeline: after ack: apply v12-0001-Contributor-copy-editing.patch this week: create initial badges, add holders have badges approved in moderation (they are still not visible) shortly before the conference: apply v12-0001-Make-contributor-badges-discoverable.patch later: apply v12-0001-Extend-badge-title-to-64-chars.patch Christoph

    Re: Introduce contributor badges

    От:
    "Jonathan S. Katz" <jkatz@postgresql.org>
    Дата:
    Вложения:
    Hi,
    
    Thanks for working on this. I can provide some review on the current 
    patches.
    
    On 10/12/26 9:28 AM, Christoph Berg wrote:
    
    > What do you think about the open ends?
    > 
    > Attachments:
    > v12-0001-Contributor-copy-editing.patch - the stuff from this mail
    
    While looking at the text edits, I saw that we're storing the badge 
    binary in the database. This would be a first for .org; typically we 
    store these in the repo, so we can leverage whatever cache/CDN 
    mechanisms we have. While the code is pretty neat, IMV it'd be better to 
    store it in our standard image directory.
    
    If there's a reason for this to be in the database, please let me know. 
    I also know this is one of those things that we can ultimately change.
    
    The rest of this looks OK.
    
    > v12-0001-Make-contributor-badges-discoverable.patch - what will
    >    actually put the badges live
    
    I guess I missed why we're separating out Contributors + People, but if 
    it's agreed upon I don't have too strong of an opinion. Otherwise just 
    looking at it, I'm confused at the difference :) Maybe we have to also 
    retitle "Contributors" to "Recognized Contributors", i.e.
    
    -         {'title': 'Contributors', 'link': '/community/contributors/'},
    +         {'title': 'Recognized Contributors', 'link': 
    '/community/contributors/'},
    
    (which also matches the new title of the page)
    
    The rest LGTM.
    
    > v12-0001-Extend-badge-title-to-64-chars.patch - future database fix
    
    I don't think we need to be stingy on the characters here; I think the 
    "default" we've used is 255; let's just be safe. (I'm also OK if we 
    don't use TextField given these will typically be short).
    
    
    > Assuming v12-0001-Contributor-copy-editing.patch is ok, would you
    > think that we can proceed with adding some badges now? My hope would
    > be to have at least "PostgreSQL 18 Contributor" live for Valencia.
    > 
    > Timeline:
    > after ack: apply v12-0001-Contributor-copy-editing.patch
    > this week: create initial badges, add holders
    >             have badges approved in moderation (they are still not visible)
    > shortly before the conference: apply v12-0001-Make-contributor-badges-discoverable.patch
    > later: apply v12-0001-Extend-badge-title-to-64-chars.patch
    Thanks,
    
    Jonathan
    

    Re: Introduce contributor badges

    От:
    Christoph Berg <myon@debian.org>
    Дата:
    Вложения:
    Re: Jonathan S. Katz
    > Thanks for working on this. I can provide some review on the current
    > patches.
    
    Thanks!
    
    > While looking at the text edits, I saw that we're storing the badge binary
    > in the database. This would be a first for .org; typically we store these in
    > the repo, so we can leverage whatever cache/CDN mechanisms we have. While
    > the code is pretty neat, IMV it'd be better to store it in our standard
    > image directory.
    > 
    > If there's a reason for this to be in the database, please let me know. I
    > also know this is one of those things that we can ultimately change.
    
    I've had file/repo storage in the first version because it was
    simpler, but Magnus said we should use the pgeu image-in-database
    code. I tend to agree that database is better, this is content that is
    added frequently ("PGconf Wherever 20xx Speaker"), so automating the
    process as much as possible makes sense.
    
    The images themselves don't change (much), so varnish caching should
    just work. One point that Magnus raised is if there are many images on
    a page, some web browsers will open 80 concurrent connections and run
    into some rate limit. If we reach that point, we need to create
    sprites and serve the badges grid as one big image. (This is a UX
    issue, not a bandwidth one.) But there is still time until that
    happens, and for that, we can take the images from the database as
    well.
    
    > The rest of this looks OK.
    > 
    > > v12-0001-Make-contributor-badges-discoverable.patch - what will
    > >    actually put the badges live
    > 
    > I guess I missed why we're separating out Contributors + People, but if it's
    > agreed upon I don't have too strong of an opinion. Otherwise just looking at
    > it, I'm confused at the difference :)
    
    We can definitely revisit the split after some time.
    
    > Maybe we have to also retitle
    > "Contributors" to "Recognized Contributors", i.e.
    > 
    > -         {'title': 'Contributors', 'link': '/community/contributors/'},
    > +         {'title': 'Recognized Contributors', 'link':
    > '/community/contributors/'},
    
    I had tried that, but rejected it because it got wrapped over two
    lines in the sidebar, and none of the other menus have multi-line
    entries. But maybe that's not a problem and we should just do it.
    Done in the attached v13-0002.
    
    > The rest LGTM.
    > 
    > > v12-0001-Extend-badge-title-to-64-chars.patch - future database fix
    > 
    > I don't think we need to be stingy on the characters here; I think the
    > "default" we've used is 255; let's just be safe. (I'm also OK if we don't
    > use TextField given these will typically be short).
    
    Ack, will bump it in the staged DB commit v13-0003.
    
    > > Assuming v12-0001-Contributor-copy-editing.patch is ok, would you
    > > think that we can proceed with adding some badges now? My hope would
    > > be to have at least "PostgreSQL 18 Contributor" live for Valencia.
    > > 
    > > Timeline:
    > > after ack: apply v12-0001-Contributor-copy-editing.patch
    > > this week: create initial badges, add holders
    > >             have badges approved in moderation (they are still not visible)
    > > shortly before the conference: apply v12-0001-Make-contributor-badges-discoverable.patch
    > > later: apply v12-0001-Extend-badge-title-to-64-chars.patch
    > Thanks,
    > 
    > Jonathan
    
    Given that we now have the review from Daniel and this what I read as
    review-and-ack from Jonathan, I think we can proceed to add actual
    badges. Tomorrow is 19rc1 release day, so I'd say Friday.
    
    Christoph
    

    Re: Introduce contributor badges

    От:
    Daniel Gustafsson <daniel@yesql.se>
    Дата:
    > On 14 Oct 2026, at 20:26, Christoph Berg  wrote:
    
    > Given that we now have the review from Daniel and this what I read as
    > review-and-ack from Jonathan, I think we can proceed to add actual
    > badges. Tomorrow is 19rc1 release day, so I'd say Friday.
    
    I don't have any insight into this other than agreeing that we shouldn't do
    anything until 19rc1 is out.
    
    One small comment on 0001:
    
    	-         help_text="Square image, will be auto-scaled to 150◊150. JPEG or PNG, up to 1 MB. When left blank, the Slony logo will be used.",
    	+         help_text="Square image, will be auto-scaled to 150◊150. JPEG or PNG, up to 1 MB. When left blank, the PostgreSQL logo will be used.",
    
    This seems to be using a special character for "x" in "150x150", if so that
    should probably use an html entity instead.
    
    --
    Daniel Gustafsson
    
    
    
    

    Re: Introduce contributor badges

    От:
    "Jonathan S. Katz" <jkatz@postgresql.org>
    Дата:
    Вложения:
    On 10/14/26 2:45 PM, Daniel Gustafsson wrote:
    >> On 14 Oct 2026, at 20:26, Christoph Berg  wrote:
    > 
    >> Given that we now have the review from Daniel and this what I read as
    >> review-and-ack from Jonathan, I think we can proceed to add actual
    >> badges. Tomorrow is 19rc1 release day, so I'd say Friday.
    > 
    > I don't have any insight into this other than agreeing that we shouldn't do
    > anything until 19rc1 is out.
    I wholeheartedly agree and thank you for waiting until after the 
    release, having, in the past, to do emergency rebasing in the middle of 
    a release due to pgweb changes having been pushed the night before :)
    
    Jonathan
    

    Re: Introduce contributor badges

    От:
    Magnus Hagander <magnus@hagander.net>
    Дата:


    On Thu, 15 Oct 2026 at 03:34, Jonathan S. Katz <jkatz@postgresql.org> wrote:
    On 10/14/26 2:45 PM, Daniel Gustafsson wrote:
    >> On 14 Oct 2026, at 20:26, Christoph Berg <myon@debian.org> wrote:
    >
    >> Given that we now have the review from Daniel and this what I read as
    >> review-and-ack from Jonathan, I think we can proceed to add actual
    >> badges. Tomorrow is 19rc1 release day, so I'd say Friday.
    >
    > I don't have any insight into this other than agreeing that we shouldn't do
    > anything until 19rc1 is out.
    I wholeheartedly agree and thank you for waiting until after the
    release, having, in the past, to do emergency rebasing in the middle of
    a release due to pgweb changes having been pushed the night before :)


    I will point out that I *explicitly* asked that this system not be used fully until I had completed my review. I have *not* withdrawn this requirement. AFAIK nobody has done the full review ont he impact this will have on our caching setups and the production systems. If that is wrong, then please point me to that. But if not, then my objection still stands, and I am *not* happy that my *explicit* request to review production impact was not honored.

    //Magnus
     

    Re: Introduce contributor badges

    От:
    Christoph Berg <myon@debian.org>
    Дата:
    Re: Magnus Hagander
    > I will point out that I *explicitly* asked that this system not be used
    > fully
    
    Fwiw, it is not fully in use yet. There are no links to badges or to
    the people page. There is not going to be a huge spike of requests
    because no one has these URLs yet.
    
    We are doing this precisely to allow looking at how it works in
    practise before the world runs over it.
    
    > until I had completed my review. I have *not* withdrawn this
    > requirement. AFAIK nobody has done the full review ont he impact this will
    > have on our caching setups and the production systems.
    
    Afaict the proper purge rules are in place, and the images have Etag
    headers. We can check all that once a badge is approved. (I had
    already submitted "PostgreSQL 18 Contributor" before your mail.)
    
    > If that is wrong,
    > then please point me to that. But if not, then my objection still stands,
    > and I am *not* happy that my *explicit* request to review production impact
    > was not honored.
    
    I still believe that we addressed all concerns. I was aware that you
    wanted more review, that's why we did that here. If that review was
    not enough going into that direction, I'm sorry - that's why we did it
    here openly on the list. Yes I know it's conference preparation time
    for you, but it should have been obvious that we were moving to
    putting this live, so just a "please do more review of X" line would
    have helped.
    
    Christoph
    
    
    

    Re: Introduce contributor badges

    От:
    Dave Page <dpage@pgadmin.org>
    Дата:


    On Fri, 16 Oct 2026 at 08:56, Christoph Berg <myon@debian.org> wrote:
    Re: Magnus Hagander
    > I will point out that I *explicitly* asked that this system not be used
    > fully

    Fwiw, it is not fully in use yet. There are no links to badges or to
    the people page. There is not going to be a huge spike of requests
    because no one has these URLs yet.

    We are doing this precisely to allow looking at how it works in
    practise before the world runs over it.

    > until I had completed my review. I have *not* withdrawn this
    > requirement. AFAIK nobody has done the full review ont he impact this will
    > have on our caching setups and the production systems.

    Afaict the proper purge rules are in place, and the images have Etag
    headers. We can check all that once a badge is approved. (I had
    already submitted "PostgreSQL 18 Contributor" before your mail.)

    > If that is wrong,
    > then please point me to that. But if not, then my objection still stands,
    > and I am *not* happy that my *explicit* request to review production impact
    > was not honored.

    I still believe that we addressed all concerns. I was aware that you
    wanted more review, that's why we did that here. If that review was
    not enough going into that direction, I'm sorry - that's why we did it
    here openly on the list. Yes I know it's conference preparation time
    for you, but it should have been obvious that we were moving to
    putting this live, so just a "please do more review of X" line would
    have helped.

    I haven't had time to review it properly yet, but I just had Claude Opus review it, and it seems to think there are a few issues that need fixing. I told it to pay particular attention to performance:

    Commits reviewed: `bfbb841`, `1993c00`, `8eb38fb`, `5cdc3ed`, `7257af2`, `c93898e`, `73aab74`.

    The only ones with performance or caching implications are `bfbb841` (image field) and `8eb38fb` (contributor badges). The download-page edits, the pycodestyle fix, the OneToOneField migration and the copy-editing commit are all fine. `manage.py check` reports no issues.

    ## Varnish cache invalidation

    The site relies on Varnish holding pages for a long time and on purges to clear them (`docs/frontend.rst`). Several changes in the badges feature never send a purge, so stale pages stay up until the default time-to-live (TTL) runs out, and longer in grace mode.

    1. **Removing a holder purges nothing for that person.** `BadgeForm.save` calls `badge.holders.remove()` (`pgweb/contributors/forms.py`). That deletes the through-table rows without any `post_save`, and pgweb only hooks `post_save` (`pgweb/util/signals.py:169`). The badge page still gets purged, because `simple_form` saves the badge afterwards. The removed person's `/community/people/<username>/` page keeps showing the badge.
    2. **Deletes never purge.** This applies to deleting a `Badge`, `Badgeholder` or `Contributor` in the admin. The rest of pgweb has the same gap, but it matters more here: a deleted contributor's public profile page, which can include their email, stays cached. If someone asks for their profile to be removed, it isn't really gone.
    3. **Approving or editing a badge doesn't purge its holders' profile pages.** `Badge.purge_urls` says profiles "get refreshed when their holder rows are edited", but approval, unapproval, a title change and an image added or removed all leave the profiles stale. After unapproval, profiles keep linking to `/community/badge/<slug>/image/`, which now returns a 404 that Varnish may also cache. The fix is xkeys, which the docs already describe as the better option: tag the badge, people and profile responses with something like `pgbadge_<id>` and give `Badge` a `purge_xkeys`. That also replaces the per-holder URL loops.
    4. **The image URL never changes when the image does.** `/community/badge/<slug>/image/` has no file extension and no version in it. The docs say Varnish applies a longer policy to images "because they are considered never to change". Varnish itself is purged, but if the Varnish configuration (VCL) also sends long browser cache headers for images, browsers will keep showing the old image. The VCL isn't in this repo, so I can't check which behaviour applies. Adding a short hash of the image to the URL, as `?v=` or in the path, avoids the question.

    ## Database and app server

    5. **The `has_image` annotation reads every image out of TOAST**, PostgreSQL's out-of-line storage for large values (`BadgeManager.with_has_image`). The comment says the value is "never transferred", which is true for the network, but `imagedata > ''` compares the full bytea, so PostgreSQL has to fetch and reassemble the whole value. A test of 200 rows of about 96 KB each on the local database showed the comparison reading about 3,000 buffers in 31 ms, whilst `octet_length(img) > 0` read 2 buffers in 0.04 ms, because it only reads the TOAST header. Switching to `Length('imagedata') > 0` is a one-line fix. It runs on every cache miss of the people page (up to 200 badges) and on every account profile page load, which is never cached.
    6. **Oversized images are decoded in full (a "decompression bomb").** `ImageBinaryField.to_python` decodes the entire image with Pillow before rescaling. A PNG under 1 MB can still be about 170 megapixels before Pillow refuses it, which is several hundred MB of RAM plus a bicubic resize on the app server. `ModelForm` full-clean also re-parses the stored image on every badge edit, even when the image hasn't changed. Only managers of an approved organisation can upload, so the risk is moderate, but checking `img.size` before decoding would be cheap.
    7. **Minor, and only on cache misses:**
       - `badge.html` uses `holders|length` and then `holders.all`, which runs the holder query and its two prefetches a second time.
       - `select_related` would do better than `prefetch_related` for the foreign-key lookups in `peoplelist` and `badge_view`.
       - `badge_image` fetches the image and computes its MD5 before it checks `If-None-Match`; storing the hash would avoid both.
       - Every account profile save that has a contributor record purges `/community/contributors/`, `/community/people/` and all of that user's badge pages, even when nothing changed.

    ## Suggested order of fixes

    Start with the xkey purging (items 1 to 3) and the `Length()` change (item 5). 

    --

    Re: Introduce contributor badges

    От:
    Christoph Berg <myon@debian.org>
    Дата:
    Re: Dave Page
    > I haven't had time to review it properly yet, but I just had Claude Opus
    > review it, and it seems to think there are a few issues that need fixing. I
    > told it to pay particular attention to performance:
    
    Thanks!
    
    > ## Varnish cache invalidation
    
    Fwiw some of these gaps were intentional because we deemed them either
    minor, or out-of-scope-ish because they need fixes in the "items"
    management infra in pgweb and aren't specific to badges. We should
    have documented that, sorry. Anyway, this is probably the time to fix
    all of them, thanks for pointing them out.
    
    > 4. **The image URL never changes when the image does.**
    > `/community/badge//image/` has no file extension and no version in
    > it. The docs say Varnish applies a longer policy to images "because they
    > are considered never to change". Varnish itself is purged, but if the
    > Varnish configuration (VCL) also sends long browser cache headers for
    > images, browsers will keep showing the old image.
    
    I think purging Varnish is enough here. Badge image changes aren't
    critical, if a user sees the image somewhat longer, that doesn't cause
    trouble.
    
    > ## Database and app server
    > 
    > 5. **The `has_image` annotation reads every image out of TOAST**,
    > PostgreSQL's out-of-line storage for large values
    > (`BadgeManager.with_has_image`). The comment says the value is "never
    > transferred", which is true for the network, but `imagedata > ''` compares
    > the full bytea, so PostgreSQL has to fetch and reassemble the whole value.
    > A test of 200 rows of about 96 KB each on the local database showed the
    > comparison reading about 3,000 buffers in 31 ms, whilst `octet_length(img)
    > > 0` read 2 buffers in 0.04 ms, because it only reads the TOAST header.
    > Switching to `Length('imagedata') > 0` is a one-line fix. It runs on every
    > cache miss of the people page (up to 200 badges) and on every account
    > profile page load, which is never cached.
    
    Ack.
    
    > 6. **Oversized images are decoded in full (a "decompression bomb").**
    > `ImageBinaryField.to_python` decodes the entire image with Pillow before
    > rescaling. A PNG under 1 MB can still be about 170 megapixels before Pillow
    > refuses it, which is several hundred MB of RAM plus a bicubic resize on the
    > app server. `ModelForm` full-clean also re-parses the stored image on every
    > badge edit, even when the image hasn't changed. Only managers of an
    > approved organisation can upload, so the risk is moderate, but checking
    > `img.size` before decoding would be cheap.
    
    What max input size would we accept? 2000x2000 (4 megapixels) should
    be pretty much enough for everyone?
    
    Christoph
    
    
    

    Re: Introduce contributor badges

    От:
    Christoph Berg <myon@debian.org>
    Дата:
    Re: Dave Page
    > The fix is xkeys, which the docs already
    > describe as the better option: tag the badge, people and profile responses
    > with something like `pgbadge_` and give `Badge` a `purge_xkeys`. That
    > also replaces the per-holder URL loops.
    
    I don't think we'd want that. The people URLs have to be stable so
    people can link to them. if /contributors/people/myon/ gets replaced
    by /contributors/people/myon_123/, that's much less personal. The same
    applies to badges. (Or did I misunderstand the fix?)
    
    I remember rejecting some of the invalidations for "too much looping",
    I guess we should just implement it and then hopefully be done.
    
    Christoph
    
    
    

    Re: Introduce contributor badges

    От:
    Dave Page <dpage@pgadmin.org>
    Дата:
    Hi

    On Fri, 16 Oct 2026 at 09:59, Christoph Berg <myon@debian.org> wrote:

    > 6. **Oversized images are decoded in full (a "decompression bomb").**
    > `ImageBinaryField.to_python` decodes the entire image with Pillow before
    > rescaling. A PNG under 1 MB can still be about 170 megapixels before Pillow
    > refuses it, which is several hundred MB of RAM plus a bicubic resize on the
    > app server. `ModelForm` full-clean also re-parses the stored image on every
    > badge edit, even when the image hasn't changed. Only managers of an
    > approved organisation can upload, so the risk is moderate, but checking
    > `img.size` before decoding would be cheap.

    What max input size would we accept? 2000x2000 (4 megapixels) should
    be pretty much enough for everyone?

    These are images for badges - why on earth do they have to be that big? You pad them and then display them at 150x150 from what I can see. All of that seems like work that needn't be done by our servers - I would have the user upload at <= 256x256 or something (and adjust max_length to something more reasonable), and then pad and resize them in CSS. Which looks like it might be broken anyway - .badges-grid uses minmax(150px, 1fr) with img { width: 100% }, so on wide layouts a 150px image likely gets stretched beyond its real size.
     
    --

    Re: Introduce contributor badges

    От:
    Dave Page <dpage@pgadmin.org>
    Дата:
    Hi

    On Fri, 16 Oct 2026 at 10:09, Christoph Berg <myon@debian.org> wrote:
    Re: Dave Page
    > The fix is xkeys, which the docs already
    > describe as the better option: tag the badge, people and profile responses
    > with something like `pgbadge_<id>` and give `Badge` a `purge_xkeys`. That
    > also replaces the per-holder URL loops.

    I don't think we'd want that. The people URLs have to be stable so
    people can link to them. if /contributors/people/myon/ gets replaced
    by /contributors/people/myon_123/, that's much less personal. The same
    applies to badges. (Or did I misunderstand the fix?)

    You did :-)

    Xkeys don't change any URL. An xkey is a tag that Django adds as a response header (xkey: pgbadge_42). Varnish's xkey module indexes cached objects by that tag, and pgweb can then say "purge everything tagged pgbadge_42" without knowing which URLs those are. /community/people/myon/ stays exactly as it is.

    pgweb already does this. PgMiddleware tags every page with the templates it used (pgweb/util/middleware.py:44), there's an @xkey decorator in pgweb/util/decorators.py, and the post-save handler calls purge_xkeys on any model that defines it (pgweb/util/signals.py:160). For badges it would look like this:

    - badge_view, profile and peoplelist add pgbadge_<id> to the response's xkey header for every badge the page shows.
    - Badge gets purge_xkeys returning pgbadge_<id>.

    Saving or approving a badge would then purge every page that shows it, including all holders' profile pages, which is item 3. It covers item 1 as well: the removed holder's profile was tagged with that badge, and simple_form saves the badge after the removal. Deletes (item 2) would still need a post_delete hook, since that's a separate gap. 

    --

    Re: Introduce contributor badges

    От:
    Christoph Berg <myon@debian.org>
    Дата:
    Re: Dave Page
    > > What max input size would we accept? 2000x2000 (4 megapixels) should
    > > be pretty much enough for everyone?
    > 
    > These are images for badges - why on earth do they have to be that big? You
    > pad them and then display them at 150x150 from what I can see. All of that
    > seems like work that needn't be done by our servers - I would have the user
    > upload at <= 256x256 or something (and adjust max_length to something more
    > reasonable), and then pad and resize them in CSS. Which looks like it might
    > be broken anyway - .badges-grid uses minmax(150px, 1fr) with img { width:
    > 100% }, so on wide layouts a 150px image likely gets stretched beyond its
    > real size.
    
    That would be the max acceptable input size before server-side
    rescaling. I proposed something insanely large that shouldn't get in
    the way of anyone uploading while still limiting server memory.
    What you are saying is that we shouldn't do server-side rescaling but
    just take the user image-as is. That works for me.
    
    I'll work on a patch to make that switch.
    
    (The question might come back if we want to build a sprite image.)
    
    Christoph
    
    
    

    Re: Introduce contributor badges

    От:
    Daniel Gustafsson <daniel@yesql.se>
    Дата:
    > On 16 Oct 2026, at 14:49, Christoph Berg  wrote:
    
    > What you are saying is that we shouldn't do server-side rescaling but
    > just take the user image-as is. That works for me.
    
    +1 on restricting the upload to 150x150 and make the user responsible for the
    badge image looking good rather than rescaling.
    
    --
    Daniel Gustafsson
    
    
    
    

    Re: Introduce contributor badges

    От:
    Christoph Berg <myon@debian.org>
    Дата:
    Re: To Dave Page
    > > ## Varnish cache invalidation
    > 
    > > 4. **The image URL never changes when the image does.**
    > > `/community/badge//image/` has no file extension and no version in
    > > it. The docs say Varnish applies a longer policy to images "because they
    > > are considered never to change". Varnish itself is purged, but if the
    > > Varnish configuration (VCL) also sends long browser cache headers for
    > > images, browsers will keep showing the old image.
    > 
    > I think purging Varnish is enough here. Badge image changes aren't
    > critical, if a user sees the image somewhat longer, that doesn't cause
    > trouble.
    
    I did more research on this point, and that's the result (poking
    around and by Deepseek):
    
         Key finding: the cache policy is s-maxage, i.e. shared-cache only
    
         docs/frontend.rst:39-46:
    
         │ There is a longer default policy set for images, because they are considered never to change. Any view …
         │ can override this default, by specifying the Cache-control: s-maxage=xxx http header … using the @cache()
         │ decorator.
    
         And that's exactly what the decorator emits (pgweb/util/decorators.py):
    
         resp['Cache-Control'] = 's-maxage=%s' % (...)
    
         s-maxage is honoured only by shared caches (Varnish); browsers ignore it and fall back to no explicit
         freshness. badge_image itself sets no Cache-Control at all (only ETag), so:
    
         - the "longer policy for images" is a Varnish TTL (how long Varnish holds it) — and that's the copy our
           purge_urls already invalidates on save;
         - browsers are never asked to cache the image long, so a changed image can't go stale in a browser under the
           documented design (they'll revalidate via ETag, or not cache).
    
         So the risk in comment #4 only materialises if the out-of-repo VCL re-adds a browser max-age for images —
         which would contradict the app's own header. That's a hypothetical, not something the repo does.
    
         Recommendation
    
         No URL versioning. It requires a schema change, and the repository's own contract (s-maxage) is
         that only Varnish caches. Adding ?v= "to avoid the question" pays a real cost to guard against a
         configuration the app already argues against.
    
    On the related "minor" comment:
    
    > - `badge_image` fetches the image and computes its MD5 before it checks
    > `If-None-Match`; storing the hash would avoid both.
    
    badge_image is only reached on a Varnish miss, and on a miss we're
    almost always about to serve the image anyway. Storing the hash only
    helps the narrow (?) "Django itself receives a conditional request"
    case.
    
    So, I would say everything already works like it should.
    
    (If we wanted, We could add explicit Cache-Control headers on
    badge_image.)
    
    Christoph
    
    
    

    Re: Introduce contributor badges

    От:
    Dave Page <dpage@pgadmin.org>
    Дата:
    Hi

    On Fri, 16 Oct 2026 at 15:18, Christoph Berg <myon@debian.org> wrote:
    Re: To Dave Page
    > > ## Varnish cache invalidation
    >
    > > 4. **The image URL never changes when the image does.**
    > > `/community/badge/<slug>/image/` has no file extension and no version in
    > > it. The docs say Varnish applies a longer policy to images "because they
    > > are considered never to change". Varnish itself is purged, but if the
    > > Varnish configuration (VCL) also sends long browser cache headers for
    > > images, browsers will keep showing the old image.
    >
    > I think purging Varnish is enough here. Badge image changes aren't
    > critical, if a user sees the image somewhat longer, that doesn't cause
    > trouble.

    I did more research on this point, and that's the result (poking
    around and by Deepseek):

         Key finding: the cache policy is s-maxage, i.e. shared-cache only

         docs/frontend.rst:39-46:

         │ There is a longer default policy set for images, because they are considered never to change. Any view …
         │ can override this default, by specifying the Cache-control: s-maxage=xxx http header … using the @cache()
         │ decorator.

         And that's exactly what the decorator emits (pgweb/util/decorators.py):

         resp['Cache-Control'] = 's-maxage=%s' % (...)

         s-maxage is honoured only by shared caches (Varnish); browsers ignore it and fall back to no explicit
         freshness. badge_image itself sets no Cache-Control at all (only ETag), so:

         - the "longer policy for images" is a Varnish TTL (how long Varnish holds it) — and that's the copy our
           purge_urls already invalidates on save;
         - browsers are never asked to cache the image long, so a changed image can't go stale in a browser under the
           documented design (they'll revalidate via ETag, or not cache).

         So the risk in comment #4 only materialises if the out-of-repo VCL re-adds a browser max-age for images —
         which would contradict the app's own header. That's a hypothetical, not something the repo does.

         Recommendation

         No URL versioning. It requires a schema change, and the repository's own contract (s-maxage) is
         that only Varnish caches. Adding ?v=<hash> "to avoid the question" pays a real cost to guard against a
         configuration the app already argues against.

    On the related "minor" comment:

    > - `badge_image` fetches the image and computes its MD5 before it checks
    > `If-None-Match`; storing the hash would avoid both.

    badge_image is only reached on a Varnish miss, and on a miss we're
    almost always about to serve the image anyway. Storing the hash only
    helps the narrow (?) "Django itself receives a conditional request"
    case.

    So, I would say everything already works like it should.

    (If we wanted, We could add explicit Cache-Control headers on
    badge_image.)

    That's fair, but items 1 to 3 still stand; the VCL limits how long the stale pages last, though:

    - Pages without s-maxage are kept for 8 hours, and 404s on www are kept for 8 hours too (only the archives get the 1-minute 404).
    - After the 8 hours, grace mode serves the stale copy whilst Varnish fetches a fresh one in the background, which is normally a sub-second window; if the backend is unhealthy or the fetch fails, it can keep serving the stale copy for up to the full 24 hours of grace.
    - Purges are hard bans or hard xkey purges (pgweb never sends soft purges), so grace doesn't bring a purged page back.
     
    --

    Re: Introduce contributor badges

    От:
    Magnus Hagander <magnus@hagander.net>
    Дата:


    On Fri, 16 Oct 2026 at 16:18, Christoph Berg <myon@debian.org> wrote:
    Re: To Dave Page
    > > ## Varnish cache invalidation
    >
    > > 4. **The image URL never changes when the image does.**
    > > `/community/badge/<slug>/image/` has no file extension and no version in
    > > it. The docs say Varnish applies a longer policy to images "because they
    > > are considered never to change". Varnish itself is purged, but if the
    > > Varnish configuration (VCL) also sends long browser cache headers for
    > > images, browsers will keep showing the old image.
    >
    > I think purging Varnish is enough here. Badge image changes aren't
    > critical, if a user sees the image somewhat longer, that doesn't cause
    > trouble.

    I did more research on this point, and that's the result (poking
    around and by Deepseek):

    <cut some AI bleh>
     
         No URL versioning. It requires a schema change, and the repository's own contract (s-maxage) is
         that only Varnish caches. Adding ?v=<hash> "to avoid the question" pays a real cost to guard against a
         configuration the app already argues against.

    Agreed, no need for URL versioning.


    On the related "minor" comment:

    > - `badge_image` fetches the image and computes its MD5 before it checks
    > `If-None-Match`; storing the hash would avoid both.

    badge_image is only reached on a Varnish miss, and on a miss we're
    almost always about to serve the image anyway. Storing the hash only
    helps the narrow (?) "Django itself receives a conditional request"
    case.

    No, on the vast majority of misses we'd be serving a 304 Found with no content. Every time an image expires in any of the caches it would send a conditional request.

    (I have not looked at the rest, so I reserve the right to further review)

    --

    Re: Introduce contributor badges: image versioning?

    От:
    Christoph Berg <myon@debian.org>
    Дата:
    Re: Dave Page
    > That's fair, but items 1 to 3 still stand; the VCL limits how long the
    > stale pages last, though:
    
    Ack, I'll address these separately.
    
    Re: Magnus Hagander
    > Agreed, no need for URL versioning.
    
    Thanks.
    
    > > > - `badge_image` fetches the image and computes its MD5 before it checks
    > > > `If-None-Match`; storing the hash would avoid both.
    > >
    > > badge_image is only reached on a Varnish miss, and on a miss we're
    > > almost always about to serve the image anyway. Storing the hash only
    > > helps the narrow (?) "Django itself receives a conditional request"
    > > case.
    > 
    > No, on the vast majority of misses we'd be serving a 304 Found with no
    > content. Every time an image expires in any of the caches it would send a
    > conditional request.
    
    Is that enough to warrant storing the MD5 in a separate column? The PG
    xx Contributor images I have here are all between 20 and 40kB in size.
    (I.e. is that the fix we want?)
    
    > (I have not looked at the rest, so I reserve the right to further review)
    
    There will be patches coming for the other points soon.
    
    Christoph
    
    
    

    Re: Introduce contributor badges - v14

    От:
    Christoph Berg <myon@debian.org>
    Дата:
    The v14 patch series addresses Dave's review, Daniels 150x150 comment
    and includes Magnus feedback:
    
    Re: Dave Page
    > 1. **Removing a holder purges nothing for that person.** `BadgeForm.save`
    > calls `badge.holders.remove()` (`pgweb/contributors/forms.py`). That
    > deletes the through-table rows without any `post_save`, and pgweb only
    > hooks `post_save` (`pgweb/util/signals.py:169`). The badge page still gets
    > purged, because `simple_form` saves the badge afterwards. The removed
    > person's `/community/people//` page keeps showing the badge.
    
    This is v14-0007-Purge-badge-pages-and-holder-profiles-through-xk.patch
    
    > 2. **Deletes never purge.** This applies to deleting a `Badge`,
    > `Badgeholder` or `Contributor` in the admin. The rest of pgweb has the same
    > gap, but it matters more here: a deleted contributor's public profile page,
    > which can include their email, stays cached. If someone asks for their
    > profile to be removed, it isn't really gone.
    
    v14-0008-Purge-on-delete-as-well-as-on-save.patch
    
    > 3. **Approving or editing a badge doesn't purge its holders' profile
    > pages.** `Badge.purge_urls` says profiles "get refreshed when their holder
    > rows are edited", but approval, unapproval, a title change and an image
    > added or removed all leave the profiles stale. After unapproval, profiles
    > keep linking to `/community/badge//image/`, which now returns a 404
    > that Varnish may also cache. The fix is xkeys, which the docs already
    > describe as the better option: tag the badge, people and profile responses
    > with something like `pgbadge_` and give `Badge` a `purge_xkeys`. That
    > also replaces the per-holder URL loops.
    
    Part of v14-0007-Purge-badge-pages-and-holder-profiles-through-xk.patch
    
    > 4. **The image URL never changes when the image does.**
    > `/community/badge//image/` has no file extension and no version in
    > it. The docs say Varnish applies a longer policy to images "because they
    > are considered never to change". Varnish itself is purged, but if the
    > Varnish configuration (VCL) also sends long browser cache headers for
    > images, browsers will keep showing the old image. The VCL isn't in this
    > repo, so I can't check which behaviour applies. Adding a short hash of the
    > image to the URL, as `?v=` or in the path, avoids the question.
    
    We rejected that in the other subthread.
    
    > ## Database and app server
    > 
    > 5. **The `has_image` annotation reads every image out of TOAST**,
    > PostgreSQL's out-of-line storage for large values
    > (`BadgeManager.with_has_image`). The comment says the value is "never
    > transferred", which is true for the network, but `imagedata > ''` compares
    > the full bytea, so PostgreSQL has to fetch and reassemble the whole value.
    > A test of 200 rows of about 96 KB each on the local database showed the
    > comparison reading about 3,000 buffers in 31 ms, whilst `octet_length(img)
    > > 0` read 2 buffers in 0.04 ms, because it only reads the TOAST header.
    > Switching to `Length('imagedata') > 0` is a one-line fix. It runs on every
    > cache miss of the people page (up to 200 badges) and on every account
    > profile page load, which is never cached.
    
    v14-0002-Determine-has-image-without-full-detoasting.patch
    
    > 6. **Oversized images are decoded in full (a "decompression bomb").**
    > `ImageBinaryField.to_python` decodes the entire image with Pillow before
    > rescaling. A PNG under 1 MB can still be about 170 megapixels before Pillow
    > refuses it, which is several hundred MB of RAM plus a bicubic resize on the
    > app server. `ModelForm` full-clean also re-parses the stored image on every
    > badge edit, even when the image hasn't changed. Only managers of an
    > approved organisation can upload, so the risk is moderate, but checking
    > `img.size` before decoding would be cheap.
    
    v14-0003-Reject-images-with-wrong-size-before-loading-the.patch
    v14-0004-Don-t-re-parse-the-stored-badge-image-on-every-e.patch
    
    > 7. **Minor, and only on cache misses:**
    >    - `badge.html` uses `holders|length` and then `holders.all`, which runs
    > the holder query and its two prefetches a second time.
    
    v14-0005-Don-t-run-the-badge-holder-query-twice.patch
    
    >    - `select_related` would do better than `prefetch_related` for the
    > foreign-key lookups in `peoplelist` and `badge_view`.
    
    v14-0006-Use-select_related-for-the-badge-holder-and-peop.patch
    
    >    - `badge_image` fetches the image and computes its MD5 before it checks
    > `If-None-Match`; storing the hash would avoid both.
    
    v14-0009-Store-the-badge-image-md5-in-the-database.patch
    
    Since 0009 is touching the database, we can now pull up the staged
    extended badge title length:
    v14-0010-Extend-badge-title-to-255-chars.patch
    
    Both together share a migration file that is part of
    v14-0011-Migrate-imagehash-and-serve-badge-images-from-it.patch
    
    If we decide we don't want the MD5 change, we can postpone these
    three.
    
    >    - Every account profile save that has a contributor record purges
    > `/community/contributors/`, `/community/people/` and all of that user's
    > badge pages, even when nothing changed.
    
    v14-0012-Don-t-re-purge-contributor-pages-on-a-no-op-acco.patch
    
    
    Re: Daniel Gustafsson
    > +1 on restricting the upload to 150x150 and make the user responsible for the
    > badge image looking good rather than rescaling.
    
    That's v14-0001-Require-user-supplied-badges-to-be-150x150.patch
    
    v14-0010-Extend-badge-title-to-255-chars.patch
    
    Christoph
    
    
    

    Re: Introduce contributor badges - v14

    Re: To Dave Page
    > The v14 patch series addresses Dave's review, Daniels 150x150 comment
    > and includes Magnus feedback:
    
    *cough*
    
    Christoph
    

    Re: Introduce contributor badges - v14

    От:
    Dave Page <dpage@pgadmin.org>
    Дата:


    On Fri, 16 Oct 2026 at 18:22, Christoph Berg <myon@debian.org> wrote:
    Re: To Dave Page
    > The v14 patch series addresses Dave's review, Daniels 150x150 comment
    > and includes Magnus feedback:

    *cough*

    I’m afk now until I get spare time during the conference I’m afraid (whether I will actually get any remains to be seen). House full of family until about the time we leave for the airport.

    Re: Introduce contributor badges - v14

    От:
    Magnus Hagander <magnus@hagander.net>
    Дата:


    On Fri, 16 Oct 2026 at 19:21, Christoph Berg <myon@debian.org> wrote:
    The v14 patch series addresses Dave's review, Daniels 150x150 comment
    and includes Magnus feedback:

    I've lost track of much of this, but none of these fixes is actually applied yet, right?

    And they're just adressed in a random order here rather than from 1 and onwards? :)

    I'll start with this patch series as it's already been done, and then review the underlying stuff later.


    Re: Dave Page
    > 1. **Removing a holder purges nothing for that person.** `BadgeForm.save`
    > calls `badge.holders.remove()` (`pgweb/contributors/forms.py`). That
    > deletes the through-table rows without any `post_save`, and pgweb only
    > hooks `post_save` (`pgweb/util/signals.py:169`). The badge page still gets
    > purged, because `simple_form` saves the badge afterwards. The removed
    > person's `/community/people/<username>/` page keeps showing the badge.

    This is v14-0007-Purge-badge-pages-and-holder-profiles-through-xk.patch

    I wonder if we shouldn't add a `badgelist_<n>` xkey and use that to purge the pages when a contributor is edited, rather than do it url based. Url based, particularly with looping, can generate an overhead (since technically they are not purges even though they are called that -- they to regexp matching agianst all incoming requests for banning).

    Comments are about how the xkey is duplicated between the responses, but not the etag? (but the comment seems to go into a level of detail we're unusued to anyway, so we can maybe just drop that part)


    > 2. **Deletes never purge.** This applies to deleting a `Badge`,
    > `Badgeholder` or `Contributor` in the admin. The rest of pgweb has the same
    > gap, but it matters more here: a deleted contributor's public profile page,
    > which can include their email, stays cached. If someone asks for their
    > profile to be removed, it isn't really gone.

    v14-0008-Purge-on-delete-as-well-as-on-save.patch

    This commit message looks so painfully LLM generated that I can't read through it all. But it also looks like a long explanation of a discussion rather than the actual patch.

    And it seems to introduce a new type of logging that's not used elsewhere, just trapping and logging *all* exceptions as warnings completely regardless of what they are. Doesn't seem like something that belongs in such a patch.

    And since it affects everything, not just the badges, it should probably not just be patch 8 in a long series, it deserves looking at separtely.


    > ## Database and app server
    >
    > 5. **The `has_image` annotation reads every image out of TOAST**,
    > PostgreSQL's out-of-line storage for large values
    > (`BadgeManager.with_has_image`). The comment says the value is "never
    > transferred", which is true for the network, but `imagedata > ''` compares
    > the full bytea, so PostgreSQL has to fetch and reassemble the whole value.
    > A test of 200 rows of about 96 KB each on the local database showed the
    > comparison reading about 3,000 buffers in 31 ms, whilst `octet_length(img)
    > > 0` read 2 buffers in 0.04 ms, because it only reads the TOAST header.
    > Switching to `Length('imagedata') > 0` is a one-line fix. It runs on every
    > cache miss of the people page (up to 200 badges) and on every account
    > profile page load, which is never cached.

    v14-0002-Determine-has-image-without-full-detoasting.patch


    Looks fine, but is it really needed? Do we even (want to) support badges without images? Whta's the point of a badge that has no image?

     
    > 6. **Oversized images are decoded in full (a "decompression bomb").**
    > `ImageBinaryField.to_python` decodes the entire image with Pillow before
    > rescaling. A PNG under 1 MB can still be about 170 megapixels before Pillow
    > refuses it, which is several hundred MB of RAM plus a bicubic resize on the
    > app server. `ModelForm` full-clean also re-parses the stored image on every
    > badge edit, even when the image hasn't changed. Only managers of an
    > approved organisation can upload, so the risk is moderate, but checking
    > `img.size` before decoding would be cheap.

    v14-0003-Reject-images-with-wrong-size-before-loading-the.patch

    Why are we doing this whole exif orientation thing in the first place? Surely we can expect people to upload badges that are not upside down?

     
    v14-0004-Don-t-re-parse-the-stored-badge-image-on-every-e.patch

    See above comments about commit messages.


     
    > 7. **Minor, and only on cache misses:**
    >    - `badge.html` uses `holders|length` and then `holders.all`, which runs
    > the holder query and its two prefetches a second time.

    v14-0005-Don-t-run-the-badge-holder-query-twice.patch

    Looks fine, but the commit message is... Yeha, see above.


    >    - `select_related` would do better than `prefetch_related` for the
    > foreign-key lookups in `peoplelist` and `badge_view`.

    v14-0006-Use-select_related-for-the-badge-holder-and-peop.patch

    Dito.


    >    - `badge_image` fetches the image and computes its MD5 before it checks
    > `If-None-Match`; storing the hash would avoid both.

    v14-0009-Store-the-badge-image-md5-in-the-database.patch

    Since 0009 is touching the database, we can now pull up the staged
    extended badge title length:
    v14-0010-Extend-badge-title-to-255-chars.patch

    I agree with Daniel we should do this extension.


    Both together share a migration file that is part of
    v14-0011-Migrate-imagehash-and-serve-badge-images-from-it.patch

    If we decide we don't want the MD5 change, we can postpone these
    three.

    This should probably be just one patch, so the model changes go along with the migration.

    0011 looks good.


    >    - Every account profile save that has a contributor record purges
    > `/community/contributors/`, `/community/people/` and all of that user's
    > badge pages, even when nothing changed.

    v14-0012-Don-t-re-purge-contributor-pages-on-a-no-op-acco.patch

    Looks good.


    Re: Daniel Gustafsson
    > +1 on restricting the upload to 150x150 and make the user responsible for the
    > badge image looking good rather than rescaling.

    That's v14-0001-Require-user-supplied-badges-to-be-150x150.patch

    We could perhaps just remove the autoscaling code now that we've turned it off?

    Why do we want to support both PNG and JPG? Seems a badge should be only PNG?


    //Magnus

    Re: Introduce contributor badges - v14

    От:
    Daniel Gustafsson <daniel@yesql.se>
    Дата:
    > On 4 Nov 2026, at 20:38, Magnus Hagander  wrote:
    
    > Do we even (want to) support badges without images? Whta's the point of a badge that has no image?
    
    Requiring an image seems like a good clamp-down to reduce complexity early on,
    we can revisit later if a good usecase comes up (text-only badges which are
    applied with a CSS class comes to mind).
    
    > Why are we doing this whole exif orientation thing in the first place? Surely we can expect people to upload badges that are not upside down?
    
    Agreed, another reduction in complexity to get a base functionalty agreed upon.
    Rotation is also, IMHO, most useful when accepting images taken by a smarthpone
    which may have been held in all sorts up upside-down-left-center ways.
    150x150px badge images will be generated by tools and less susceptible to being
    upside down.
    
    > Why do we want to support both PNG and JPG? Seems a badge should be only PNG?
    
    For such small formats, I would prefer PNG only for now.  In the future we
    could add SVG to the list, or even pure CSS based (not for upload, but a
    hardcoded set defined by pgweb committers).
    
    --
    Daniel Gustafsson
    
    
    
    

    Re: Introduce contributor badges - v14

    От:
    Magnus Hagander <magnus@hagander.net>
    Дата:
    On Fri, 6 Nov 2026 at 15:09, Daniel Gustafsson <daniel@yesql.se> wrote:
    > On 4 Nov 2026, at 20:38, Magnus Hagander <magnus@hagander.net> wrote:

    > Do we even (want to) support badges without images? Whta's the point of a badge that has no image?

    Requiring an image seems like a good clamp-down to reduce complexity early on,
    we can revisit later if a good usecase comes up (text-only badges which are
    applied with a CSS class comes to mind).

    > Why are we doing this whole exif orientation thing in the first place? Surely we can expect people to upload badges that are not upside down?

    Agreed, another reduction in complexity to get a base functionalty agreed upon.
    Rotation is also, IMHO, most useful when accepting images taken by a smarthpone
    which may have been held in all sorts up upside-down-left-center ways.
    150x150px badge images will be generated by tools and less susceptible to being
    upside down.

    > Why do we want to support both PNG and JPG? Seems a badge should be only PNG?

    For such small formats, I would prefer PNG only for now.  In the future we
    could add SVG to the list, or even pure CSS based (not for upload, but a
    hardcoded set defined by pgweb committers).

    SVG would allow for inling the images in the HTML itself, which might be a win *iff* th eimages are small enough. Definitely something to consider for an opitmisation as the number of badges grow. So bsaic support for SVG would definitely be good, but let's make sure it's also verified that they are "pure" SVGs and not just an SVG with an embeded raster image..

    //Magnus
     

    Re: Introduce contributor badges - v14

    От:
    Dave Page <dpage@pgadmin.org>
    Дата:



    On Sat, 7 Nov 2026 at 11:56, Magnus Hagander <magnus@hagander.net> wrote:
    On Fri, 6 Nov 2026 at 15:09, Daniel Gustafsson <daniel@yesql.se> wrote:
    > On 4 Nov 2026, at 20:38, Magnus Hagander <magnus@hagander.net> wrote:

    > Do we even (want to) support badges without images? Whta's the point of a badge that has no image?

    Requiring an image seems like a good clamp-down to reduce complexity early on,
    we can revisit later if a good usecase comes up (text-only badges which are
    applied with a CSS class comes to mind).

    > Why are we doing this whole exif orientation thing in the first place? Surely we can expect people to upload badges that are not upside down?

    Agreed, another reduction in complexity to get a base functionalty agreed upon.
    Rotation is also, IMHO, most useful when accepting images taken by a smarthpone
    which may have been held in all sorts up upside-down-left-center ways.
    150x150px badge images will be generated by tools and less susceptible to being
    upside down.

    > Why do we want to support both PNG and JPG? Seems a badge should be only PNG?

    For such small formats, I would prefer PNG only for now.  In the future we
    could add SVG to the list, or even pure CSS based (not for upload, but a
    hardcoded set defined by pgweb committers).

    SVG would allow for inling the images in the HTML itself, which might be a win *iff* th eimages are small enough. Definitely something to consider for an opitmisation as the number of badges grow. So bsaic support for SVG would definitely be good, but let's make sure it's also verified that they are "pure" SVGs and not just an SVG with an embeded raster image..

    //Magnus
     

    Who will actually be able to upload badges? Svgs can have code embedded in them so we need a good level of trust.

    Re: Introduce contributor badges - v14

    От:
    Magnus Hagander <magnus@hagander.net>
    Дата:


    On Sat, 7 Nov 2026 at 22:19, Dave Page <dpage@pgadmin.org> wrote:



    On Sat, 7 Nov 2026 at 11:56, Magnus Hagander <magnus@hagander.net> wrote:
    On Fri, 6 Nov 2026 at 15:09, Daniel Gustafsson <daniel@yesql.se> wrote:
    > On 4 Nov 2026, at 20:38, Magnus Hagander <magnus@hagander.net> wrote:

    > Do we even (want to) support badges without images? Whta's the point of a badge that has no image?

    Requiring an image seems like a good clamp-down to reduce complexity early on,
    we can revisit later if a good usecase comes up (text-only badges which are
    applied with a CSS class comes to mind).

    > Why are we doing this whole exif orientation thing in the first place? Surely we can expect people to upload badges that are not upside down?

    Agreed, another reduction in complexity to get a base functionalty agreed upon.
    Rotation is also, IMHO, most useful when accepting images taken by a smarthpone
    which may have been held in all sorts up upside-down-left-center ways.
    150x150px badge images will be generated by tools and less susceptible to being
    upside down.

    > Why do we want to support both PNG and JPG? Seems a badge should be only PNG?

    For such small formats, I would prefer PNG only for now.  In the future we
    could add SVG to the list, or even pure CSS based (not for upload, but a
    hardcoded set defined by pgweb committers).

    SVG would allow for inling the images in the HTML itself, which might be a win *iff* th eimages are small enough. Definitely something to consider for an opitmisation as the number of badges grow. So bsaic support for SVG would definitely be good, but let's make sure it's also verified that they are "pure" SVGs and not just an SVG with an embeded raster image..

    //Magnus
     

    Who will actually be able to upload badges? Svgs can have code embedded in them so we need a good level of trust.

    Anybody can upload them, so that's a fair point. Stripping <script> tags would be easy enough, but there is also other external entities.

    Also, if you embed them with a data url as an <img> that won't happen, as browsers prevent it. It'll be a bit less efficient, but still probably better than PNG on account of the files being smaller?


    //Magnus

    Re: Introduce contributor badges - v14

    От:
    Dave Page <dpage@pgadmin.org>
    Дата:


    On Mon, 9 Nov 2026 at 11:25, Magnus Hagander <magnus@hagander.net> wrote:


    On Sat, 7 Nov 2026 at 22:19, Dave Page <dpage@pgadmin.org> wrote:



    On Sat, 7 Nov 2026 at 11:56, Magnus Hagander <magnus@hagander.net> wrote:
    On Fri, 6 Nov 2026 at 15:09, Daniel Gustafsson <daniel@yesql.se> wrote:
    > On 4 Nov 2026, at 20:38, Magnus Hagander <magnus@hagander.net> wrote:

    > Do we even (want to) support badges without images? Whta's the point of a badge that has no image?

    Requiring an image seems like a good clamp-down to reduce complexity early on,
    we can revisit later if a good usecase comes up (text-only badges which are
    applied with a CSS class comes to mind).

    > Why are we doing this whole exif orientation thing in the first place? Surely we can expect people to upload badges that are not upside down?

    Agreed, another reduction in complexity to get a base functionalty agreed upon.
    Rotation is also, IMHO, most useful when accepting images taken by a smarthpone
    which may have been held in all sorts up upside-down-left-center ways.
    150x150px badge images will be generated by tools and less susceptible to being
    upside down.

    > Why do we want to support both PNG and JPG? Seems a badge should be only PNG?

    For such small formats, I would prefer PNG only for now.  In the future we
    could add SVG to the list, or even pure CSS based (not for upload, but a
    hardcoded set defined by pgweb committers).

    SVG would allow for inling the images in the HTML itself, which might be a win *iff* th eimages are small enough. Definitely something to consider for an opitmisation as the number of badges grow. So bsaic support for SVG would definitely be good, but let's make sure it's also verified that they are "pure" SVGs and not just an SVG with an embeded raster image..

    //Magnus
     

    Who will actually be able to upload badges? Svgs can have code embedded in them so we need a good level of trust.

    Anybody can upload them, so that's a fair point. Stripping <script> tags would be easy enough, but there is also other external entities.

    Also, if you embed them with a data url as an <img> that won't happen, as browsers prevent it. It'll be a bit less efficient, but still probably better than PNG on account of the files being smaller?


    Seems reasonable, yes. 


    --
    FAQ