-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Sync issues, PRs, labels, milestones, comments from GitHub mirrors #20311
base: main
Are you sure you want to change the base?
Conversation
You need to implement |
Codecov Report
@@ Coverage Diff @@
## main #20311 +/- ##
==========================================
- Coverage 47.14% 46.71% -0.43%
==========================================
Files 1149 994 -155
Lines 151446 137597 -13849
==========================================
- Hits 71397 64285 -7112
+ Misses 71611 65414 -6197
+ Partials 8438 7898 -540
... and 1146 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Does this include mirroring release packages as well? Right now Gitea only mirrors the tarballs, and any artifacts (like .appimages) added to GitHub releases are lost. |
Yes, included in this PR |
This PR looks cool, I'll try a build from this branch locally to see if this fixes our needs for having a mirror set up for Github repositories that also syncs, issues, comments on issues and PRs. |
@siddarthkay Thank you for helping testing this out. |
hmm @harryzcy : I used your branch url as the source of my docker image and now I see that the options to select Issues, PRs while setting up a mirror are disabled. Is it intended to be that way? Here is my version: "3"
networks:
gitea:
external: false
services:
server:
build:
context: https://github.com/harryzcy/gitea.git#sync-issue-pr-and-more
dockerfile: Dockerfile
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=mysql
- GITEA__database__HOST=db:3306
- GITEA__database__NAME=gitea
- GITEA__database__USER=gitea
- GITEA__database__PASSWD=gitea
restart: always
networks:
- gitea
volumes:
- ./gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "222:22"
depends_on:
- db
db:
image: mysql:8
restart: always
environment:
- MYSQL_ROOT_PASSWORD=gitea
- MYSQL_USER=gitea
- MYSQL_PASSWORD=gitea
- MYSQL_DATABASE=gitea
networks:
- gitea
volumes:
- ./mysql:/var/lib/mysql
|
Thanks so much for your work on this PR! I've set it up to attempt to see if it'll work for us. I imported a private repository using a Personal Access Token. The initial sync works fine but I'm encountering this error on subsequent syncs:
|
This PR adds support for one-way syncing of topics, milestones, labels, issues, pull requests, comments, reviews, releases, and reactions from pull mirror (GitHub) to Gitea.
Closes #18369.
Downloader
interface is extended withGetNewIssues
,GetNewPullRequests
, since new issues and pull requests should be appended/updated to the existing repository.Uploader
interface is extended withUpdateTopics
,UpdateMilestones
,UpdateLabels
,PatchReleases
,PatchComments
,PatchIssues
, andPatchPullRequests
. AllUpdate*
should replace existing data andPatch*
should append/update but should not delete existing data.The above methods will be implement here for GitHub,
or possibly also GitLab,in this pull request.In order to make the updates work, we would need to uniquely identify a Topic, Milestone, Label, Release, Comments, Issue and PullRequest. The following list shows how they are identified:
OriginalID*: additional column added to database, used to track ID from the source
Screenshot of toggles to set which migration Items should be synced (the only change is now when mirror option is checked, the migration items are still available for supported platforms):