Chronological ordering of issues and PR's in Gitea #62

Closed
opened 2026-10-05 01:38:48 +02:00 by adam · 10 comments
Owner

Thank you so much for this awesome project!! Using this to archive open source research tools. Have it setup and running via docker-compose.

I noticed that the issues and PR's added to Gitea tend to be in reverse chronological order (mostly) of those on GitHub. I'm guessing (haven't read thru the code) its based on the pages GitHub serves via the API.

Would it be possible to use either the issue/PR posted date/# on GitHub to order their creation in Gitea? This way the issue ordering for very active and large repositories are preserved.

Here's an example for https://github.com/WISDEM/WISDEM:

Closed issues are sorted by 'Newest` on GitHub
Image

Closed issues are sorted by 'Oldest` on Gitea instance
Image

Thanks!
Mayank

Thank you so much for this awesome project!! Using this to archive open source research tools. Have it setup and running via docker-compose. I noticed that the issues and PR's added to Gitea tend to be in reverse chronological order (mostly) of those on GitHub. I'm guessing (haven't read thru the code) its based on the pages GitHub serves via the API. Would it be possible to use either the issue/PR posted date/# on GitHub to order their creation in Gitea? This way the issue ordering for very active and large repositories are preserved. Here's an example for https://github.com/WISDEM/WISDEM: Closed issues are sorted by 'Newest` on GitHub <img width="1321" height="645" alt="Image" src="https://github.com/user-attachments/assets/2125170f-2e3e-42c0-b1ed-429c3e10063d" /> Closed issues are sorted by 'Oldest` on Gitea instance <img width="1305" height="643" alt="Image" src="https://github.com/user-attachments/assets/c59069be-856e-4bdc-857a-3c4aef2b012d" /> Thanks! Mayank <!-- github-sync-id:3544991934 -->
adam closed this issue 2026-10-05 01:38:48 +02:00
Author
Owner

@mayankchetan Thanks for your feedback I have not realised this before I have updated the ordering from the github API. but since we use parallel API calls to gitea to create these issues we will end up with some out of order items. If you need this to be deterministic and cannot afford any noise, then set this new env var MIRROR_ISSUE_CONCURRENCY=1 / MIRROR_PULL_REQUEST_CONCURRENCY=1

Go ahead and test the docker image from this PR #128

@mayankchetan Thanks for your feedback I have not realised this before I have updated the ordering from the github API. but since we use parallel API calls to gitea to create these issues we will end up with some out of order items. If you need this to be deterministic and cannot afford any noise, then set this new env var `MIRROR_ISSUE_CONCURRENCY=1 / MIRROR_PULL_REQUEST_CONCURRENCY=1` Go ahead and test the docker image from this PR #128 <!-- github-comment-id:3438309092 -->
Author
Owner

Thanks @arunavo4! that works almost perfectly! Still some race condition going on there, but that should be OK.

Image Image

Could the date be added in the Gitea issues where it says Originally created by <<user>> on GitHub. and <<user2>> commented on GitHub: ?

Maybe something like:
Originally created by <<user>> on GitHub (<<date>>, <<time>>, <<TZ>>) & <<user2>> commented on GitHub (<<date>>, <<time>>, <<TZ>>):

That would really help keep the discussion timeline consistent with the original repository. I'm trying to mirror the repositories for posterity, so all the metadata is quite important.

Sorry if these requests are too many, I'm not familiar with TypeScript.

I've come across a few more bugs & possible QoL improvements, will raise separate issues for them.

Really appreciate your work on this tool!!

Thanks @arunavo4! that works almost perfectly! Still some race condition going on there, but that should be OK. <img width="1331" height="579" alt="Image" src="https://github.com/user-attachments/assets/cd945fa3-e568-459f-abab-7f5032d1ec3f" /> <img width="1319" height="559" alt="Image" src="https://github.com/user-attachments/assets/04cb24d2-fda2-4dc3-8af3-94a3d144828a" /> ---------------- Could the date be added in the Gitea issues where it says `Originally created by <<user>> on GitHub.` and `<<user2>> commented on GitHub:` ? Maybe something like: `Originally created by <<user>> on GitHub (<<date>>, <<time>>, <<TZ>>)` & `<<user2>> commented on GitHub (<<date>>, <<time>>, <<TZ>>): ` That would really help keep the discussion timeline consistent with the original repository. I'm trying to mirror the repositories for posterity, so all the metadata is quite important. Sorry if these requests are too many, I'm not familiar with TypeScript. I've come across a few more bugs & possible QoL improvements, will raise separate issues for them. Really appreciate your work on this tool!! <!-- github-comment-id:3439009843 -->
Author
Owner

@mayankchetan Here check this version docker pull ghcr.io/raylabshq/gitea-mirror:e99f320

@mayankchetan Here check this version `docker pull ghcr.io/raylabshq/gitea-mirror:e99f320` <!-- github-comment-id:3440461479 -->
Author
Owner

Tested and working perfectly! The issues & PRs are now ordered!! Thank you!!

I might still take a pass at adding the GitHub date when writing the Gitea issue. Might be a niche requirement vs others. :)

Appreciate your quick responses @arunavo4! Please feel free to close this issue!

Tested and working perfectly! The issues & PRs are now ordered!! Thank you!! I might still take a pass at adding the GitHub date when writing the Gitea issue. Might be a niche requirement vs others. :) Appreciate your quick responses @arunavo4! Please feel free to close this issue! <!-- github-comment-id:3440555431 -->
Author
Owner

@mayankchetan awesome, but this does make the issue and PR creation 3-5x slower since you are opting for perfect ordering. For that I have made it an ENV variable that you can pass please pass these MIRROR_ISSUE_CONCURRENCY=1 / MIRROR_PULL_REQUEST_CONCURRENCY=1

regarding the Github date, where are you looking to add that? the Issue description?

@mayankchetan awesome, but this does make the issue and PR creation 3-5x slower since you are opting for perfect ordering. For that I have made it an ENV variable that you can pass please pass these `MIRROR_ISSUE_CONCURRENCY=1 / MIRROR_PULL_REQUEST_CONCURRENCY=1` regarding the Github date, where are you looking to add that? the Issue description? <!-- github-comment-id:3440569323 -->
Author
Owner

Yeah! I did notice the slowdown, but i'm fine with that since the historical nature of the repository is a higher priority. I think it'd be best to set the number higher as default for other users (noticed in your recent commits the default was 1?).

As for the Github date, yeah, as an example Gitea shows this:

Image

So if the Originally created by @dykesk on GitHub. and @dykesk commented on GitHub:

Could be replaced by something like Originally created by @dykesk on GitHub (Oct 20, 2014). and @dykesk commented on GitHub(Jul 8, 2015): it would add a lot of value to preservation of repositories.

Image
Yeah! I did notice the slowdown, but i'm fine with that since the historical nature of the repository is a higher priority. I think it'd be best to set the number higher as default for other users (noticed in your recent commits the default was 1?). As for the Github date, yeah, as an example Gitea shows this: <img width="976" height="375" alt="Image" src="https://github.com/user-attachments/assets/110b43cd-ab16-416e-9360-cb124d4a393b" /> So if the `Originally created by @dykesk on GitHub.` and `@dykesk commented on GitHub:` Could be replaced by something like `Originally created by @dykesk on GitHub (Oct 20, 2014).` and `@dykesk commented on GitHub(Jul 8, 2015):` it would add a lot of value to preservation of repositories. <img width="938" height="386" alt="Image" src="https://github.com/user-attachments/assets/427c9e13-ba2f-49d2-92c9-0d6a496b6454" /> <!-- github-comment-id:3440598184 -->
Author
Owner

@mayankchetan Okay I think this is useful. and yea I will change back the defaults I wanted to make sure you were using the Env variables.

@mayankchetan Okay I think this is useful. and yea I will change back the defaults I wanted to make sure you were using the Env variables. <!-- github-comment-id:3440646384 -->
Author
Owner

@mayankchetan Here try this one docker pull ghcr.io/raylabshq/gitea-mirror:929d49e has comments added

@mayankchetan Here try this one `docker pull ghcr.io/raylabshq/gitea-mirror:929d49e` has comments added <!-- github-comment-id:3440711360 -->
Author
Owner

Tested!

Perfect!! Thank you so much for the quick fixes!!

Tested! Perfect!! Thank you so much for the quick fixes!! <!-- github-comment-id:3440775531 -->
Author
Owner

Great feel free to let me know if more QoL improvements are needed. But I might be only able to tackle them on the weekend.

Great feel free to let me know if more QoL improvements are needed. But I might be only able to tackle them on the weekend. <!-- github-comment-id:3440822006 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/gitea-mirror#62