← Back to Pull requests

Improve release file labels #20935

Merged
nlhkabu merged 6 files (38 lines) on Nov 06, 2026 22:48 UTC
View on GitHub
nlhkabu nlhkabu commented on Nov 06, 2026 21:51 UTC
Author

I've noticed some users confusing release files with files in a repository.

This PR addresses this by renaming "files" to "release files" where appropriate.

This PR also closes https://github.com/pypi/warehouse/issues/20851 at the same time.

Diff: 38 lines (+23 / -15) across 6 files Reviewer: miketheman Review duration: 56m
All Vouch review confidence checks passed
Residual risk 0.03 = Change Risk (0.32) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.32 · 38 lines diff across 6 files
0.32
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 2 substantive comment(s)
0.89
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
90%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.219
Real PR Conversation Timeline
4 items
miketheman miketheman commented on code on Nov 06, 2026 22:13 UTC
Code Review
warehouse/templates/includes/packaging/metadata/provenance.html:1
@@ -76,9 +76,13 @@ <h3 class="callout-block__heading">
               <strong>{% trans %}Full provenance{% endtrans %}</strong>
             </p>
             <p>
-              {% trans count=provenance_status.counts.total_files %}All {{ count }} file in this release has provenance metadata.
-            {% pluralize %}
-              All {{ count }} files in this release have provenance metadata.{% endtrans %}
+              {% if provenance_status.counts.total_files == 2 %}
+                {% trans %}Both files in this release have provenance metadata.{% endtrans %}
+              {% else %}
+                {% trans count=provenance_status.counts.total_files %}{{ count }} file in this release has provenance metadata.
+              {% pluralize %}
+                All {{ count }} files in this release have provenance metadata.{% endtrans %}
+              {% endif %}

This sadly feels like something pluralize could have handled, I guess it's not that strong yet?

miketheman miketheman approved these changes on Nov 06, 2026 22:15 UTC
Approved Reviewer

Nice clarification - that's what they are termed on the database level in a release_files table, the Python Model is File, so I totally see how this can happen.

nlhkabu nlhkabu commented on code on Nov 06, 2026 22:42 UTC
Code Review
warehouse/templates/includes/packaging/metadata/provenance.html:1
@@ -76,9 +76,13 @@ <h3 class="callout-block__heading">
               <strong>{% trans %}Full provenance{% endtrans %}</strong>
             </p>
             <p>
-              {% trans count=provenance_status.counts.total_files %}All {{ count }} file in this release has provenance metadata.
-            {% pluralize %}
-              All {{ count }} files in this release have provenance metadata.{% endtrans %}
+              {% if provenance_status.counts.total_files == 2 %}
+                {% trans %}Both files in this release have provenance metadata.{% endtrans %}
+              {% else %}
+                {% trans count=provenance_status.counts.total_files %}{{ count }} file in this release has provenance metadata.
+              {% pluralize %}
+                All {{ count }} files in this release have provenance metadata.{% endtrans %}
+              {% endif %}

Claude says no:

Sadly no. pluralize maps to ngettext, which only switches on the target language's plural categories. English has just "one" and "other", so there's no slot for 2. Languages with a dual form (e.g. Arabic, Welsh) get that slot per locale, but we can't express "both" from the English source string. "Both" is also a word choice rather than a grammatical plural, so the explicit == 2 branch is the only way to get it.

Reviewers
Assignees
nlhkabu nlhkabu
Labels
risk: low confidence: 90.6% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 32.2% (LOW) · Higher = larger blast radius
32.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 90.6% · Lower = rushed or shallow review
90.6%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 3% · Safe to merge
3%
Repository