[GH-ISSUE #126] Chronological ordering of issues and PR's in Gitea #63

Closed
opened 2026-02-27 15:54:53 +03:00 by kerem · 10 comments
Owner

Originally created by @mayankchetan on GitHub (Oct 23, 2025).
Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/126

Originally assigned to: @arunavo4 on GitHub.

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

Originally created by @mayankchetan on GitHub (Oct 23, 2025). Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/126 Originally assigned to: @arunavo4 on GitHub. 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
kerem closed this issue 2026-02-27 15:54:53 +03:00
Author
Owner

@arunavo4 commented on GitHub (Oct 23, 2025):

@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

<!-- gh-comment-id:3438309092 --> @arunavo4 commented on GitHub (Oct 23, 2025): @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
Author
Owner

@mayankchetan commented on GitHub (Oct 23, 2025):

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!!

<!-- gh-comment-id:3439009843 --> @mayankchetan commented on GitHub (Oct 23, 2025): 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!!
Author
Owner

@arunavo4 commented on GitHub (Oct 24, 2025):

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

<!-- gh-comment-id:3440461479 --> @arunavo4 commented on GitHub (Oct 24, 2025): @mayankchetan Here check this version `docker pull ghcr.io/raylabshq/gitea-mirror:e99f320`
Author
Owner

@mayankchetan commented on GitHub (Oct 24, 2025):

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!

<!-- gh-comment-id:3440555431 --> @mayankchetan commented on GitHub (Oct 24, 2025): 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!
Author
Owner

@arunavo4 commented on GitHub (Oct 24, 2025):

@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?

<!-- gh-comment-id:3440569323 --> @arunavo4 commented on GitHub (Oct 24, 2025): @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?
Author
Owner

@mayankchetan commented on GitHub (Oct 24, 2025):

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
<!-- gh-comment-id:3440598184 --> @mayankchetan commented on GitHub (Oct 24, 2025): 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" />
Author
Owner

@arunavo4 commented on GitHub (Oct 24, 2025):

@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.

<!-- gh-comment-id:3440646384 --> @arunavo4 commented on GitHub (Oct 24, 2025): @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.
Author
Owner

@arunavo4 commented on GitHub (Oct 24, 2025):

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

<!-- gh-comment-id:3440711360 --> @arunavo4 commented on GitHub (Oct 24, 2025): @mayankchetan Here try this one `docker pull ghcr.io/raylabshq/gitea-mirror:929d49e` has comments added
Author
Owner

@mayankchetan commented on GitHub (Oct 24, 2025):

Tested!

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

<!-- gh-comment-id:3440775531 --> @mayankchetan commented on GitHub (Oct 24, 2025): Tested! Perfect!! Thank you so much for the quick fixes!!
Author
Owner

@arunavo4 commented on GitHub (Oct 24, 2025):

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.

<!-- gh-comment-id:3440822006 --> @arunavo4 commented on GitHub (Oct 24, 2025): 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gitea-mirror#63
No description provided.