This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 374248 - Add e4Build user to ACLs for Eclipse/Equinox
Summary: Add e4Build user to ACLs for Eclipse/Equinox
Status: RESOLVED FIXED
Alias: None
Product: Community
Classification: Eclipse Foundation
Component: Git (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eclipse Webmaster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 376032
  Show dependency tree
 
Reported: 2012-03-14 11:00 EDT by John Arthorne CLA
Modified: 2012-04-05 13:36 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2012-03-14 11:00:04 EDT
Please add the e4Build user to the ACLs (+write) for the Eclipse and Equinox git repositories. This will enable our build to perform tagging operations. Currently we perform tagging as kmoir but Kim won't be doing this anymore after next week.

All of the following directories need this permission.

/gitroot/platform/*
/gitroot/pde/*
/gitroot/jdt/*
/gitroot/equinox/*

Discussed and approved at March 14, 2012 Eclipse PMC meeting:

http://wiki.eclipse.org/Eclipse/PMC
Comment 1 Paul Webster CLA 2012-03-14 11:04:14 EDT
Also include /gitroot/e4/*

PW
Comment 2 David Williams CLA 2012-03-14 11:27:40 EDT
I believe e4Build can/should be added to the "signing directory" ACLs? Or, has that been done already? or covered elsewhere?
Comment 3 Paul Webster CLA 2012-03-14 11:32:21 EDT
(In reply to comment #2)
> I believe e4Build can/should be added to the "signing directory" ACLs? Or, has
> that been done already? or covered elsewhere?

That would remove the need for e4Build to have my ssh keys.

PW
Comment 4 Denis Roy CLA 2012-03-14 13:34:58 EDT
I have issues with this, but hey... I have issues with everything.

+1
Comment 5 Denis Roy CLA 2012-03-14 13:53:29 EDT
$SETFACL -R -m u:e4Build:rwx /gitroot/platform/
$SETFACL -R -m d:u:e4Build:rwx /gitroot/platform/
$SETFACL -R -m u:e4Build:rwx /gitroot/pde/
$SETFACL -R -m d:u:e4Build:rwx /gitroot/pde/
$SETFACL -R -m u:e4Build:rwx /gitroot/jdt/
$SETFACL -R -m d:u:e4Build:rwx /gitroot/jdt/
$SETFACL -R -m u:e4Build:rwx /gitroot/equinox/
$SETFACL -R -m d:u:e4Build:rwx /gitroot/equinox/
$SETFACL -R -m u:e4Build:rwx /gitroot/e4/
$SETFACL -R -m d:u:e4Build:rwx /gitroot/e4/
$SETFACL -R -m u:e4Build:rwx /opt/public/download-staging.priv/eclipse
$SETFACL -R -m d:u:e4Build:rwx /opt/public/download-staging.priv/eclipse
$SETFACL -R -m u:e4Build:rwx /opt/public/download-staging.priv/arch
$SETFACL -R -m d:u:e4Build:rwx /opt/public/download-staging.priv/arch


Did I miss anything?
Comment 6 David Williams CLA 2012-03-14 15:43:55 EDT
Adding Kim to CC list. 

Kim, from a signing/tagging point of view ... does this cover everything you (we :) will need as we move eclipse builds to build.eclipse.org, running under e4Build id? 

Thanks,
Comment 7 Kim Moir CLA 2012-03-14 16:04:22 EDT
What about the /home/data/httpd/download.eclipse.org/eclipse/ /home/data/httpd/download.eclipse.org/equinox

What id will be copying the builds to the download directories?
Comment 8 John Arthorne CLA 2012-03-14 16:53:23 EDT
(In reply to comment #7)
> What about the /home/data/httpd/download.eclipse.org/eclipse/
> /home/data/httpd/download.eclipse.org/equinox
> 
> What id will be copying the builds to the download directories?

We can use any committer id for that. Ideally longer term we will set up a separate promotion job running as a committer. I think we can live without e4Build being able to write to our downloads...
Comment 9 David Williams CLA 2012-03-14 17:37:22 EDT
Perhaps I should ask ... the rest are kind of intuitive ... and maybe this is "obvious" to others ... but, who signs at 

download-staging.priv/arch ? 

What "project" is that for?
Comment 10 David Williams CLA 2012-03-15 12:35:26 EDT
(In reply to comment #9)
> Perhaps I should ask ... the rest are kind of intuitive ... and maybe this is
> "obvious" to others ... but, who signs at 
> 
> download-staging.priv/arch ? 
> 
> What "project" is that for?

To guess at an answer to my own question ... 

From its listing

drwxrwsr-x+   2 root        signers           4K 2012-03-15 12:25 arch/

and contents

-rw-r--r--+ 1 genie       signers 75372K 2012-03-15 12:30 signer.log
-rw-rw-r--+ 1 hudsonBuild signers     1K 2012-03-15 12:24 signing_queue.lock.10782

this appears to be some sort of "technical" directory, needed by the signing system itself. 

So, I'll assume e4Build does need acl access there too (since it is probably not literally in the "signers" group). 

So, with that, I think this bug can be resolved, and new ones open if something doesn't work as expected. Please re-open if I have misunderstood anything. 

Much thanks to all.
Comment 11 John Arthorne CLA 2012-03-22 14:38:52 EDT
Unfortunately the ACLs weren't enough. The commit hook is preventing e4Build from pushing tags. Denis how does the commit hook work and is there a way we can make this work?
Comment 12 Paul Webster CLA 2012-03-22 14:42:00 EDT
A test on build.eclipse.org as e4Build
cd /shared/eclipse/e4/gitTest/
git clone file:///gitroot/e4/org.eclipse.migration.git
cd org.eclipse.migration
git tag testTagPush
git push --tags

I get:
Total 0 (delta 0), reused 0 (delta 0)
remote: Can't call method "get_value" on an undefined value at hooks/update line 291, <DATA> line 522.
remote: error: hook declined to update refs/tags/testTagPush
To file:///gitroot/e4/org.eclipse.migration.git
 ! [remote rejected] testTagPush -> testTagPush (hook declined)
error: failed to push some refs to 'file:///gitroot/e4/org.eclipse.migration.git'

From a glance, it doesn't like that e4Build is not in the ldap directory.

PW
Comment 13 Denis Roy CLA 2012-03-22 14:58:55 EDT
Right, e4Build is not an ldap user -- it's an account we created on build.eclipse.org specifically.

*sigh* 

From here, we either toss the e4Build user into LDAP (which doesn't sound right) or we remove the commit hook on your repositories, because it simply "doesn't fit".
Comment 14 Paul Webster CLA 2012-03-22 15:14:40 EDT
(In reply to comment #13)
> 
> From here, we either toss the e4Build user into LDAP (which doesn't sound
> right) or we remove the commit hook on your repositories, because it simply
> "doesn't fit".

There's the 3rd (also unpalatable) option, where we do add a committer to all of our repos.

PW
Comment 15 John Arthorne CLA 2012-03-22 16:06:24 EDT
Removing the commit hook doesn't sound like an option, because it's required by our IP process to maintain provenance information. I could imagine doing this only for our "maps" repository because this is really a special artifact of the build and not a code repository. But that doesn't get us all the way because we need to push tags for other repos. 

I don't understand how the update hook is checking tags in the first place. Tags don't have author/committer information associated with them so what exactly is being checked here?

I don't understand the implications either way of adding e4Build to LDAP. Concretely what does this mean? I'm not arguing for it, just trying to understand what impact that has.

I agree the other fallback is to make somebody a committer on everything. This would also require setting up SSH keys so e4Build could become that committer, which is something we were trying to get away from.
Comment 16 Denis Roy CLA 2012-03-22 16:16:50 EDT
(In reply to comment #15)
> Removing the commit hook doesn't sound like an option, because it's required by
> our IP process to maintain provenance information.

Right.  The hook exists to ensure that all commits that are being pushed to us contain something that can be traced back to a human being who signed a committer agreement.  Unless e4Build is people, that can't happen.


We have instances where the Hudson Build account and Gerrit account can write to various locations, but there are front-end applications that are tracking its activity.


> I don't understand how the update hook is checking tags in the first place.
> Tags don't have author/committer information associated with them so what
> exactly is being checked here?

The update hook doesn't examine tags, it examines commits, looking at the author and committer lines to see if they belong in the LDAP group that owns the repo.
Comment 17 John Arthorne CLA 2012-03-22 16:23:06 EDT
(In reply to comment #16)
> The update hook doesn't examine tags, it examines commits, looking at the
> author and committer lines to see if they belong in the LDAP group that owns
> the repo.

In Paul's test in comment #12 he didn't create any commits. Could there just be some edge case bug in the hook code?

remote: Can't call method "get_value" on an undefined value at hooks/update
line 291, <DATA> line 522.
Comment 18 Denis Roy CLA 2012-03-22 16:35:28 EDT
There are two places in this hook where I could see us making changes:

# Get current committer info
{

        my $mesg = ldap_search ("ou=People,dc=eclipse,dc=org","(uid=$this_user)");
        $current_committer_email = $mesg->entry(0)->get_value("mail");
}

The above code is used to determine the email address of the current committer.  We did that back when each pushed commit had to belong to the committer performing the push.  We've since relaxed that rule, and checks are done against each commit record separately.  

That is currently where your script is failing -- it cannot get e4Build's email address.



if ($op ne 'D') {
[snip]
        check_committers (all_new_committers);
        check_committers (all_new_taggers) if $new_type eq 'tag';
}

The  check_committers (all_new_taggers) if $new_type eq 'tag'; can probably be dropped too .. do we really care if tags were not created by a committer on the project?


I've changed /gitroot/e4/org.eclipse.migration.git/hooks/update to remove the email check -- can you try your push now?
Comment 19 John Arthorne CLA 2012-03-22 16:43:46 EDT
(In reply to comment #18)
> The  check_committers (all_new_taggers) if $new_type eq 'tag'; can probably be
> dropped too .. do we really care if tags were not created by a committer on the
> project?

I don't see how it can establish who created the tag. If I look into the git metadata, each tag is just a file containing the hash of the commit it is associated with. There is no committer/author information involved (unless it is an annotated tag, but we're not using those).

But yes, if this happened:

- Joe contributor creates a tag
- Jill committer pulls from Joe, and then pushes with --tags to eclipse.org

-> The tag originally created by Joe is in eclipse.org.

Even if you could tell that the tag originally came from Joe, I don't see a problem with allowing it. There is no interesting IP in a tag.
Comment 20 Denis Roy CLA 2012-03-22 16:53:27 EDT
> I don't see how it can establish who created the tag.

FWIW, I didn't write this hook -- I was just a sample update hook by Shawn Pierce that I butchered to make it work for Eclipse IP.

If your push works with the heck_committers (all_new_taggers), then great -- we're done.  Otherwise we can try removing it too.
Comment 21 Paul Webster CLA 2012-03-22 21:25:05 EDT
(In reply to comment #20)
> 
> If your push works with the heck_committers (all_new_taggers), then great --
> we're done.  Otherwise we can try removing it too.

I got an error in the perl script, but simply removing the { } on either side of trying to find the email address appears to have worked:

bash$ git push --tags
Total 0 (delta 0), reused 0 (delta 0)
To file:///gitroot/e4/org.eclipse.migration.git
 * [new tag]         testTagPush -> testTagPush

So is that email extraction just not needed as part commit hook?  It looks like e4Build would be able to push tags all of our repos with this minor hook change (that's good).

We just have to decide how we'll push commits to eclipse.platform.releng.maps and org.eclipse.e4.releng.

PW
Comment 22 Denis Roy CLA 2012-03-23 09:02:58 EDT
> So is that email extraction just not needed as part commit hook?

Not needed at all.  Info about the current user performing the push is irrelevant to the hook.

I'll update the master copy of the hook, deploy it to all the repos and call this one fixed.
Comment 23 Denis Roy CLA 2012-03-23 14:38:51 EDT
I've deployed the updated hook to the central location (thus, it will be picked up by future initrepo commands) and deployed it to all the existing repos.

This is for John A:

dev1:/gitroot # find . -maxdepth 3 -type d -name 'hooks' -exec cp /usr/local/share/git-core/templates/hooks/update {}/update \;
Comment 24 Dani Megert CLA 2012-03-26 07:15:07 EDT
(In reply to comment #22)
> > So is that email extraction just not needed as part commit hook?
> 
> Not needed at all.  Info about the current user performing the push is
> irrelevant to the hook.

Are you saying that the hook allows to push a change into a repository from someone who is not a committer on that project? That would be wrong, as hence anyone could modify the current HEAD of a project by pushing a change from a real committer/author but which wasn't intended to end up in the central repo.
Comment 25 Paul Webster CLA 2012-03-26 07:38:26 EDT
(In reply to comment #24)
> Are you saying that the hook allows to push a change into a repository from
> someone who is not a committer on that project? That would be wrong, as hence
> anyone could modify the current HEAD of a project by pushing a change from a
> real committer/author but which wasn't intended to end up in the central repo.

Our primary authentication is still the component ACLs.  So no one can push to the repo unless they're a committer on that project.

PW
Comment 26 Dani Megert CLA 2012-03-26 07:42:42 EDT
(In reply to comment #25)
> (In reply to comment #24)
> > Are you saying that the hook allows to push a change into a repository from
> > someone who is not a committer on that project? That would be wrong, as hence
> > anyone could modify the current HEAD of a project by pushing a change from a
> > real committer/author but which wasn't intended to end up in the central repo.
> 
> Our primary authentication is still the component ACLs.  So no one can push to
> the repo unless they're a committer on that project.
> 
> PW

Ah, right, of  course!
Comment 27 David Williams CLA 2012-04-04 19:37:02 EDT
Add one more issue. e4Build now has rights to "put" things in eclipse signing directory due to ACL chagne ... but, not to execute the "sign" executable. I happen to know you've done this for another project :) (wtpBuild). 

...> getfacl /usr/local/bin/sign
getfacl: Removing leading '/' from absolute path names
# file: usr/local/bin/sign
# owner: root
# group: signers
# flags: -s-
user::rwx
group::r-x
other::---

...> getent group signers
signers:x:8303:wtpBuild

Sound doable?
Comment 28 Denis Roy CLA 2012-04-05 09:27:42 EDT
getent group | grep signers
signers:x:8303:wtpBuild,e4Build
signers:*:8303:droy,genie,

We had created a local group with the same gid for the local users.  How clever of us.  I've added e4Build to the local group.
Comment 29 Dani Megert CLA 2012-04-05 09:46:40 EDT
I suspect that the changes to the commit hook now cause bug 376166.
Comment 30 David Williams CLA 2012-04-05 13:36:15 EDT
(In reply to comment #28)
> I've added e4Build to the local group.

Thanks! Note to self. After such a change, I had to log out of my shell session to e4Build and log back in before having access. 

> I suspect that the changes to the commit hook now cause bug 376166.
Dani, I think the changes would not have caused it, since the changes were to "loosen" requirements for commits related to tagging. But, I think all commit hooks were "updated" (as mentioned in comment 23) thus it may have placed a one there, where is had been previously removed. We think a thing like that happened to the maps repo, I believe it was, which we subsequently removed. 

I think we can close this bug as fixed?