Skip to content

chore(website): remove jinja human_link fallback and gonja dependency - #6343

Merged
michaelkedar merged 1 commit into
masterfrom
human-link-drop-gonja
Nov 20, 2026
Merged

michaelkedar merged 1 commit into
masterfrom
human-link-drop-gonja

Conversation

@michaelkedar

@michaelkedar michaelkedar commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Warning

Do not merge until #6342 has been synced to Datastore in both projects and the human_link is not a valid Go template, falling back to jinja warning has stopped appearing in the website logs.

Part 3/3: remove the jinja fallback from #6341 and the gonja dependency (plus its transitive dependencies).
agy

@michaelkedar
michaelkedar added this pull request to stack #6344 November 11, 2026 03:09
michaelkedar added a commit that referenced this pull request Nov 11, 2026
Part 1/3 of moving `SourceRepository.human_link` off jinja (a leftover
from the Python website) onto Go `text/template`.

Templates get `.ID` and `.Ecosystems` (the affected ecosystems, in
order), plus a small set of generic functions:
- `field SEP N`: split on `SEP` and take part `N` (0-indexed; out of
range is an error)
- `replace OLD NEW`
- `lower`

Any render error means no human link is shown, so templates don't need
conditionals.

To keep things working while `source.yaml` is migrated (#6342),
templates that fail to parse as Go templates fall back to gonja, with a
`human_link is not a valid Go template, falling back to jinja` warning.
The fallback is removed in #6343.

Also updates the website devserver test data to the new syntax.

Also removes the Flask-era `FLASK_SECRET_KEY`/`SECRET_KEY`/`API_URL` env
var fallbacks from the website; neither staging nor prod sets them (both
use `SESSION_SECRET_KEY`/`OSV_API_URL`).
agy
@codecov-commenter

codecov-commenter commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.56%. Comparing base (51fa7d3) to head (23fb21a).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6343      +/-   ##
==========================================
- Coverage   55.57%   55.56%   -0.02%     
==========================================
  Files         222      222              
  Lines       22928    22919       -9     
==========================================
- Hits        12743    12735       -8     
+ Misses      10182    10181       -1     
  Partials        3        3              
Flag Coverage Δ
go 59.18% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@michaelkedar
michaelkedar marked this pull request as ready for review November 18, 2026 02:29
@michaelkedar
michaelkedar requested review from a team and jess-lowe November 18, 2026 02:29
Base automatically changed from human-link-yaml to master November 18, 2026 03:34
All SourceRepository human_links are now Go templates, so remove the gonja
fallback and the dependency.
@michaelkedar
michaelkedar merged commit 6e9b7a8 into master Nov 20, 2026
31 checks passed
@michaelkedar
michaelkedar deleted the human-link-drop-gonja branch November 20, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants