Open JacobAmar opened 3 weeks ago
Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️
Hello 👋🏼 thanks for reporting and reproduce instructions. Can you possibly share the full logs? It is a bit hard to figure out what is going wrong from the lines you have provided.
Also, if you project is open source, I'm happy to take a look at it :)
Hi @orhun thanks for answering, my project is not open source and theres no additional log that adds any information but this is what i get:
▸▹▹▹▹ Retrieving data from GitHub... (<my-org>/<my-repo>) DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/commits?per_page=100&page=0
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/commits?per_page=100&page=1
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/commits?per_page=100&page=2
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/commits?per_page=100&page=3
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/commits?per_page=100&page=4
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/commits?per_page=100&page=5
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/commits?per_page=100&page=6
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/commits?per_page=100&page=7
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/commits?per_page=100&page=8
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/commits?per_page=100&page=9
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/pulls?per_page=100&page=0&state=closed
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/pulls?per_page=100&page=1&state=closed
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/pulls?per_page=100&page=2&state=closed
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/pulls?per_page=100&page=3&state=closed
DEBUG git_cliff_core::remote > Sending request to: https://api.github.com/repos/<my-org>/<my-repo>/pulls?per_page=100&page=4&state=closed
DEBUG reqwest::connect > starting new connection: https://api.github.com/
DEBUG reqwest::connect > starting new connection: https://api.github.com/
DEBUG reqwest::connect > starting new connection: https://api.github.com/
DEBUG reqwest::connect > starting new connection: https://api.github.com/
DEBUG reqwest::connect > starting new connection: https://api.github.com/
DEBUG reqwest::connect > starting new connection: https://api.github.com/
DEBUG rustls::client::hs > No cached session for DnsName("api.github.com")
DEBUG rustls::client::hs > Not resuming any session
DEBUG rustls::client::hs > No cached session for DnsName("api.github.com")
DEBUG rustls::client::hs > Not resuming any session
DEBUG rustls::client::hs > No cached session for DnsName("api.github.com")
DEBUG rustls::client::hs > Using ciphersuite TLS13_AES_128_GCM_SHA256
DEBUG rustls::client::tls13 > Not resuming
DEBUG rustls::client::tls13 > TLS1.3 encrypted extensions: [ServerNameAck, Protocols([ProtocolName(687474702f312e31)])]
DEBUG rustls::client::hs > ALPN protocol is Some(b"http/1.1")
DEBUG rustls::client::hs > Using ciphersuite TLS13_AES_128_GCM_SHA256
ERROR git_cliff_core::remote > Request error: {"message":"Not Found","documentation_url":"https://docs.github.com/rest/pulls/pulls#list-pull-requests","status":"404"}
DEBUG git_cliff_core::remote > Error while fetching page: JsonError(Error("invalid type: map, expected a sequence", line: 1, column: 0))
DEBUG rustls::common_state > Sending warning alert CloseNotify
DEBUG rustls::common_state > Sending warning alert CloseNotify
DEBUG rustls::common_state > Sending warning alert CloseNotify
DEBUG rustls::common_state > Sending warning alert CloseNotify
ERROR git_cliff_core::remote > Request error: {"message":"Not Found","documentation_url":"https://docs.github.com/rest/commits/commits#list-commits","status":"404"}
ERROR git_cliff_core::remote > Request error: {"message":"Not Found","documentation_url":"https://docs.github.com/rest/commits/commits#list-commits","status":"404"}
ERROR git_cliff_core::remote > Request error: {"message":"Not Found","documentation_url":"https://docs.github.com/rest/commits/commits#list-commits","status":"404"}
ERROR git_cliff_core::remote > Request error: {"message":"Not Found","documentation_url":"https://docs.github.com/rest/commits/commits#list-commits","status":"404"}
DEBUG git_cliff_core::remote > Error while fetching page: JsonError(Error("invalid type: map, expected a sequence", line: 1, column: 0))
DEBUG rustls::common_state > Sending warning alert CloseNotify
DEBUG git_cliff_core::changelog > Number of GitHub commits: 0
DEBUG git_cliff_core::changelog > Number of GitHub pull requests: 0
@orhun I have made an update and fixed my GitHub token to include permissions to the repository as outlined in https://github.com/octokit/octokit.rb/issues/935#issuecomment-351187007. Now, I can view the PR number, but only in the contributor section. I've also updated my template to incorporate the PR number through the contributor section:
{% for contributor in github.contributors %}
{% if contributor.prnumber %} All changes can be found in this pull request: [#{{ contributor.pr_number }}](https://github.com/ironsource-mobile/yaakov-demo/pull/{{ contributor.pr_number }}) \n {%- endif %}
{%- endfor -%}
However, I suspect there is still an issue where the PR number is not being attached to the commit.
Therefore, I suggest putting more emphasis in the documentation regarding the necessary permissions. Additionally, I’m using GitHub Actions, so I added the following permissions:
permissions:
contents: write
issues: write
pull-requests: write
(Note: I’m pushing the new tag via the pull request.)
Looking forward to your feedback on this matter!
Happy to hear that it is now working after setting the permissions!
incorporate the PR number through the contributor section:
There is a typo in your template:
{% if contributor.prnumber %}
-> {% if contributor.pr_number %}
However, I suspect there is still an issue where the PR number is not being attached to the commit.
Can you expand on this a bit? What exactly are you experiencing?
so I added the following permissions:
Actually, content: read
& pull-requests: read
should be enough since git-cliff
does not have anything to do with writing contents to the repository. Can you also test it out with these narrowed down permissions?
Is there an existing issue for this?
Description of the bug
I am currently experiencing an issue with Git Cliff where I am unable to retrieve the pull request number to include in the changelog of a specific project structured as a monorepo. While attempting to use Git Cliff with specific configurations tailored to our project's directory and tagging structure, I continue to encounter multiple "404 Not Found" errors.
Errors Received:
Steps To Reproduce
Steps to Reproduce the Issue with Git Cliff in a Monorepo:
Create a Private Repository:
Establish Directory Structure:
<dir-name>
.Initial Setup and Release:
<name-of-the-dir-you-created>/0.1.0
and push it to GitHub.Modify Content with Conventional Commit:
<dir-name>
directory, such as editing the README.md file.Run Git Cliff Command:
Execute the Git Cliff tool with verbose logging and specific configurations tailored to the monorepo structure:
git cliff -v --github-repo <my-org>/<my-repo> --include-path "charts/<dir-name>/*" --tag-pattern "<dir-name>/(.)" -x
Replace and with your actual GitHub organization and repository names, and with the name of your directory under the charts/ structure.
Check for PR Number in the JSON Output:
Expected behavior
When using Git Cliff with the appropriate configuration in a GitHub monorepo, the expected behavior would include the successful extraction and display of GitHub metadata such as
pr_number
andpr_label
in the context of the output. This data is crucial for generating detailed and accurate changelogs that reflect the pull requests associated with each commit.Screenshots / Logs
No response
Software information
Im encountering the issue with Git Cliff both when running through GitHub Actions and locally on my macOS machine.
Additional context
No response