Skip to content

Repository transfer should be confirmed by the new owner before the transfer actually occurs #5744

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

Closed
wants to merge 64 commits into from

Conversation

adelowo
Copy link
Member

@adelowo adelowo commented Jan 16, 2019

Fixes #4743

  • Don't transfer a repository immediately but put the repo in a pending state. See screenshot below
  • Cancel a repository transfer.
  • Send an email to the recipient informing him/her of the pending transfer.
  • Actually perform the transfer once the recipient accepts the "invite"
  • Transfer invitations can be rejected
  • Make a redirect after a successful transfer
  • Tests.

screenshot 2019-01-16 at 15 08 18

@@ -1444,120 +1444,6 @@ func RepoPath(userName, repoName string) string {
return filepath.Join(UserPath(userName), strings.ToLower(repoName)+".git")
}

// TransferOwnership transfers all corresponding setting from old user to new one.
Copy link
Member Author

Choose a reason for hiding this comment

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

Should in case anyone is looking at this, it was moved to the newly created repo_transfer.go file https://github.com/go-gitea/gitea/pull/5744/files#diff-4a00b23928d7e63417b6a39f3052ec23R126

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 16, 2019
@techknowlogick techknowlogick added the pr/wip This PR is not ready for review label Jan 17, 2019
@adelowo
Copy link
Member Author

adelowo commented Feb 9, 2019

So I have this guy already working fine. I just need to send an email to the potential new owner.

Thinking out loud if it makes any sense creating a redirect for the repo after a transfer

@adelowo
Copy link
Member Author

adelowo commented Mar 22, 2019

Will try to wrap up the email and tests this weekend

@6543
Copy link
Member

6543 commented Feb 17, 2020

tested this pull: resiver get no notivication in ui

@6543
Copy link
Member

6543 commented Feb 17, 2020

and secound test didn't worked:

  1. Create Repo repA
  2. Create Org orgA
  3. Transfer repA to orgA
    -> repo is in pending state :( -> why I have to acept a repo transver to a place i have admin access to?
    PS: I know it is a litle bit more work but a lot will aprechiate it

@adelowo
Copy link
Member Author

adelowo commented Feb 17, 2020

Hmm, I should get rid of the UI notification. It’s not needed actually. Made a mental note to remove it but forgot. There’s no sense to it being in the notification or so I think. GitHub doesn’t do that either.

Secondly, there’s a nice case. Will handle it

@@ -26,7 +26,7 @@ type (
)

var (
_ base.Notifier = &notificationService{}
_ base.Notifier = (*notificationService)(nil)
Copy link
Member

Choose a reason for hiding this comment

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

unrelated change

@6543
Copy link
Member

6543 commented Mar 31, 2020

pleace resolve conflics :O

@adelowo
Copy link
Member Author

adelowo commented Apr 2, 2020

Resolved

@adelowo
Copy link
Member Author

adelowo commented Apr 2, 2020

Hmm, I should get rid of the UI notification. It’s not needed actually. Made a mental note to remove it but forgot. There’s no sense to it being in the notification or so I think. GitHub doesn’t do that either.

Secondly, there’s a nice case. Will handle it

Will get to this over the weekend

@adelowo
Copy link
Member Author

adelowo commented Nov 5, 2020

2 years ago.. Damn

@lunny
Copy link
Member

lunny commented Nov 7, 2020

  • Transfer to an organization that you have permisstion to create repository, the confirmation should be ignored.
  • If the limitation is max for the receiver, it should be failed.
  • When it's in transfering state, the repository should be in read-only state.

@resynth1943
Copy link

Please merge this immediately.

The current behaviour makes it look like you have been hacked, which is actually quite terrifying.
I woke up to this today, and assumed my account was compromised.

The best way to move forward would be a user interface element (like a notification) that asks
users whether or not they wish to take on these new repositories.

@techknowlogick
Copy link
Member

@resynth1943 we are all volunteers working on this for free. If you’d like development to go at a pace you prefer you are free to resolve the issues above yourself or pay someone to do it for you.

@resynth1943
Copy link

@techknowlogick not sure what your problem is, mate. Simply offering a use-case in which this can be abused, and a possible way of implementing it.

@lafriks
Copy link
Member

lafriks commented Dec 7, 2020

@resynth1943 it can not be merged while it is not finished so you can't really request to merge it immediately, in fact requesting someone to do for free anything is very bad tone

@resynth1943
Copy link

Thanks for sharing. I'd like to focus on the pull request, though ❤️

Is there a mockup of what the UI looks like in this new rendition?

@6543
Copy link
Member

6543 commented Dec 8, 2020

just an idear: but we could extend RepoState and add "RepoTransvering" next to Migrating status ...

@6543 6543 self-assigned this Feb 20, 2021
@6543 6543 added this to the 1.14.0 milestone Feb 21, 2021
@6543
Copy link
Member

6543 commented Feb 21, 2021

I'll fix and finish this one or open a new pull based on this :)

@6543
Copy link
Member

6543 commented Feb 25, 2021

close since #14792 is here

@6543 6543 closed this Feb 25, 2021
@6543
Copy link
Member

6543 commented Feb 27, 2021

@resynth1943 #14792 has a demo video now ...

@adelowo adelowo deleted the repo_transfer branch May 8, 2021 20:01
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 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 2 This PR needs two approvals by maintainers to be considered for merging. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transfer repo ownership should be confirmed by new owner
10 participants