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

"Pull request does not mention any issues" #100

Closed
berkon opened this issue Dec 18, 2023 · 10 comments · Fixed by #113
Closed

"Pull request does not mention any issues" #100

berkon opened this issue Dec 18, 2023 · 10 comments · Fixed by #113
Assignees

Comments

@berkon
Copy link

berkon commented Dec 18, 2023

I'm getting "Pull request does not mention any issue" even though the body of my PR contains the closed issue. It looks like this:

Closes #1234

while 1234 is a valid issue which was selected from GitHubs auto-complete dropdown (when pressing '#').

One thing that might be important is that we are using a different branch than "main" against which we want to merge the PR to. We have main too and main is the default branch. So we are NOT merging against the default branch (in case that might be an issue).

@berkon
Copy link
Author

berkon commented Dec 19, 2023

I think I found the reason. The problem was that the corresponding issue was not linked to its pull request. The problem is that the error message in fact tells exactly the opposite. It says: "Pull request does not mention any issues". But its the other way round. It should say e.g.: "Issue is not linked to any pull request".

@Namchee Namchee self-assigned this Dec 20, 2023
@Namchee
Copy link
Owner

Namchee commented Dec 20, 2023

Thanks for filing an issue!

Weird, it shouldn't matter if the issue is not linked to the pull request as long as the pull request links it. It also doesn't matter if the branch is the main branch or not.

If the repository is public, would you mind sharing the pull request link? I might need to check the API response for that PR.

@berkon
Copy link
Author

berkon commented Dec 20, 2023

Thanks again for your quick reply Cristopher. Yes indeed its strange. I tried it two times (linked and unlinked the PR in the issue) and in both cases when the PR was unlinked, it gave me the mentioned error message. Unfortunately the repo is one of our company repos so I'm not allowed to share the content. But if you can tell what debug output you need and how I can enable it, I'll get it when having the next PR that shows the issue.

@Namchee
Copy link
Owner

Namchee commented Dec 20, 2023

Aah ok, since it's not public. I'll try to reproduce it here instead.

@Namchee
Copy link
Owner

Namchee commented Dec 20, 2023

It's reproducible via #112. My preliminary guess is that since 1 issue can only be mentioned 1 PR, the second one is ignored.

This is more like a GitHub bug to be honest (or it just works like that). I'll investigate further.

@Namchee
Copy link
Owner

Namchee commented Dec 20, 2023

Found the issue. Apparently, magic keyword is ignored when the target isn't the default branch. If the target isn't the default branch, you must link it manually. Personally, this feels like a ridiculous limitation by GitHub.

I'll handle this by bringing up the old issue-linking logic back.

@berkon
Copy link
Author

berkon commented Dec 20, 2023

Great that you found it so fast Cristopher! Yes I already expected that I need to link a PR manually when I want to connect it to the corresponding issue and when not using the default branch. I was just surprised that obviously it is required to have the PR linked in the issue in order to for conventional-pr to run correctly. I thought linking the PR is just a nice-to-have GitHub feature for not having to search for PRs that belong to an issue.

@Namchee
Copy link
Owner

Namchee commented Dec 20, 2023

Seems like #113 doesn't fix it, will conduct deeper investigation. My bad, it's due to pull_request_target uses the outdated version of the action.

@berkon, the issue-referencing bug should be fixed in v0.15.4. Can you try that version and see if it fixes your issue?

@Namchee Namchee closed this as completed Dec 20, 2023
@berkon
Copy link
Author

berkon commented Dec 20, 2023

Unbelievable! You're sooo fast! Thank you very much!! I just confirmed the issue again. So the PR must be linked to the issue, otherwise I get the mentioned error message.

I'll upgrade now to the new version and let you know how the next PR behaves ;-).

@berkon
Copy link
Author

berkon commented Dec 20, 2023

Looks great. Thanks again @Namchee! I'll keep an eye on.

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

Successfully merging a pull request may close this issue.

2 participants