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

Add a migrate service type switch page #12697

Merged
merged 15 commits into from
Sep 9, 2020

Conversation

lunny
Copy link
Member

@lunny lunny commented Sep 3, 2020

When clicking New Migration, it will enter a new page to let users chose which Git service they want to migrate from.

  • Chose Git will let you migrate git data or mirror git data from any possible git services via http/https protocol or local disk if enabled.

  • Chose GitHub will let user migrate git/issues ... and etc. data from Github or Github Enterprise

  • Chose GitLab will let user migrate git/issues ... and etc. data from GitLab.com or self-hosted Gitlab

图片

图片

@lunny lunny added the type/enhancement An improvement of existing functionality label Sep 3, 2020
@lunny lunny added this to the 1.13.0 milestone Sep 3, 2020
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 3, 2020
@mrsdizzie
Copy link
Member

Why no mirror for github/gitlab?

@jolheiser
Copy link
Member

The darker colors on the darker background is a little hard to read imo

@mrsdizzie My guess is because mirroring doesn't copy items

@silverwind
Copy link
Member

Icons seem too huge based on that screenshot. Maybe add some padding like 2rem to the icons, keeping the box size or maybe reducing it slightly?

Also, the GitHub icon should be inverted in the dark theme.

@silverwind
Copy link
Member

silverwind commented Sep 3, 2020

Also, I'd suggest using SVG icons over PNG. You can put them in web_src/svg probably as gitea-$iconname (all lowercase, prefix optional but we've been adding gitea prefix for SVGs that not part of another icon set), then run make svg to build them into public and finally include them using {{svg "gitea-$iconname" 128}}.

@6543
Copy link
Member

6543 commented Sep 3, 2020

by the way: token auth field is always deactivated + js could be simplfied since now most option(-hides) are handled by template

@mrsdizzie
Copy link
Member

@mrsdizzie My guess is because mirroring doesn't copy items

Hmm I think this makes the current interface more confusing then:

If a user wants to mirror something from Github they are going to click the giant Github icon first. Figuring out that you need to go back and click the one that is not Github in order to set up a mirror to a Github hosted repo seems more confusing than the current form.

When you click on plain Git there is no option to use a token -- but that will be required for mirroring some repos on Github. So this would remove the option to mirror a private repo hosted on Github at some point? I think we would want the same logic for tokens when it comes to a mirror as well.

I see the difference between mirroring and migrating files but that is pretty subtle considering we already put mirroring in the section labeled migrations.

Looks nice otherwise : )

@lunny
Copy link
Member Author

lunny commented Sep 3, 2020

How about to add a new icon named Mirror or I should add mirror options back to github and gitlab.

@lunny lunny changed the title Add a migrat service type switch page WIP: Add a migrat service type switch page Sep 3, 2020
@mrsdizzie
Copy link
Member

@lunny I think we should add them back because it will want to use a token as well and it will be less confusing to keep anything related to github/gitlab behind their logos

looks nice though!

@lunny lunny changed the title WIP: Add a migrat service type switch page Add a migrat service type switch page Sep 9, 2020
@lunny
Copy link
Member Author

lunny commented Sep 9, 2020

@mrsdizzie @silverwind @jolheiser Done.

@codecov-commenter
Copy link

codecov-commenter commented Sep 9, 2020

Codecov Report

Merging #12697 into master will decrease coverage by 0.01%.
The diff coverage is 45.29%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12697      +/-   ##
==========================================
- Coverage   43.26%   43.24%   -0.02%     
==========================================
  Files         649      650       +1     
  Lines       72046    72041       -5     
==========================================
- Hits        31169    31156      -13     
  Misses      35838    35838              
- Partials     5039     5047       +8     
Impacted Files Coverage Δ
routers/repo/repo.go 28.46% <ø> (-4.26%) ⬇️
routers/repo/view.go 38.11% <ø> (ø)
routers/repo/migrate.go 44.82% <44.82%> (ø)
modules/structs/repo.go 50.00% <100.00%> (-15.52%) ⬇️
modules/util/timer.go 42.85% <0.00%> (-42.86%) ⬇️
modules/indexer/stats/queue.go 64.70% <0.00%> (-11.77%) ⬇️
modules/indexer/stats/db.go 43.47% <0.00%> (-8.70%) ⬇️
modules/notification/mail/mail.go 34.48% <0.00%> (-3.45%) ⬇️
modules/notification/ui/ui.go 80.55% <0.00%> (-2.78%) ⬇️
... and 9 more

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 6483dbc...475741f. Read the comment docs.

options/locale/locale_en-US.ini Outdated Show resolved Hide resolved
routers/repo/migrate.go Outdated Show resolved Hide resolved
@mrsdizzie
Copy link
Member

Link for information on how to generate access tokens
Screen Shot 2020-09-09 at 10 38 17 AM

diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl
index 4eaf025e8..7cb663da9 100644
--- a/templates/repo/migrate/github.tmpl
+++ b/templates/repo/migrate/github.tmpl
@@ -22,6 +22,7 @@
                    <div class="inline field {{if .Err_Auth}}error{{end}}">
                        <label for="auth_token">{{.i18n.Tr "access_token"}}</label>
                        <input id="auth_token" name="auth_token" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}>
+                     <a  target=”_blank” href="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token">{{svg "octicon-question" 16}}</a>
                    </div>

                    <div class="inline field">
diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl
index 4eaf025e8..d30af0d9c 100644
--- a/templates/repo/migrate/gitlab.tmpl
+++ b/templates/repo/migrate/gitlab.tmpl
@@ -22,6 +22,7 @@
                    <div class="inline field {{if .Err_Auth}}error{{end}}">
                        <label for="auth_token">{{.i18n.Tr "access_token"}}</label>
                        <input id="auth_token" name="auth_token" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}>
+                     <a  target=”_blank” href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html">{{svg "octicon-question" 16}}</a>
                    </div>

                    <div class="inline field">

@lunny
Copy link
Member Author

lunny commented Sep 9, 2020

@mrsdizzie Done.

Copy link
Member

@a1012112796 a1012112796 left a comment

Choose a reason for hiding this comment

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

@lunny
Copy link
Member Author

lunny commented Sep 9, 2020

@mrsdizzie done.

@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 Sep 9, 2020
@mrsdizzie mrsdizzie added the type/changelog Adds the changelog for a new Gitea version label Sep 9, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 9, 2020
@techknowlogick techknowlogick changed the title Add a migrat service type switch page Add a migrate service type switch page Sep 9, 2020
@techknowlogick techknowlogick merged commit e153cf0 into go-gitea:master Sep 9, 2020
@lunny lunny deleted the lunny/migration_card branch September 10, 2020 00:57
This was referenced Sep 10, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@delvh delvh removed the type/changelog Adds the changelog for a new Gitea version label Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.