-
-
Notifications
You must be signed in to change notification settings - Fork 253
Why is the gitea "remote" not filled for some of my commits? #1071
-
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 }, ...
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 4 replies
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
-
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!
Beta Was this translation helpful? Give feedback.
All reactions
-
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:
git-cliff/git-cliff-core/src/remote/mod.rs
Lines 314 to 324 in 9babe06
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
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" }, ]
Beta Was this translation helpful? Give feedback.
All reactions
-
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!
Beta Was this translation helpful? Give feedback.