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

WIP: Add support to migrate from gogs #7181

Closed
wants to merge 6 commits into from

Conversation

lunny
Copy link
Member

@lunny lunny commented Jun 11, 2019

As title

@codecov-io
Copy link

codecov-io commented Jun 11, 2019

Codecov Report

Merging #7181 into master will decrease coverage by 0.12%.
The diff coverage is 2.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7181      +/-   ##
==========================================
- Coverage   41.25%   41.13%   -0.13%     
==========================================
  Files         542      543       +1     
  Lines       69708    69879     +171     
==========================================
- Hits        28758    28744      -14     
- Misses      37269    37454     +185     
  Partials     3681     3681
Impacted Files Coverage Δ
modules/migrations/migrate.go 21.13% <0%> (-1.78%) ⬇️
modules/migrations/gogs.go 2.56% <2.56%> (ø)
modules/sync/unique_queue.go 78.57% <0%> (-10.72%) ⬇️
modules/indexer/indexer.go 44.73% <0%> (-10.53%) ⬇️
models/unit.go 62.16% <0%> (-5.41%) ⬇️
models/repo_indexer.go 66.54% <0%> (-3.64%) ⬇️
routers/repo/view.go 37.71% <0%> (-0.88%) ⬇️
models/gpg_key.go 55.59% <0%> (+0.55%) ⬆️
modules/log/event.go 65.64% <0%> (+1.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe7a6d9...9fe0b4a. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 11, 2019
@zeripath
Copy link
Contributor

Can we do this without having to add gogs-client to every install of gitea?

@lunny
Copy link
Member Author

lunny commented Jun 12, 2019

If we want to support migration from gogs, I think it's difficult except we rewrite a sdk for gogs.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 13, 2019
@lunny lunny added this to the 1.10.0 milestone Jun 14, 2019
@lunny lunny added the type/enhancement An improvement of existing functionality label Jun 14, 2019
func TestGogsDownloadRepo(t *testing.T) {
downloader := NewGogsDownloader("https://try.gogs.io", "c109b3c905eb57951cfdea270cfcfdc297a74500", "", "lunnytest", "TESTREPO")
repo, err := downloader.GetRepoInfo()
assert.NoError(t, err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if try.gogs.io is down, or your repo gets remove...will all builds then fail? I know we already rely on github and other sites being available for building but maybe for these type of migration test it can skip them if the URL doesn't respond properly right away. Even now try.gogs.io is very slow for me and times out on some pages.

Copy link
Member

@silverwind silverwind Jun 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, Internet-dependent tests should ideally not run during regular test runs, but only when explicitely triggered e.g. make test-internet or similar. Could maybe add to release tasks to run those.

"testing"
"time"

"code.gitea.io/gitea/modules/migrations/base"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix import

@lunny lunny force-pushed the lunny/downloader_gogs branch from df629f1 to aab6edf Compare July 8, 2019 08:46
@mrsdizzie
Copy link
Member

@lunny I think we should still have the test, it just shouldn't fail if try.gogs.io is down which would break Gitea CI. Maybe we can just try to ping/reach that site before running the test and skip/pass the test if it isn't available.

A best way would be to caputre timeout in the actual migration code and if the error is a timeout error not fail the test.

Another simple way is to have a check in the test file:

resp, err := http.Get("https://try.gogs.io/lunnytest/TESTREPO")
if err != nil {
   // skip and don't run test
} else {
    // check if response is 200 level
    // ok to run test
}

That should make sure that try.gogs.io is up and that your rest repo is still there.

Also now we can use original_author original_author_id and original_url when migrating these.

@lunny
Copy link
Member Author

lunny commented Jul 8, 2019

@mrsdizzie OK. I will add test back.

@lunny lunny force-pushed the lunny/downloader_gogs branch from 64afd75 to 1989861 Compare July 9, 2019 06:05
@techknowlogick techknowlogick modified the milestones: 1.10.0, 1.11.0 Sep 3, 2019
@6543 6543 mentioned this pull request Oct 26, 2019
24 tasks
@stale
Copy link

stale bot commented Nov 2, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@stale stale bot added the issue/stale label Nov 2, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Nov 2, 2019
@stale stale bot removed the issue/stale label Nov 2, 2019
@lunny lunny force-pushed the lunny/downloader_gogs branch from 1989861 to efcf78d Compare November 3, 2019 04:11
@lunny lunny removed this from the 1.11.0 milestone Dec 13, 2019
@lunny lunny added this to the 1.12.0 milestone Dec 13, 2019
@6543
Copy link
Member

6543 commented Mar 31, 2020

pleace resolve confilcts

@lunny lunny modified the milestones: 1.12.0, 1.13.0 Apr 23, 2020
@Cat7373
Copy link

Cat7373 commented Jun 10, 2020

Why has this feature not been merged yet?

It has been waiting for more than a year.

@6543
Copy link
Member

6543 commented Jun 11, 2020

@Cat7373 the simple answer is nobody had time to finaly finish it

@lunny lunny modified the milestones: 1.13.0, 1.14.0 Sep 1, 2020
@lunny
Copy link
Member Author

lunny commented Jan 15, 2021

replaced by #14342

@lunny lunny closed this Jan 15, 2021
@lunny lunny deleted the lunny/downloader_gogs branch January 15, 2021 01:37
@6543 6543 removed this from the 1.14.0 milestone Jan 15, 2021
@Cat7373
Copy link

Cat7373 commented Jan 15, 2021

get excited.

@go-gitea go-gitea locked and limited conversation to collaborators Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented lgtm/need 1 This PR needs approval from one additional maintainer to be merged. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants