#4  Able to import projects from other products
Closed
Reopen
Robin Shen opened 1 year ago

Able to import projects from other products such as GitHub/GitLab/BitBucket etc.

Robin Shen changed title 1 year ago
Previous Value Current Value
Able to import/export projects between OneDev and other products Able to import projects from other products
Mikhail Kulakovskiy commented 1 year ago

Do you plan on adding two-way sync between onedev and cloud git hostings? As I see it, you could have a page in project settings with two fileds:

Right now we're trying to implement this behaviour with a job, that runs git push triggered on any commit, plus an external webhook running on the same machine as onedev, triggering git fetch in /opt/onedev/site/projects/X/git path. But this is kind of complex to set up manually, and also you need to modify git config for fetch to import remote commits in local bare repo. Would be nice to have this feature automatically out of box.

Robin Shen commented 1 year ago

This deserves a separate feature request. Filed as issue #66

Quany commented 1 year ago

挺好的

Artur commented 1 week ago

The linked issue #66 does not open.

Artur commented 1 week ago

By the way, just a suggestion.

I think this and many other tasks like this could be implemented using build jobs but some kind of preconfigured as templates or something like this and then added IU elements in Web interface to easily turn it on/off with some necessary configuration.

Maybe some kind of tutorial on how an example job like this could be made as a template and added to web interface as function would be a huge help. I am sure people would contribute many useful jobs like this.

Robin Shen commented 1 week ago

Contributions are very welcomed. This can be implemented as job suggestion, or step type. If it is generic enough, we can ship it together with OneDev.

Referenced from other issue 1 week ago
Robin Shen commented 1 week ago

@kobit I plan to implement the plugin to import from GitHub first to make sure necessary facilities are in-place to support this type of task. Then based on this plugin, it will be much easier for others to contribute importing from GitLab/BitBucket etc.

Please watch on issue #321 to get notified for GitHub import.

Artur commented 1 week ago

Great, thanks a lot. Will you add importing issues as well or just importing code repository?

Robin Shen commented 1 week ago

Issues will also be imported.

Robin Shen changed state to 'Closed' 2 days ago
Previous Value Current Value
Open Closed

@kobit build #1563 (4.5.0) is able to import repositories and issues from GitHub. Closing this issue now. To request importing from other products, please file separate issue for specific product.

Artur commented 1 day ago

Hi, it works!

However, there is one flaw in the implementation. I cannot import projects as private projects. The form forces me to set "Public Role" which automatically makes the project publicly visible.

I would like to import some private projects, visible and accessible only to selected users within 1dev.

Another thingsuggestion. The project automatically adjusts project name adding either github user or github organization in front. Would it be possible to have a pull down field with a list of groups and assign the project to a specific group instead? This is how GitLab works and it is very useful.

I guess, my concerns are mainly because I have hundreds of projects to import from GitHub and adjusting them one by one is very tedious. It would be great with above changes to automate the process as much as possible.

Robin Shen commented 1 day ago

Thanks for testing it out.

  1. The public role is only used for public repositories.
  2. Currently OneDev do not have group concept to group projects. Once that feature is introduced, it will be possible for users to choose which group to put imported projects
Artur commented 22 hours ago

ad. 1. Yes, exactly. Right now it is not possible to leave this field empty during import, so all projects automatically become public. I would like to be able to import projects as private. If you allow empty value in this field, it would solve the problem.

Robin Shen commented 21 hours ago

This field will not affect private repositories. I just tested importing from two repositories, one is private and another is public. And OneDev only sets the default role for the public project after importing.

Artur commented 21 hours ago

Ah, ok. So this settings is ignored for private projects and only set for public?

Still, I think allowing an empty value here would be useful to import all projects as private, regardless whether they are public on GitHub. And it would also be useful if there was some additional explanation under the field: "Specify default role for public repositories. Only applied to public projects at the source system." Or something like this.

One more thing I noticed. After the import is complete, the import view should probably close and switch over to list of projects or something like this.

Robin Shen commented 21 hours ago

I'd like not to make the import configuration too complicated. If one wants to import public as private, they can either change it at GitHub side, or remove the default role after import.

The import view is left here in case user wants to import more projects. Also user may want to check some notice (missing label mapping, user accounts etc) after import to retry it after adjustment.

Artur commented 20 hours ago

Thank you for responding.

Allowing empty field instead of mandatory filled with something does not add any complication.

Robin Shen commented 20 hours ago

Hmm... you are right. Will make this optional in next patch release, together with extra explanation.

Artur commented 20 hours ago

Thank you so much. I appreciate your support.

issue 1 of 1
Type
New Feature
Priority
Normal
Assignee
Milestone
No milestone
Issue Votes (1)
Watchers (5)
Reference
issue onedev-server#4
Please wait...
Page is in error, reload to recover