Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for getting PullRequest/Issue timeline data. #13250

Closed
1 of 4 tasks
chriseaton opened this issue Oct 21, 2020 · 2 comments · Fixed by #17403
Closed
1 of 4 tasks

API for getting PullRequest/Issue timeline data. #13250

chriseaton opened this issue Oct 21, 2020 · 2 comments · Fixed by #17403
Labels
modifies/api This PR adds API routes or modifies them type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@chriseaton
Copy link

  • Gitea version (or commit ref): 1.12.5
  • Git version:
  • Operating system: CentOS 8.1, via systemd, binary release.
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io: N/A

Description

Proposed API route: GET ​/repos​/{owner}​/{repo}​/issues​/{index}/timeline

Currently, there is no way to get a timeline of issue events (differing comment types in the database) via the API. I am proposing a new API route on repo issues that gets the same data as-is displayed on the GUI below the issue description (see screenshot), similar to the content rendered by the comments template (comments.tmpl).

The returned result could be an array of objects with the essential information from the timeline object.
For example:

[
    {
        "id": "2",
        "type": "7",
        "original_author": "NULL",
        "original_author_id": "0",
        "issue_id": "2",
        "label_id": "20",
        "old_milestone_id": "0",
        "milestone_id": "0",
        "assignee_id": "0",
        "removed_assignee": "False",
        "old_title": "NULL",
        "new_title": "NULL",
        "old_ref": "NULL",
        "new_ref": "NULL",
        "dependent_issue_id": "0",
        "date_created": "",
        "date_updated": ""
    },
  // ...
]

Screenshots

image

@zeripath
Copy link
Contributor

Seems reasonable to me but is there a github API we could implement instead?

@6543 6543 added the modifies/api This PR adds API routes or modifies them label Oct 21, 2020
@chriseaton
Copy link
Author

This might be related from GitHub/API

@6543 6543 added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Oct 21, 2020
@lunny lunny changed the title New GET issue timeline API feature request. API for getting PullRequest/Issue timeline data. Oct 15, 2021
lunny added a commit that referenced this issue Jan 1, 2022
* Add API to get issue/pull comments and events (timeline)
Adds an API to get both comments and events in one endpoint with all required data.
Closes #13250

* Fix swagger

* Don't show code comments (use review api instead)

* fmt

* Fix comment

* Time -> TrackedTime

* Use var directly

* Add logger

* Fix lint

* Fix test

* Add comments

* fmt

* [test] get issue directly by ID

* Update test

* Add description for changed refs

* Fix build issues + lint

* Fix build

* Use string enums

* Update swagger

* Support `page` and `limit` params

* fmt + swagger

* Use global slices

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
)

* Add API to get issue/pull comments and events (timeline)
Adds an API to get both comments and events in one endpoint with all required data.
Closes go-gitea#13250

* Fix swagger

* Don't show code comments (use review api instead)

* fmt

* Fix comment

* Time -> TrackedTime

* Use var directly

* Add logger

* Fix lint

* Fix test

* Add comments

* fmt

* [test] get issue directly by ID

* Update test

* Add description for changed refs

* Fix build issues + lint

* Fix build

* Use string enums

* Update swagger

* Support `page` and `limit` params

* fmt + swagger

* Use global slices

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants