Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Why is the gitea "remote" not filled for some of my commits? #1071

Unanswered
truenicoco asked this question in Q&A
Discussion options

I don't know exactly why, but for some commits, the "gitea" and "remote" objects are empty, despite "author" and "committer" being strictly the same as for other commits in which "gitea" and "remote" are adequately filled with remote data. Is this a bug that I should report or am I missing something?

I've attached the full "json context" but here is a relevant (?) part:

 {
 "id": "0e1f80e6230058068f7437056cb32d4ea8bedaf7",
 "message": "fix mypy and pytest when dependencies change",
 "author": {
 "name": "nicoco",
 "email": "nicoco@me.fr",
 "timestamp": 1740947957
 },
 "committer": {
 "name": "nicoco",
 "email": "nicoco@me.fr",
 "timestamp": 1740947957
 },
...
 "gitea": {
 "username": "nicoco",
 "pr_title": null,
 "pr_number": null,
 "pr_labels": [],
 "is_first_time": false
 },
...
 "remote": {
 "username": "nicoco",
 "pr_title": null,
 "pr_number": null,
 "pr_labels": [],
 "is_first_time": false
 },
...
 {
 "id": "4985e1924e8f66acabbbe1eb428f2f0aea494c86",
 "message": "append cfix commits to their parent",
...
 "author": {
 "name": "nicoco",
 "email": "nicoco@me.fr",
 "timestamp": 1741035106
 },
 "committer": {
 "name": "nicoco",
 "email": "nicoco@me.fr",
 "timestamp": 1741035106
 },
 "gitea": {
 "username": null,
 "pr_title": null,
 "pr_number": null,
 "pr_labels": [],
 "is_first_time": false
 },
...

cliff.json

You must be logged in to vote

Replies: 1 comment 4 replies

Comment options

Hello, thanks for reporting! 👋🏼

"author" and "committer" fields are populated from the local data available in the Git repository. For the other remote data we are using the response from the API. In your case things seems to go wrong a bit... I suspect something on the API side, maybe a ratelimit. Would you mind running with -vv options and sharing the logs?

You must be logged in to vote
4 replies
Comment options

But doesn't git cliff fetch "remote usernames" once per committer name/author combo? I have not looked into the source tbh :)

Anyway, here's the log, thanks for your reply!

cliff.log

Comment options

orhun Mar 5, 2025
Maintainer

No the logic is:

  • Fetch all commits
  • Fetch all PRs

And associate the local data with the remote data. See update_release_metadata for more details:

macro_rules! update_release_metadata {
($remote: ident, $fn: ident) => {
impl<'a> Release<'a> {
/// Updates the remote metadata that is contained in the release.
///
/// This function takes two arguments:
///
/// - Commits: needed for associating the Git user with the GitHub
/// username.
/// - Pull requests: needed for generating the contributor list for the
/// release.

From the logs I didn't see anything out of ordinary.

Can you also share your git-cliff configuration? Maybe it's an issue about conventional commits/parsers etc.

Comment options

Thanks for looking into it. But wait, the issue seemed to have self-resolved (!), or at least I can't reproduce it any more. I still have the JSON associated to the log I sent before and it is definitely missing that remote field though. Weird.

[tool.git-cliff.remote.gitea]
owner = "slidge"
repo = "slidge"
[tool.git-cliff.changelog]
header = """
<!-- write something cool about the release here! -->

# Changes
"""
body = """
{% for group, all_commits in commits | group_by(attribute="group") %}
 {%- if group == "cfix" %}{% continue %}{%- endif %}
 ## {{ group | striptags | trim | upper_first }}
 {% for commit in all_commits %}
 - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
 {% if commit.breaking %}[**breaking**] {% endif %}\
 {{ commit.message | split(pat="\n") | first | upper_first | trim }} \
 ([`{{ commit.id | truncate(length=7, end="") }}`](./commit/{{ commit.id -}})\
 {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
 {%- for cfix_commit in commits | filter(attribute="group", value="cfix") -%}
 {%- if cfix_commit.scope and commit.id is starting_with(cfix_commit.scope) -%}
 , [`{{ cfix_commit.id | truncate(length=7, end="") }}`](./commit/{{ cfix_commit.id }}){% if cfix_commit.remote.username %} by @{{ cfix_commit.remote.username }}{%- endif -%}
 {%- endif -%}
 {%- endfor -%})\
 {% endfor %}
{% endfor %}\n
"""
footer = """
<!-- generated by git-cliff -->
"""
[tool.git-cliff.git]
conventional_commits = true
filter_unconventional = false
commit_parsers = [
 { message = "^feat", group = "<!-- 0 -->🚀 Features" },
 { message = "^imprv", group = "<!-- 01 -->✨ Improvements" },
 { message = "^fix", group = "<!-- 02 -->🐛 Bug Fixes" },
 { message = "^compat", group = "<!-- 03 -->💑 Compatibility" },
 { message = "^refactor", group = "<!-- 04 -->🚜 Refactor" },
 { message = "^doc", group = "<!-- 05 -->📚 Documentation" },
 { message = "^perf", group = "<!-- 06 -->⚡ Performance" },
 { message = "^style", group = "<!-- 07 -->🎨 Styling" },
 { message = "^test", group = "<!-- 08 -->🧪 Testing" },
 { message = "^chore\\(release\\): prepare for", skip = true },
 { message = "^chore\\(deps.*\\)", skip = true },
 { message = "^chore\\(pr\\)", skip = true },
 { message = "^chore\\(pull\\)", skip = true },
 { message = "^build\\(lockfile\\)", skip = true },
 { message = "^chore\\(lockfile\\)", skip = true },
 { message = "^chore|^ci", group = "<!-- 09 -->⚙ Miscellaneous Tasks" },
 { body = ".*security", group = "<!-- 10 -->🛡 Security" },
 { message = "^revert", group = "<!-- 11 -->◀ Revert" },
 { message = "^cfix", group = "cfix" },
 { message = ".*", group = "<!-- 13 -->💼 Other" },
]
Comment options

orhun Mar 7, 2025
Maintainer

Look ma, it's a heisenbug!

Not sure what happened there, but happy that it got resolved somehow... Also your config looks fine to me.

Let me know if it appears again or if you experience any other issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /