Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking PRs to issues does not always work #868

Open
mnonnenmacher opened this issue Aug 21, 2024 · 6 comments
Open

Linking PRs to issues does not always work #868

mnonnenmacher opened this issue Aug 21, 2024 · 6 comments

Comments

@mnonnenmacher
Copy link
Contributor

When referencing an issue in a commit message, GitHub should automatically link the PR and issue if the PR targets the main branch:
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue

For some reason this does not always work in this repository, for example:

PR #863 was automatically linked to #720 and the issue was closed when the PR was merged.
PR #176 referenced #174 in a commit message, but the automatic linking did not work and the issue was not closed when the PR was merged.

To me it is completely unclear why the linking sometimes does not work and I could not recognize any pattern. The only restricition from the docs is:

However, if the PR's base is any other branch, then these keywords are ignored, no links are created and merging the PR has no effect on the issues.

But all affected PRs did target the main branch.

If you see this issue happening again, please add the affected PR and issue numbers in a comment, maybe collecting them helps to find the root cause.

@Etsija
Copy link
Contributor

Etsija commented Aug 22, 2024

My latest case from yesterday:

As a side note: when you create a feature branch out of an issue using GitHub, GitHub hints something along the lines of "merging this branch may subsequently close this issue". To my experience, it never does, and I don't know if it's because I always create the branch to doubleopen fork of the repository, not to the core repository.

@mnonnenmacher
Copy link
Contributor Author

Linking did not work for #406.

@Etsija
Copy link
Contributor

Etsija commented Aug 23, 2024

#887 closed #833. "Defaults..." text is in the description of #887, and I created a branch out of #833. GitHub also showed me this in the PR #887:
Capture

@Etsija
Copy link
Contributor

Etsija commented Aug 23, 2024

#892 didn't close #890. Thinking that when the "Resolves..." is in the commit message , as in this PR, not on the top-level PR description, GitHub doesn't actually link the PR to the issue properly for auto-closing.

@sschuberth
Copy link
Contributor

#986 did not auto-close.

@mnonnenmacher
Copy link
Contributor Author

#605 did not auto-close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants