Number of commits passed to webhooks is limited by a UI setting #7715

Open
opened 2025-11-02 07:34:25 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @apaku on GitHub (Aug 19, 2021).

  • Gitea version (or commit ref): 1.14.6
  • Git version: 2.20.1
  • Operating system: Debian Buster (10.10)
    Running gitea from gitea-1.14.6-linux-amd64 using a systemd service
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No (did not try as it needs a webhook setup)

Description

When a webhook is triggered it gets - by default - only 5 commits in the json data it receives. I found this odd and went into looking why this may be happening. Unfortunately the docs do not make this clear, but after digging through the sources, tracking down where the list of commits is generated I found that {{services/repository/push.go}} cuts down the list of commits based on a setting that seems to be intended for the UI only - {{setting.UI.FeedMaxCommitNum}} which is {{FEED_MAX_COMMIT_NUM}} in the configuration as far as I could see.

This is counter-intuitive in two ways to me:

  1. I didn't imagine that settings in a section named 'ui' would be in any way related to the data sent to the configured webhooks
  2. It appears to me that the web-ui does not even use that setting at all, at least my instance where {{FEED_MAX_COMMIT_NUM}} is set to 20 shows me more than 20 commits for a given branch in the history.
Originally created by @apaku on GitHub (Aug 19, 2021). - Gitea version (or commit ref): 1.14.6 - Git version: 2.20.1 - Operating system: Debian Buster (10.10) Running gitea from gitea-1.14.6-linux-amd64 using a systemd service - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No (did not try as it needs a webhook setup) ## Description When a webhook is triggered it gets - by default - only 5 commits in the json data it receives. I found this odd and went into looking why this may be happening. Unfortunately the docs do not make this clear, but after digging through the sources, tracking down where the list of commits is generated I found that {{services/repository/push.go}} cuts down the list of commits based on a setting that seems to be intended for the UI only - {{setting.UI.FeedMaxCommitNum}} which is {{FEED_MAX_COMMIT_NUM}} in the configuration as far as I could see. This is counter-intuitive in two ways to me: 1. I didn't imagine that settings in a section named 'ui' would be in any way related to the data sent to the configured webhooks 2. It appears to me that the web-ui does not even use that setting at all, at least my instance where {{FEED_MAX_COMMIT_NUM}} is set to 20 shows me more than 20 commits for a given branch in the history.
GiteaMirror added the type/enhancement label 2025-11-02 07:34:25 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7715