Project owners need to be able to grant push permissions to other users (maintainers) via the web UI. These perms can either be global for the entire project, or branch-specific. We also need to decide how per-branch ACLs should work when new branches are added - obviously the technically simpler solution being that individuals with only per-branch rights don't get the new branch perms. Also relevant here is the question of lifting branch naming restrictions in the project repo (which I think is at least an OK idea: #722250-3: Determine branch/tag naming restrictions in Git).

Basically, we need the git analogue to http://drupal.org/node/
/cvs-access .

Comments

mikey_p’s picture

I was thinking about this the other day, and I think it'd be reasonable safe to push per-branch permissions to phase 3. We don't have this now, and we seems to get along okay (I don't know of any requests to add it, or any projects needing it), and since we'll already be metering access by repo, that will map well to the per-directory solution that we have now in CVS.

damien tournoud’s picture

Branch-level grants is definitely phase 3, except if it's easier to do that directly in phase 2.

sdboyer’s picture

I'd prefer to see them as an (early) phase 3 thing, but the big blocker there is core. We could make that run off a separate system, but I wrote up comments on the problems with that recently: #714034-56: Determine the access control solution for git . Alternately, we could just manually set up core's ACLs appropriately. Or just let core do without for a little while - I think the social onus is probably sufficient to keep a core branch maintainer from going renegade :)

CorniI’s picture

well I don't think core should hold us up there, core maintainers are trustworthy enough to not behave properly.
So this issue probably needs to be splitted, one for per-branch permissions (phase 3) and one for the general UI+gitolite backend for phase 2.

dww’s picture

Project: Drupal.org infrastructure » Version Control / Project* integration
Version: » 6.x-1.0-rc2
Component: Git » Code

Yes, and this doesn't belong as a d.o infra issue. The UI for this is going to be provided by versioncontrol_project.module and friends. In fact, I bet this issue is a duplicate, but I don't have time to search right now.

dww’s picture

I'm actually tempted to call this duplicate with #69556: move "cvs access" tab into project, make it generic. I'm wondering if this should be versioncontrol_project's problem at all, or if we want a more generic solution in project itself.

sdboyer’s picture

I initially didn't quite see how this would work, but it's making more sense the more I think about it. Having this recorded in a more generic, project-facing way means that more things nifty things can be done in the issue queues, per the discussion in that issue. I think the important thing would be to make sure that project has some sort of node_save-type broadcast hook which is invoked that'll make loose coupling easier between project's way of thinking about the ACLs and versioncontrol. In this case, I think it'd be versioncontrol_project that picked up those hooks and moved the data into the tables that versioncontrol expects. That's a bit of data duplication, yes, but I'm more inclined for this kind of loose coupling because a) versioncontrol and project really are two separate systems, b) because conceptually, ACL information is something that's tightly grouped with repositories, and c) if we end up needing/wanting to put our ACL info into something faster (mongo, cassandra, whatever) for handling network operations, this would be the obvious spot to do it.

hunmonk’s picture

adding redesign tags

dww’s picture

Title: Provide UI for manipulating git project ACLs » Extend project maintainer UI for manipulating git project ACLs
Status: Active » Postponed

This is blocked on #69556: move "cvs access" tab into project, make it generic. Once that issue is done and deployed, this issue can become active again for injecting a "Maintain version control" checkbox (or whatever) on the /node/N/maintainers tab on project nodes and then save those values into the appropriate vcapi tables.

dww’s picture

Assigned: Unassigned » dww
Issue tags: +drupal.org redesign sprint 2

I'll be working on this for sprint #2

sdboyer’s picture

So this is done now, right?

dww’s picture

Status: Postponed » Active

Not at all. There's a "Write to CVS" checkbox from cvs.module thanks to #880818: Remove CVS access tab in favor of the project maintainers form. We have no such checkbox provided by vc_project that tells vcapi to give user N access to write to the VCS for project X. It's easy, but not done.

dww’s picture

This is for Git, not d.o redesign.

mikey_p’s picture

Spoke with sdboyer about this in #drupal-vcs the other day and I'm going to try to sum up my understanding as closely as possible.

Since each module that hooks into project_maintainer permissions is responsible for storing it's data and permissions itself, the question was where the permissions that are exposed via the maintainers tab would be stored. Would it be in a table owned by versioncontrol_project (associated with the project ID), or as part of VC API (associated with the repo ID)? The conclusion seems to be that although VC API has this functionality know, it's going to be killed, and that versioncontrol_project should store this data in it's own tables, and not worry about interfacing ACLs with VC API until VC API supported per branch permissions.

dww’s picture

We need to talk to Sam, then, since I think it'd be a terrible mistake for VCAPI to only support ACLs via vc_project. That means each backend would have to know about vc_project to be able to handle ACLs at all. ACLs seemed to be one of the few features that all VCS's want to support that could fairly easily be abstracted by VCAPI, instead of having tons of low-level logic without any layer of indirection. This sounds like a giant regression in VCAPI to me. Before we work on this, we need to discuss and clarify why we're taking such a big step backwards...

marvil07’s picture

Details about what is going to happen with authentication on vcs api: #223891: API change: make authentication management pluggable (we are now in the process of re-factor accounts inside the vcs api).

BTW commit_restrictions module is not really touched long time ago, but we probably want to discuss about it after the re-factor is done. I do not see the removing of that module IIRC.

sdboyer’s picture

Quick clarification re: #14 & #15 - authentication is becoming pluggable. VCAPI will probably provide some (or maybe a lot) of the plugins that do the basic auth themselves - and to whatever extent those plugins require their own tables, VCAPI will also own those. However, it'll be up to some combination of the implementing module (in this case, vc_project) and the backend to determine which of the plugins to actually _use_ on a given repository.

sdboyer’s picture

Issue tags: +git sprint 6

Marking this for sprint 6. I'm going to try to work on this, because it'll be the real test of whether we did #223891: API change: make authentication management pluggable properly.

eliza411’s picture

Issue tags: +git sprint 7

Tagging for Git Sprint 7.

mikey_p’s picture

Assigned: dww » mikey_p

Assigning this to myself since I'm getting started on it.

mikey_p’s picture

Version: 6.x-1.0-rc2 » 6.x-2.x-dev

Upping version.

mikey_p’s picture

Status: Active » Needs review
StatusFileSize
new3.02 KB

This is a start to making project maintainer permissions work. This is just all or nothing access to each repo, and deleting a user doesn't work due to #1003946: VersioncontrolAuthHandlerMappedAccounts has no way to delete rows from auth table. This also requires #1003904: Queries in VersioncontrolAuthHandlerMappedAccounts::save not actually executed to be applied, or updating maintainer perms will fail.

mikey_p’s picture

StatusFileSize
new3.93 KB

The two issues mentioned in #22 are resolved, and this is 99% working, although it still needs the patch from #1003552: Pass the project to hook_project_permission_info() to be applied to project to get the proper context to show the correct perms, even though we could parse this from menu_get_object.

dww’s picture

From a Project* perspective, this mostly looks fine to me, with the following minor nitpick:

A) This chunk:

  if ($repo && $repo->plugins['auth_handler'] == $plugin) {
    return TRUE;
  }
  return FALSE;

could be simplified to:

  return $repo && $repo->plugins['auth_handler'] == $plugin;

Besides that, this seems fine. Ideally, we'd get one of the VCAPI maintainers to also review this to make sure they're also happy. ;) Otherwise, I'd just RTBC this myself right now.

dww’s picture

Status: Needs review » Needs work

Well, I guess needs work for 24.A...

mikey_p’s picture

Status: Needs work » Needs review
StatusFileSize
new3.9 KB

Fixed the issue from #24.

I'm still not thrilled with the flexibility and pluggablity of this approach, there are a number of conditions where it would start to break down with radically different repo structures (such as multiple projects per repo), but this should work okay for now provided that the twisted ssh/git server likes the data that VC API exposes from the auth plugins.

sdboyer’s picture

Status: Needs review » Reviewed & tested by the community

Looks great, from the vcapi integration perspective.

mikey_p’s picture

Status: Reviewed & tested by the community » Needs work

Found some bugs in this when saving an existing, or new node. I just need another place to check the existence of a repo for a given project since it may not be loaded onto a node that is being saved, as I'm currently checking in hook_project_permission_info().

mikey_p’s picture

Status: Needs work » Needs review
StatusFileSize
new3.95 KB
new1.15 KB

Swapped this around to use the helper function for loading a repo given a known project_id instead of counting on the repo being populated when saving the node.

mikey_p’s picture

Status: Needs review » Fixed

Committed the patch from #29.

Status: Fixed » Closed (fixed)
Issue tags: -git phase 2, -git sprint 6, -git sprint 7

Automatically closed -- issue fixed for 2 weeks with no activity.