the activity API endpoint at api/v1/orgs/orgname/activities/feeds lacks detail #14414

Open
opened 2025-11-02 11:12:21 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @LazyDodo on GitHub (Apr 26, 2025).

Description

for blender we mirror the activity feed on our chat platform as an easy way for devs to keep up with activity on the gitea instance, we had this since the phabricator days. When we switched to gitea there was no api end point for this and we just scraped the html from https://projects.blender.org/org/blender/dashboard and were on our way. This had some drawbacks as the html format sometimes changed and it required a logged in user to get to that page, so we stole some cookies from a browser session and were once more on our way but... cookies expire... so at random intervals we had to steal new cookies.. all in all, not ideal.

in recent versions of gitea https://projects.blender.org/api/v1/orgs/blender/activities/feeds became available, which somehow doesn't require a logged in user but hey, not complaining there, what i am complaining about is a lack of detail, here's a random example, but virtually all events in the json feed miss "something"

for the following event on the html page

Image

there's this information in the api end point

  {
    "id": 31492556,
    "user_id": 3,
    "op_type": "comment_issue",
    "act_user_id": 24205,
    "act_user": {
      "id": 24205,
      "login": "sentharn",
      "login_name": "",
      "source_id": 0,
      "full_name": "sentharn",
      "email": "sentharn@noreply.localhost",
      "avatar_url": "https://projects.blender.org/avatars/9d773fb219d1486e5bea741dfbbd7c23",
      "html_url": "https://projects.blender.org/sentharn",
      "language": "",
      "is_admin": false,
      "last_login": "0001-01-01T00:00:00Z",
      "created": "2020-09-14T21:21:30+02:00",
      "restricted": false,
      "active": false,
      "prohibit_login": false,
      "location": "",
      "website": "",
      "description": "",
      "visibility": "public",
      "followers_count": 0,
      "following_count": 0,
      "starred_repos_count": 0,
      "username": "sentharn"
    },
    "repo_id": 15,
    "repo": {
      "id": 15,
      "owner": {
        "id": 3,
        "login": "blender",
        "login_name": "",
        "source_id": 0,
        "full_name": "Blender",
        "email": "",
        "avatar_url": "https://projects.blender.org/avatars/5b4ea40e945a7ab60d26a03210414ab8708d7af2d07b9fb51edbd2bab779071e",
        "html_url": "https://projects.blender.org/blender",
        "language": "",
        "is_admin": false,
        "last_login": "0001-01-01T00:00:00Z",
        "created": "2023-02-07T10:25:28+01:00",
        "restricted": false,
        "active": false,
        "prohibit_login": false,
        "location": "",
        "website": "https://www.blender.org/",
        "description": "Blender Foundation",
        "visibility": "public",
        "followers_count": 51,
        "following_count": 0,
        "starred_repos_count": 0,
        "username": "blender"
      },
      "name": "blender",
      "full_name": "blender/blender",
      "description": "The official Blender project repository.",
      "empty": false,
      "private": false,
      "fork": false,
      "template": false,
      "parent": null,
      "mirror": false,
      "size": 1830762,
      "language": "",
      "languages_url": "https://projects.blender.org/api/v1/repos/blender/blender/languages",
      "html_url": "https://projects.blender.org/blender/blender",
      "url": "https://projects.blender.org/api/v1/repos/blender/blender",
      "link": "",
      "ssh_url": "git@projects.blender.org:blender/blender.git",
      "clone_url": "https://projects.blender.org/blender/blender.git",
      "original_url": "http://localhost:3001/blender/blender",
      "website": "",
      "stars_count": 626,
      "forks_count": 971,
      "watchers_count": 196,
      "open_issues_count": 6437,
      "open_pr_counter": 1127,
      "release_counter": 0,
      "default_branch": "main",
      "archived": false,
      "created_at": "2023-02-07T11:02:14+01:00",
      "updated_at": "2025-04-26T21:07:40+02:00",
      "archived_at": "1970-01-01T01:00:00+01:00",
      "permissions": {
        "admin": false,
        "push": false,
        "pull": true
      },
      "has_issues": true,
      "internal_tracker": {
        "enable_time_tracker": false,
        "allow_only_contributors_to_track_time": true,
        "enable_issue_dependencies": true
      },
      "has_wiki": true,
      "has_pull_requests": true,
      "has_projects": true,
      "projects_mode": "",
      "has_releases": false,
      "has_packages": false,
      "has_actions": false,
      "ignore_whitespace_conflicts": false,
      "allow_merge_commits": false,
      "allow_rebase": true,
      "allow_rebase_explicit": false,
      "allow_squash_merge": true,
      "allow_fast_forward_only_merge": false,
      "allow_rebase_update": true,
      "default_delete_branch_after_merge": true,
      "default_merge_style": "squash",
      "default_allow_maintainer_edit": true,
      "avatar_url": "https://projects.blender.org/repo-avatars/a3529a3d6917b4cde48457f95d3325aa51660cd9b25d27ee3d5f6557f3cdea2f",
      "internal": false,
      "mirror_interval": "",
      "object_format_name": "sha1",
      "mirror_updated": "0001-01-01T00:00:00Z",
      "repo_transfer": null,
      "topics": [],
      "licenses": null
    },
    "comment_id": 1559279,
    "comment": {
      "id": 1559279,
      "html_url": "https://projects.blender.org/blender/blender/issues/138030#issuecomment-1559279",
      "pull_request_url": "",
      "issue_url": "https://projects.blender.org/blender/blender/issues/138030",
      "user": null,
      "original_author": "",
      "original_author_id": 0,
      "body": "This might be #80458 :(",
      "assets": [],
      "created_at": "2025-04-26T19:48:27+02:00",
      "updated_at": "2025-04-26T19:48:27+02:00"
    },
    "ref_name": "",
    "is_private": false,
    "content": "138030|This might be #80458 :(",
    "created": "2025-04-26T19:48:27+02:00"
  },

while there is an incredible amount of detail available about the user performing the action, there's other rather basic information that is seemingly completely absent, like what issue/pull is this about? what is its id? what's the title? who made it? when?

the issue ID can only be extracted from the issue_url or/and html_url fields, the title is completely lost.

the content field is generally filled with some arbitrary data, sometimes you get lucky and you get the ID + title of a pull/issue in there, other times it's just the ID, sometimes it's the ID + last comment, and sometimes (the commit_repo op_type) there's another json object string encoded into it... the field is just full of surprises, you never know what you're gonna find in it. which while exciting, not ideal.

all in all, it's currently impossible to retire our html scraper and switch to the gitea api end point for this information.

Gitea Version

1.23.6

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

not in control of the projects.blender.org server, i don't have this information.

Database

None

Originally created by @LazyDodo on GitHub (Apr 26, 2025). ### Description for blender we mirror the activity feed on our chat platform as an easy way for devs to keep up with activity on the gitea instance, we had this since the phabricator days. When we switched to gitea there was no api end point for this and we just scraped the html from https://projects.blender.org/org/blender/dashboard and were on our way. This had some drawbacks as the html format sometimes changed and it required a logged in user to get to that page, so we stole some cookies from a browser session and were once more on our way but... cookies expire... so at random intervals we had to steal new cookies.. all in all, not ideal. in recent versions of gitea https://projects.blender.org/api/v1/orgs/blender/activities/feeds became available, which somehow _doesn't_ require a logged in user but hey, not complaining there, what i am complaining about is a lack of detail, here's a random example, but virtually all events in the json feed miss "something" for the following event on the html page ![Image](https://github.com/user-attachments/assets/bfd2ab17-94ea-4a49-9af0-0cfd3bd04feb) there's this information in the api end point ``` { "id": 31492556, "user_id": 3, "op_type": "comment_issue", "act_user_id": 24205, "act_user": { "id": 24205, "login": "sentharn", "login_name": "", "source_id": 0, "full_name": "sentharn", "email": "sentharn@noreply.localhost", "avatar_url": "https://projects.blender.org/avatars/9d773fb219d1486e5bea741dfbbd7c23", "html_url": "https://projects.blender.org/sentharn", "language": "", "is_admin": false, "last_login": "0001-01-01T00:00:00Z", "created": "2020-09-14T21:21:30+02:00", "restricted": false, "active": false, "prohibit_login": false, "location": "", "website": "", "description": "", "visibility": "public", "followers_count": 0, "following_count": 0, "starred_repos_count": 0, "username": "sentharn" }, "repo_id": 15, "repo": { "id": 15, "owner": { "id": 3, "login": "blender", "login_name": "", "source_id": 0, "full_name": "Blender", "email": "", "avatar_url": "https://projects.blender.org/avatars/5b4ea40e945a7ab60d26a03210414ab8708d7af2d07b9fb51edbd2bab779071e", "html_url": "https://projects.blender.org/blender", "language": "", "is_admin": false, "last_login": "0001-01-01T00:00:00Z", "created": "2023-02-07T10:25:28+01:00", "restricted": false, "active": false, "prohibit_login": false, "location": "", "website": "https://www.blender.org/", "description": "Blender Foundation", "visibility": "public", "followers_count": 51, "following_count": 0, "starred_repos_count": 0, "username": "blender" }, "name": "blender", "full_name": "blender/blender", "description": "The official Blender project repository.", "empty": false, "private": false, "fork": false, "template": false, "parent": null, "mirror": false, "size": 1830762, "language": "", "languages_url": "https://projects.blender.org/api/v1/repos/blender/blender/languages", "html_url": "https://projects.blender.org/blender/blender", "url": "https://projects.blender.org/api/v1/repos/blender/blender", "link": "", "ssh_url": "git@projects.blender.org:blender/blender.git", "clone_url": "https://projects.blender.org/blender/blender.git", "original_url": "http://localhost:3001/blender/blender", "website": "", "stars_count": 626, "forks_count": 971, "watchers_count": 196, "open_issues_count": 6437, "open_pr_counter": 1127, "release_counter": 0, "default_branch": "main", "archived": false, "created_at": "2023-02-07T11:02:14+01:00", "updated_at": "2025-04-26T21:07:40+02:00", "archived_at": "1970-01-01T01:00:00+01:00", "permissions": { "admin": false, "push": false, "pull": true }, "has_issues": true, "internal_tracker": { "enable_time_tracker": false, "allow_only_contributors_to_track_time": true, "enable_issue_dependencies": true }, "has_wiki": true, "has_pull_requests": true, "has_projects": true, "projects_mode": "", "has_releases": false, "has_packages": false, "has_actions": false, "ignore_whitespace_conflicts": false, "allow_merge_commits": false, "allow_rebase": true, "allow_rebase_explicit": false, "allow_squash_merge": true, "allow_fast_forward_only_merge": false, "allow_rebase_update": true, "default_delete_branch_after_merge": true, "default_merge_style": "squash", "default_allow_maintainer_edit": true, "avatar_url": "https://projects.blender.org/repo-avatars/a3529a3d6917b4cde48457f95d3325aa51660cd9b25d27ee3d5f6557f3cdea2f", "internal": false, "mirror_interval": "", "object_format_name": "sha1", "mirror_updated": "0001-01-01T00:00:00Z", "repo_transfer": null, "topics": [], "licenses": null }, "comment_id": 1559279, "comment": { "id": 1559279, "html_url": "https://projects.blender.org/blender/blender/issues/138030#issuecomment-1559279", "pull_request_url": "", "issue_url": "https://projects.blender.org/blender/blender/issues/138030", "user": null, "original_author": "", "original_author_id": 0, "body": "This might be #80458 :(", "assets": [], "created_at": "2025-04-26T19:48:27+02:00", "updated_at": "2025-04-26T19:48:27+02:00" }, "ref_name": "", "is_private": false, "content": "138030|This might be #80458 :(", "created": "2025-04-26T19:48:27+02:00" }, ``` while there is an incredible amount of detail available about the user performing the action, there's other rather basic information that is seemingly completely absent, like what issue/pull is this about? what is its id? what's the title? who made it? when? the issue ID can only be extracted from the `issue_url` or/and `html_url` fields, the title is completely lost. the `content` field is generally filled with some arbitrary data, sometimes you get lucky and you get the ID + title of a pull/issue in there, other times it's just the ID, sometimes it's the ID + last comment, and sometimes (the `commit_repo` op_type) there's another json object string encoded into it... the field is just full of surprises, you never know what you're gonna find in it. which while exciting, not ideal. all in all, it's currently impossible to retire our html scraper and switch to the gitea api end point for this information. ### Gitea Version 1.23.6 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? not in control of the projects.blender.org server, i don't have this information. ### Database None
GiteaMirror added the topic/apitype/proposal labels 2025-11-02 11:12:21 -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#14414