Repository#license returns nil when license_key is not recognised
What does this MR do and why?
Gitaly's FindLicense
was recently ported to Go from Ruby. This introduced some disparities as Gitaly now provides more license short names than Rails handles. When Rails receives a license it doesn't handle, the whole repository overview page fails to render. This was identified in a production incident. Instead of failing to render the entire page, we should fallback to showing just License
instead of the short name as described in create-stage#12914 (comment 669535259).
Let's check first whether license name is valid and rescue from Licensee::InvalidLicense
if it's not
Closes: #340273 (closed)