Repository navigation
fix: don't crash generate when a contributor's avatar_url is not an absolute URL - #572
Conversation
JimMadge
left a comment
There was a problem hiding this comment.
Thanks @VincentBorgers 🎉
This looks good to me.
I'm not sure if avatars from a local path are expected, but I don't see a reason to break support when it worked in the past and especially as projects are already using that.
@jdalrymple could you have a look as this touches your changes?
LGTM! |
|
@allcontributors please add @VincentBorgers for code, bug |
|
I've put up a pull request to add @VincentBorgers! 🎉 |
|
@allcontributors please add @jdalrymple for review |
|
I've put up a pull request to add @jdalrymple! 🎉 |
What:
Fixes
all-contributors generatecrashing withTypeError: Invalid URLwhen a contributor'savatar_urlis missing or not an absolute URL, for example a relative path to an image in the repository. This came in with #466, so it affects the 6.27.0 release candidate. 6.26.1 generates these entries without an error.Real configs have such entries. datalad/datalad-next and flux-framework/flux-restful-api each have a contributor whose
avatar_urlis[null]. With the.all-contributorsrcfrom datalad-next, 6.26.1 renders all 12 contributors andmainthrows.Why:
#466 adds the image size with
new URL(contributor.avatar_url), which throws for anything that is not an absolute URL, so a single entry like this stops the whole table from being generated.How:
The size parameter is only added when
URL.canParse()accepts the avatar URL. Other values go to the template unchanged, as before #466. The new test for a relative avatar URL fails onmainwith the sameTypeErrorand passes with this change.npm test(115 tests) andnpm run lintpass.Checklist: