Skip to content

Comments

Sort sponsors#19551

Open
JacobCoffee wants to merge 3 commits intomainfrom
fix/sponsor-ordering
Open

Sort sponsors#19551
JacobCoffee wants to merge 3 commits intomainfrom
fix/sponsor-ordering

Conversation

@JacobCoffee
Copy link
Member

Sort by level and then name

@JacobCoffee JacobCoffee requested a review from a team as a code owner February 19, 2026 17:48
Copy link
Member

@miketheman miketheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this relate with the existing logic where the level and order are set by upstream?

https://github.com/pypi/warehouse/blob/f59df186dc62274b5831a72f639a1e92bbe3f94c/warehouse/sponsors/tasks.py#L54-L53

@JacobCoffee
Copy link
Member Author

if i understnad what you're asking @miketheman the query uses what the task pulls in , i don't think it was being used until this pr

.filter(Sponsor.is_active == true())
.order_by(Sponsor.level_order, Sponsor.name)
.all()
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting this explicit order will impact anywhere we use request.sponsors and don't re-sort.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think its just sponsors.html and the sponsors footer (which i cant seem to see that we actually use/render...?) but this is the preferred thing so that we keep consistencies and sponsor expectations on ordering

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh i have adblock so i missed these. that'd be a separate issue but i feel like we should do this in a way to not be blocked by ad-blockers

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if you're responding to this comment, or to the one in the HTML template - but it's unclear from the PR description on what the intent here is, so it's hard to review without the context.

It'd help if you viewed the current page without ad blockers, as well as the proposed changes so that you can see the differences. However, the sample sponsor data doesn't contain levels/order - I added that in #19553 so that might helpful to merge first and then see how this renders for you, and make the desired changes.

</div>
<div class="sponsor-grid sponsor-grid--bottom-margin">
{% for sponsor in request.sponsors | sort(attribute="name") %}
{% for sponsor in request.sponsors %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only removing the name sort order from the infra sponsors, is that intentional? I suspect you'd want the "main" sponsors section instead / as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this was preferable so that we ensure db-level sortnig for all instead of just infra

@miketheman miketheman added the HTML requires change to HTML files label Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

HTML requires change to HTML files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants