Page MenuHomePhabricator

Support "Create similar repository..." in Diffusion
Open, WishlistPublic

Description

It would be nice if it was possible to set default settings for repositories in:

https://phab.met.no/applications/edit/PhabricatorDiffusionApplication/

It seems that 99% of the time, the settings are identical for each repository on the site, but when those "default" settings are not the same as the Phabricator defaults.

The use-case we have, for instance, is that we usually work with remote branches on Github. To avoid issues with autoclose, arcanist, etc.; these branches should not be cloned or autoclosed by Phabricator. However, to set this up, it is necessary to go into every repository and manually set this when creating the repository (or later). Apart from being tedious, that process is also error-prone.

Would be nice if the branches thing could be set in the application settings (though I suspect the use-case is general for a lot of the "advanced" settings).

Event Timeline

michaeloa raised the priority of this task from to Needs Triage.
michaeloa updated the task description. (Show Details)
michaeloa added a project: Diffusion.
michaeloa added a subscriber: michaeloa.

We're more likely to implement this by letting you clone an existing repository than by setting global defaults. Would that cover your use case?

You mean something like "Create Similar Repository To..."?

Yes, that would probably work fine.

epriestley renamed this task from Set default settings for new repositories in Diffusion to Support "Create similar repository..." in Diffusion.Dec 23 2014, 12:01 AM
epriestley triaged this task as Wishlist priority.
eadler added a project: Restricted Project.Jan 8 2016, 10:34 PM
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jan 8 2016, 10:40 PM
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jul 4 2016, 9:09 PM

Another hitch when creating a git repo, is that it has no branches, which is confusing for less-advanced users, and very confusing if you otherwise dissallow git push; GH solves this by adding a README file to create a branch with a commit.
I think a more powerful approach is to support some kind of "templates", so that we can create a new "Android App" repo or "COM Module" repo directly, similar to how IDEs have project templates.

If the major immediate issue is Herald disallowing branch creation with git push, we could add a Herald condition like "Repository is empty".

The problem I'm facing is that users just don't know how to push code to a new branch; They expect to git clone a repository that already "works"; Commands like git remote or git push with any arguments are simply beyond the git-fu of some engineers.

The extra layer of not having git push anywhere (T182) in the normal flow is causing them to forget about git push as well, so they try to arc diff the new content (I see now that arc diff in that case does do the right thing; It might just be my landing code that can't handle empty repos).

We generally end up with them emailing me some code and I push it for them.

I don't know if we want "Repository is empty" Herald condition; We have "ref change type" "change creates ref" which is similar.

I'm assuming the "empty" issue is that you have a rule like this?

When:
[ Change creates ref ][ is true ]
Block change with message: [ Don't create new branches! ]

You could change it to this:

When:
[ Change creates ref ][ is true ]
[ Repository is empty ][ is false ]
Block change with message: [ Don't create new branches! ]

Then it wouldn't trigger when the initial branch was pushed.

(That doesn't solve the "engineers don't know how to initialize a new Git repository with git commands" problem, but I think that one's a bit more involved.)

Yeah, my problem is explaining to users what they should do, no so much with the actual blocking configuration. Although, if they do arc-diff and the only problem is my landing script not working, than I can special case it on my end instead of teaching them things.

epriestley edited projects, added Diffusion (v3); removed Diffusion.

I think a more powerful approach is to support some kind of "templates", so that we can create a new "Android App" repo or "COM Module" repo directly, similar to how IDEs have project templates.

Three years later, turns out this still something that's needed - in a microservice-oriented-architecture, we often spin up new services, and have a template for that.
This also exists elsewhere, with lots of CLI tools in the wild that implement something similar: Yeoman, Cookiecutter, Ruby on Rails, [[https://docs.djangoproject.com/en/2.2/ref/django-admin/#startproject | django-admin startproject]].

Looks like there's no web-service version of any of these things though.