Skip to content

🐛 fix(fragments): link PRs from the squash commit subject - #55

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:fix/pr-link-fallback
Oct 30, 2026
Merged

gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:fix/pr-link-fallback

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

The Prepare release run for pipdeptree 4.2.13 credited five fragments to Bernát Gábor with no PR link. 🐛 GitHub returned no associated pull request for squash commits 312a6d0 (#845), d777302 (#846), 2d7eaf0 (#848), 1378a80 (#854) and a5681ef (#852), through both REST and GraphQL, even though each PR's merge commit is that commit and each subject ends with its number. tox-dev/pipdeptree#863 repairs that changelog by hand.

When GitHub associates no squash-merged PR with a fragment's commit, fragments now reads the (#N) that ends the commit subject and fetches PR N. It links that PR only when PR N merged and its merge commit is the fragment's commit, so a subject that cites some other PR links nothing. A PR found this way gets the same credits as an associated one.

The command never fails over a missing PR. A fragment that neither lookup links, as after a merge commit, rebase merge or direct push, still credits its commit author as before. Run against the five pipdeptree commits above, the resolver now links #845, #846, #848, #854 and #852 to @gaborbernat.

The pipdeptree 4.2.13 release credited five fragments to a display name
with no PR link: GitHub returned no associated pull request for their
squash commits, although each PR's merge commit is that commit and the
subject ends with its number. The run logged the fallback and kept
going.

When the association is empty, the linker now reads the trailing (#N)
from the commit subject and takes PR N only if it merged as that commit,
so a subject that cites some other PR links nothing.

A fragment still without a PR now fails the command and lists each such
fragment with its commit. Crediting the commit author stays available
behind --credit-commit-author for merge-commit and rebase-merge
workflows, where no squash commit exists.
@gaborbernat gaborbernat added the bug Something isn't working label Oct 30, 2026
@read-the-docs-community

read-the-docs-community Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 release-creator | 🛠️ Build #35512564 | 📁 Comparing d44f6e7 against latest (59718de)

  🔍 Preview build  

2 files changed
± changelog.html
± how-to/link-fragments.html

A release must not stop for a fragment without a merged pull request. Drop
the --credit-commit-author flag and the failure; the subject (#N) fallback
covers GitHub's missing commit-to-PR association, and the commit author
credit stays the last resort for merge commits and direct pushes.
@gaborbernat
gaborbernat merged commit 61c75d3 into tox-dev:main Oct 30, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant