← Back to team overview

ubuntu-accomplishments-contributors team mailing list archive

Re: An idea concerning testing credentials for validity

 

On 14 April 2012 13:06, Rafał Cieślak <rafalcieslak256@xxxxxxxxx> wrote:
> Hello everyone!
>
> I've been recently thinking about two bugs in the Accomplishments
> Viever, but I believe they are affecting the whole project. I've come
> up with quite a complex idea that needs to be discussed, so I decided
> to post to the list instead of commenting on them.
>
>
> These bugs are:
>   #951224 "no warning when enter wrong email address"
>   #974558 "No validity checking on extra information"
>
> They both relate to the problem that emerges when the user
> accidentally enters invalid credentials when asked. It is very hard to
> recognise that they are wrong, as the symptoms are just as if the user
> never accomplished anything.

Thanks for the detailed post, Rafal.

I agree that this is an important hurdle for us to solve, and some
kind of automated validation is really needed.

> In particular, the first's bug's reporter complains "If you enter
> wrong email, it just keeps checking, so it took me while to figure out
> that I changed my LP email to different one."
>
> And there is quite a problem with this bug. Actually, the scripts will
> never know that the user have entered a wrong e-mail, because the
> result will be just the same as if he did not register on launchpad.
> For example the 'registered-on-launchpad' script simply checks if a
> person with given e-mail has an account, otherwise returns 1 - "not
> accomplished".
> In this case it is impossible to determine whether provided
> credentials are not valid, or just the user has not yet registered.
>
> On the other hand, if the user provides the launchpad-email, then it
> means that he has already registered. This means the
> registered-on-launchpad accomplishment is pointless, because how can
> one enter his launchpad-email without being registered on it? If we
> got rid of that particular accomplishment, then validity check would
> make more sense, as we might warn that scripts were unable to get your
> data, as there is no user on launchpad with given credentials.
> This may however turn into a dead-end, and is no really a solution.
> Most importantly it would enforce accomplishment sets developers to
> somehow define whether they need some particular extra-information, or
> is it optional (in case of ubuntu-community set some accomplishments
> are achievable *without* a LP account). We would have then to assume
> that the data user has entered is correct, and this does not give us
> much possibilities to verify it.

To be clear about registered-on-launchpad, there are a few reasons for
this one even though, as you say, it might seem a little redundant:

 * Firstly, it means that everyone who uses Ubuntu Accomplishments
gets at least one trophy. They see the bubble pop up and feel good
about it. This is a nice warm welcome to the system.
 * Secondly, many new users to Ubuntu and the community won't know
what Launchpad is or have a Launchpad account, so they can at least
browse the information in the accomplishment to find out how to get it
(we may even want to provide a button in EditNeedsInformation to
"Register" which takes them to the registration page for whatever
information is needed).
 * Thirdly, some accomplishments require registered-on-launchpad, and
those will be marked as locked if you don't have an account.

<snip>

> My proposal is to provide a python script for each extra-information
> entry. These scripts would be included in
> ubuntu-accomplishments-extra-information, and would be responsible for
> checking credentials. Things they might test include correct
> formatting, matching some regular expression (in case it's e-mail
> adress), checking whether such user exist (in case of launchpad user
> data), and whatever else is needed to ensure that this data is
> correct. Ideally, they would provide a textual explanation why is this
> data incorrect, just to improve user experience. Of course such
> scripts are optional, extra-information fields without a related
> script would be treated as correct by default and not checked for
> validity.
>
> Advantages?
>  - Accomplishments developers would be safe to assume that the
> provided extra-information is correct.
>  - Such script would be run only once - when the user types in the
> data - and it's code is not duplicated in accomplishment scripts.
>  - The user would be immidiatelly informed about it's correctness,
> which is very friendly. The GUI might display a red error icon next to
> invalid data, or anything else.
>  - Unlike suggestions about using rules or regular expressions, this
> approach is limitlessly extendible.
>  - This approach clearly defines what exactly a particlular
> extra-information entry is, and what format etc. the data passed to
> script uses - handy for accomplishment developers, clean in
> maintenance.

I think the idea of using a script to verify data is useful, but if
possible I would like to not require it be a Python script. The reason
is that the Ubuntu Accomplishments system was specifically designed so
you can write accomplishments in any language that can talk to DBUS
(we just make it a little easier for Python developers by providing
the 'accomplishments' Python module).

As such, I wonder if we can achieve this without using Python
specifically. Couldn't we just specify a regular expression that must
be matched to accept the data in the correct form. This way for each
needs-information file we just have validation_regex or something that
specifies the formatting required.

Would that work?

   Jono

-- 
Jono Bacon
Ubuntu Community Manager
www.ubuntu.com / www.jonobacon.org
www.identi.ca/jonobacon www.twitter.com/jonobacon


Follow ups

References