Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 516000

Summary: [PMI] - Use autocomplete for the Committer nominee field
Product: Community Reporter: Eric Poirier <eric.poirier>
Component: Project Management & PortalAssignee: Eric Poirier <eric.poirier>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: chris.guindon, wayne.beaton, webmaster
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Eric Poirier CLA 2017-05-01 10:58:40 EDT
When nominating a user to become a committer to a project, the form in the PMI now only accepts a username such as epoirier.

We'd like to be able to use a user reference field by looking into the site's users.If the nominee is not found, we would look into LDAP and create the user locally.

This is something that have been implemented on Marketplace and Eclipsecon already. So my work on this bug would be based off of the changes made on these sites.
Comment 1 Eric Poirier CLA 2017-05-01 13:13:00 EDT
After investigating this a little bit, it doesn't seem to be possible to create a user reference field in a custom form without installing a 3rd party module.

After discussion with Chris, we decided to go with a simple textfield that uses autocomplete and add validation so when a user doesn't exist locally, it looks into LDAP and creates the user after form submit.
Comment 2 Christopher Guindon CLA 2017-05-08 09:24:39 EDT
(In reply to Eric Poirier from comment #1)
> After investigating this a little bit, it doesn't seem to be possible to
> create a user reference field in a custom form without installing a 3rd
> party module.
> 
> After discussion with Chris, we decided to go with a simple textfield that
> uses autocomplete and add validation so when a user doesn't exist locally,
> it looks into LDAP and creates the user after form submit.

If possible, this should use the same method that I wrote for the user reference field to avoid code duplication.
Comment 3 Wayne Beaton CLA 2017-05-11 23:21:20 EDT
It's reasonable, I think, to assume that the nominator will know the email address of the nominee (Bug 514276). Autocomplete is not necessary. I'd rather just turn it off and instead validate that the email address is known and that the nominee does not already hold the role on the project.
Comment 4 Eric Poirier CLA 2017-05-12 08:41:23 EDT
(In reply to Wayne Beaton from comment #3)
> It's reasonable, I think, to assume that the nominator will know the email
> address of the nominee (Bug 514276). Autocomplete is not necessary. I'd
> rather just turn it off and instead validate that the email address is known
> and that the nominee does not already hold the role on the project.

I have two patches to make the autocomplete and the user needs to look for an email.

https://foundation.eclipse.org/r/#/c/1508/
https://foundation.eclipse.org/r/#/c/1529/

The changes I'm making in these patches, the user would look for someone by email, the email would autocomplete. On form submission, if the user does not exist in projects.eclipse.org, we look in API and we create that user in projects and continue with the validation that is currently in place.

I can remove the autocomplete part of this process but since there's already a patch let me know if you still want to remove it.

Thanks.
Comment 5 Christopher Guindon CLA 2017-05-12 09:56:48 EDT
(In reply to Wayne Beaton from comment #3)
> It's reasonable, I think, to assume that the nominator will know the email
> address of the nominee (Bug 514276). Autocomplete is not necessary. I'd
> rather just turn it off and instead validate that the email address is known
> and that the nominee does not already hold the role on the project.

I tend to agree with Wayne. I don't think we need the auto-complete for this field. The auto-complete can be misleading in this situation since it only search for users known in the users table but not in LDAP.
Comment 6 Eric Poirier CLA 2017-05-12 10:02:25 EDT
(In reply to Christopher Guindon from comment #5)
> (In reply to Wayne Beaton from comment #3)
> > It's reasonable, I think, to assume that the nominator will know the email
> > address of the nominee (Bug 514276). Autocomplete is not necessary. I'd
> > rather just turn it off and instead validate that the email address is known
> > and that the nominee does not already hold the role on the project.
> 
> I tend to agree with Wayne. I don't think we need the auto-complete for this
> field. The auto-complete can be misleading in this situation since it only
> search for users known in the users table but not in LDAP.

You're right. I will remove the autocomplete for the Nominee field.
Comment 7 Eric Poirier CLA 2017-05-15 16:30:11 EDT
This is now on staging and is working well for both the Committer and Project Lead elections.

I tested this on the Dash project:

https://projects-staging.eclipse.org/projects/technology.dash

username: testuser
password: plaintext
Comment 8 Eric Poirier CLA 2017-05-16 15:27:07 EDT
The Committer nominee field has been updated and in the same time it updated the Project lead nominee field.

It now searches by email and if the user is not known from projects.eclipse.org, we look into api.eclipse.org if the user exists in ldap. If it does, we create the user in projects.eclipse.org.

Projects.eclipse.org has been rebuilt, Committer and Project Lead elections are now using this feature.