dotnet / docker-tools

This is a repo to house some common tools for our various docker repos.
MIT License
122 stars 46 forks source link

Enable relative links in Docker image tags tables #1446

Closed lbussell closed 2 days ago

lbussell commented 4 days ago

Context: https://github.com/dotnet/dotnet-docker/issues/5872#issuecomment-2369097600

This allows specifying useRelativeLinks in the manifest per each readme, and if it's set, then the link to the Dockerfiles in the tags table for that readme will be a relative link instead of a GitHub permalink.

This is where you would specify this in the manifest: https://github.com/dotnet/dotnet-docker/blob/08e0e7c3345a75af15ca0c1733d4f07676e0997d/manifest.json#L21-L24

dotnet-issue-labeler[bot] commented 4 days ago

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

dotnet-issue-labeler[bot] commented 4 days ago

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

lbussell commented 3 days ago

In what scenario would we not use relative links?

Good point. I'll edit this to make them all use relative links. Should simplify the code some.

lbussell commented 3 days ago

I have updated the code to output relative links for readmes, but keep GitHub permalinks for MCR tags metadata, since we do push that metadata to MCR and they could decide to use those links again at any time. Also added tests.