Build backend infrastructure to support multi-value profile fields

VERIFIED FIXED in 2013-09-12

Status

VERIFIED FIXED
6 years ago
5 years ago

People

(Reporter: hoosteeno, Assigned: sancus)

Tracking

other
2013-09-12
Dependency tree / graph

Details

(Whiteboard: [kb=1004879] )

Attachments

(1 attachment)

The new profile screens (https://bugzilla.mozilla.org/show_bug.cgi?id=879052) include a couple of multi-value fields (websites, accounts). We need to support these on the backend. 

The websites field is just a multi-valued field with one string per value. We might wish to validate that strings have http:// on the front, but that is non-critical right now.

The accounts field also adds some additional complexity, since every account is a string plus an account type (Github, Twitter, etc.). And some account types have additional meta data (for example, on Github and Twitter your account name can be concatenated into a URL to your page on those systems). We should build a system that can handle multiple account types; our list on the frontend should pull from these account types; and some account types should be able to return a proper url to that account on a 3rd party system.
Whiteboard: [kb=1004879]
Assignee: nobody → sancus
Status: NEW → ASSIGNED
Suggested implementation:

Every account on a particular profile should have...
* an account type ("Github", "IRC") which comes from a canonical list maintained by admins.
* an account value ("hoosteeno", "sancus")
* an account privacy bit ("public", "mozillians")

The canonical list of account types should have...
* an account type ("Github", "IRC", "URL")
* an optional prefix URL ("http://github.com/")

Unlimited accounts can be added to a profile; any account can be deleted from a profile; it is valid to have 0 accounts.

The architecture of this data should enable the following [potential] use cases:
* In a profile template, for every account associated with a profile, list the account type and name. If it has a prefix URL (or if it is a URL), make the name a link to the account elsewhere.
* From the API, get every Mozillian's accounts and use their github account(s) to integrate with github's API in some way
Target Milestone: --- → 2013-07-25
:williamr, can you please specify the list of accounts that will initially be in the dropdown described in comment 1?

Suggestions to consider:

* Alternate Email Address (https://bugzilla.mozilla.org/show_bug.cgi?id=699952)
* IRC Name
* Github ID
* Twitter Handle
* Facebook URL
* Live Messenger
* Google Plus
* Website
Flags: needinfo?(williamr)
(In reply to Justin Crawford [:hoosteeno] from comment #2)
> :williamr, can you please specify the list of accounts that will initially
> be in the dropdown described in comment 1?

Your suggestions in comment 2 look good to me. A few questions and comments:
* For alternate email address, would that turn email address into a field that can have one or more values? Or would alternate email address be a separate field?
* Can a user add more than one account for a given type? For example, should a user need to add more than one GitHub account to their profile?
* IRC Name already exists as a separate field on profiles. Are you suggesting we make it a multi-value field?
* I think we can skip Live Messenger and just focus on IRC as the messaging account. If we add Live Messenger, it would make sense to also add Skype, AIM, Yahoo, and Google Talk.
* I suggest adding accounts for major Mozilla sites like AMO, MDN and SUMO. We can also add the user's Bugzilla email address. I have added these below.

For the Account types dropdown menu, here are the strings and [placeholder / help text] I suggest using:
* AMO [your AMO username]
* Bugzilla [your Bugzilla email]
* MDN [your MDN username]
* SUMO [your SUMO username]
* GitHub [your GitHub username]
* Facebook [your Facebook URL]
* Twitter [your Twitter username]
* Google+ [your Google+ URL]
* LinkedIn [your LinkedIn URL]
Flags: needinfo?(williamr) → needinfo?(hoosteeno)
> * For alternate email address, would that turn email address into a field
> that can have one or more values? Or would alternate email address be a
> separate field?

It depends on whether we want this feature soon or not. If soon, then we should use the multi-valued accounts field to house additional email addresses. This would not have any relationship to the existing, "authoritative" sign-on email address.

> * Can a user add more than one account for a given type? For example, should
> a user need to add more than one GitHub account to their profile?

They shouldn't need to. But we shouldn't write complex, account-specific validation rules to prevent them from doing so. The simple solution is to let them add what they want to add.

> * IRC Name already exists as a separate field on profiles. Are you
> suggesting we make it a multi-value field?

I guess not.
Flags: needinfo?(hoosteeno)
(In reply to Justin Crawford [:hoosteeno] from comment #4)
> > * For alternate email address, would that turn email address into a field
> > that can have one or more values? Or would alternate email address be a
> > separate field?
> 
> It depends on whether we want this feature soon or not. If soon, then we
> should use the multi-valued accounts field to house additional email
> addresses. This would not have any relationship to the existing,
> "authoritative" sign-on email address.

I agree that the additional email addresses should not have a relationship to the existing, "authoritative" sign-on email address. The main benefit of additional email addresses I see is for search results and potentially for aggregating activity. I may associate a user with email address X, but they may use email address Y as their "authoritative" email address. By allowing additional email addresses, the person I'm searching for could have email address X associated with them and therefore appear in search results. With activity, we can aggregate activity for a user across all of their email addresses.

Justin, do you support using the multi-valued accounts field for additional email addresses? It sounds like it will meet our needs, although I'm open to other options as well.

A related topic is we should allow users to change their "authoritative" sign-on email address, but I think that discussion and work should happen in a different bug.

> > * Can a user add more than one account for a given type? For example, should
> > a user need to add more than one GitHub account to their profile?
> 
> They shouldn't need to. But we shouldn't write complex, account-specific
> validation rules to prevent them from doing so. The simple solution is to
> let them add what they want to add.

Okay, let's go with the simple solution and let users add what they want to add.
This change will appear in a future release (and soon!).
Target Milestone: 2013-07-25 → ---
Blocks: 902008

Comment 7

5 years ago
Commits pushed to master at https://github.com/mozilla/mozillians

https://github.com/mozilla/mozillians/commit/dd9e4979c419de9effcf7854b655ee3c40c43bf1
[Fix Bug 881852] add multi-account field to user profile

https://github.com/mozilla/mozillians/commit/e1d4f0fbb7ee69e159b9af805a274c93adba7341
Merge pull request #601 from Sancus/multiaccounts

[Fix Bug 881852] add multi-account field to user profile

Updated

5 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Comment 8

5 years ago
Commit pushed to master at https://github.com/mozilla/mozillians

https://github.com/mozilla/mozillians/commit/e1fc258ffb486638f2ed4fab99eb3fe9bf9837ea
[Bug 881852] Add additional account information/urls and fix minor JS typo
Target Milestone: --- → 2013-09-12
Comments in the commit:

https://github.com/mozilla/mozillians/commit/dd9e4979c419de9effcf7854b655ee3c40c43bf1
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Comment 10

5 years ago
Commits pushed to master at https://github.com/mozilla/mozillians

https://github.com/mozilla/mozillians/commit/5c53b8d4a8ed9ea9d3139be754e16a0705021b91
[Bug 881852] Some tests for profile external accounts

https://github.com/mozilla/mozillians/commit/55a1cf1f4b83ce3e0c9120673d8ce680eaee4bd9
[Fix Bug 881852] Improvements/fixes to multi-account code

https://github.com/mozilla/mozillians/commit/c359d1e2be51e8a87584a05ccdc8b0d07b28a01c
Merge pull request #613 from Sancus/multiaccountstests

[Bug 881852] Some tests/fixes for profile external accounts

Updated

5 years ago
Status: REOPENED → RESOLVED
Last Resolved: 5 years ago5 years ago
Resolution: --- → FIXED
Williamr:

Would you prefer the current implementation that is on stage represent the req that I verify against and file a follow up bug for bits that differ from comment 3? What is currently on stage doesn't match the req in comment 2 or comment 3.
Flags: needinfo?(williamr)
(In reply to Matt Brandt [:mbrandt] from comment #11)
> Would you prefer the current implementation that is on stage represent the
> req that I verify against and file a follow up bug for bits that differ from
> comment 3? What is currently on stage doesn't match the req in comment 2 or
> comment 3.

Yes please. Thanks!
Flags: needinfo?(williamr)
Created attachment 806183 [details]
qa - verified on stage

QA verified on stage - multiple accounts can be added to a users profile. When the account information is correct the urls in the profile work. Multiples of the same account can be added (example; 2 bugzilla account, 13 mdn accounts, etc)

Note there is no validation that is occurring for account details/valid urls. A follow up bug has been filed to cover this need.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.