Repository navigation
feat(website): render source human_link with Go templates - #6341
Merged
Merged
Conversation
This was referenced Nov 11, 2026
Render SourceRepository human_link templates with text/template instead of jinja (via gonja), with a small set of generic functions (field, replace, lower) and the vulnerability ID/ecosystems as data. Templates that fail to parse as Go templates fall back to gonja (with a warning log) until source.yaml/source_test.yaml are migrated.
Neither staging nor prod sets FLASK_SECRET_KEY, SECRET_KEY or API_URL; both set SESSION_SECRET_KEY (staging only) and OSV_API_URL.
michaelkedar
force-pushed
the
human-link-template
branch
from
November 11, 2026 03:15
f1734dc to
b77ed4a
Compare
michaelkedar
marked this pull request as ready for review
November 11, 2026 03:25
jess-lowe
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1/3 of moving
SourceRepository.human_linkoff jinja (a leftover from the Python website) onto Gotext/template.Templates get
.IDand.Ecosystems(the affected ecosystems, in order), plus a small set of generic functions:field SEP N: split onSEPand take partN(0-indexed; out of range is an error)replace OLD NEWlowerAny render error means no human link is shown, so templates don't need conditionals.
To keep things working while
source.yamlis migrated (#6342), templates that fail to parse as Go templates fall back to gonja, with ahuman_link is not a valid Go template, falling back to jinjawarning. 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_URLenv var fallbacks from the website; neither staging nor prod sets them (both useSESSION_SECRET_KEY/OSV_API_URL).agy