vitejs / vite

Next generation frontend tooling. It's fast!
http://vitejs.dev
MIT License
67.32k stars 6.05k forks source link

changelog links are broken #16727

Closed fz6m closed 2 months ago

fz6m commented 4 months ago

Documentation is

Explain in Detail

I often check the changelog, but this time many links were broken 🥲

See

CleanShot 2024-05-21 at 0  49 16

Your Suggestion for Changes

Add PR link

Reproduction

No response

Steps to reproduce

No response

bluwy commented 3 months ago

We probably need to use the full commit hash in the linked url - https://github.com/conventional-changelog/conventional-changelog/issues/476

However the linked issue doesn't seem to have a direct solution, and I haven't investigated if we can tweak this directly. Strangely though, the short commit hash shouldn't be colliding since it's displaying fine for me locally:

> git rev-parse 82111bf  
82111bfb4134646f5ea03a6bead16ebdf67bbe15

A shorter hash would look like:

> git rev-parse 8211     
error: short object ID 8211 is ambiguous
hint: The candidates are:
hint:   82111bfb4 commit 2024-05-20 - fix: types
hint:   82116a58c tree
hint:   8211f8632 blob
8211
fatal: ambiguous argument '8211': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Maybe GitHub collects more hashes not cloned locally.

btea commented 2 months ago

@bluwy It seems that the upstream has not planned to solve this problem for a long time. Perhaps we can add a script to replace the short hash with the full hash value.

bluwy commented 2 months ago

Fine by me 👍 Maybe we can also use pnpm to patch it.

btea commented 2 months ago

conventional-changelog is called directly with npx, and I don't know how to patch it. Currently, I can only write a script to update the hash value.

bluwy commented 2 months ago

If you want to patch, you can use https://pnpm.io/cli/patch, e.g. pnpm patch conventional-changelog-cli. Though I'm not sure if that's the code we want to edit, you could also pass a nested package name to edit.

bluwy commented 2 months ago

I think we can close this with https://github.com/vitejs/vite/pull/17709 merged