-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
#13091 - add new mirror button #13105
#13091 - add new mirror button #13105
Conversation
Any ideas on what's going on with the CI run? I don't know how to fix the build as the error seems to be unrelated to my change. |
@divbhasin sometimes there are failed builds due to unrelated failures such as upstream dependencies failing, occasionally it'll be a race condition, although there has been a lot of work to get rid of those. I've restarted your build, and it'll likely pass this build, especially since the same test passed for all other DB types. |
Codecov Report
@@ Coverage Diff @@
## master #13105 +/- ##
==========================================
+ Coverage 42.17% 42.19% +0.01%
==========================================
Files 684 684
Lines 75546 75549 +3
==========================================
+ Hits 31865 31878 +13
+ Misses 38459 38449 -10
Partials 5222 5222
Continue to review full report at Codecov.
|
Looks good although unsure whether we should distinguish the buttons somehow to avoid confusion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a condition to not show when repository.DISABLE_MIRRORS
is enabled.
…tea into 13091-add-new-mirror-button
@silverwind can you have a look, please? The add mirror button does not show now if the option you mentioned is enabled. |
…tea into 13091-add-new-mirror-button
templates/org/home.tmpl
Outdated
@@ -28,6 +28,9 @@ | |||
<div class="ui eleven wide column"> | |||
{{if .CanCreateOrgRepo}} | |||
<div class="text right"> | |||
{{if not .DisabledMirrors}} | |||
<a class="ui green button" href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{.i18n.Tr "new_mirror"}}</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Org
and .Mirror
can be nil, I think you need to conditionally add those params only when the are not nil to not break regular migrations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but how can .Org
be nil? This would be on the homepage of an Org so wouldn't .Org
have to exist? Existing migrations from the dropdown to the top right will not be sending org and mirror params. In that case, from the repo selection page (second screenshot), org=&mirror=
will be sent, which will have no impact on the form in screenshot 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, probably fine. I misinterpreted the serviceType == 0
part in the code. If that template only renders in that if
clause it cannot become nil under regular means.
Co-authored-by: silverwind <me@silverwind.io>
🚀 |
This PR targets #13091. I have tested it manually, and it works. However, I am not sure if this is the best way to do it. I had some trouble on getting URL parameters to carry through to the git service-specific migrate page. Please let me know if there is a better way to get these URL parameters through. I made changes to repo/migrate/migrate.tmpl and repo/migrate.go to accomplish this. The rest is just adding the button.
Screenshots
The screenshots below document the entire flow. The URL params I attached can be seen in the address bar.