Ensure .accomplishments is pre-loaded with common accomplishment set paths, including packaging location

Bug #977362 reported by Jono Bacon
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu Accomplishments Daemon
Fix Released
Critical
Jono Bacon

Bug Description

Today the config file for the daemon assumes accomplishments are in ~/accomplishments, but as we move to packages we should set this to /usr/share/accomplishments. We should allow multiple directories seperate by a ':' but the first one is loaded as the main set.

Revision history for this message
Rafał Cieślak (rafalcieslak256) wrote :

1) What will be the default set of accomplishments? For sure, there have to be ~/accomplishments and /usr/share/accomplishments, probably also /usr/share/local/accomplishments - anything else, and if yes - then in what order?

2) How do we determine which path to use? Or shall we use all, and load accomplishment sets from all locations in these places? (it may happen that "ubuntu-community" is installed in /usr/share/accomplishments, and "ubuntu-italiano" is in ~/accomplishments, shall we use both these sets then? What if there are different versions of the same set in different directories?) If not, how do we determine which to use - is checking for non-emptiness enough?

Revision history for this message
Jono Bacon (jonobacon) wrote : Re: [Bug 977362] Re: Ensure .accomplishments is pre-loaded with common accomplishment set paths, including packaging location

On 14 April 2012 12:00, Rafal Cieślak <email address hidden> wrote:
> 1) What will be the default set of accomplishments? For sure, there have
> to be ~/accomplishments and /usr/share/accomplishments, probably also
> /usr/share/local/accomplishments - anything else, and if yes - then in
> what order?

My hunch is that we do this:

/usr/share/acomplishments:/usr/share/local/accomplishments and then we
allow our users to specify a dir in their home dir if desired (likely
on hackers will need this).

> 2) How do we determine which path to use? Or shall we use all, and load
> accomplishment sets from all locations in these places? (it may happen
> that "ubuntu-community" is installed in /usr/share/accomplishments, and
> "ubuntu-italiano" is in ~/accomplishments, shall we use both these sets
> then? What if there are different versions of the same set in different
> directories?) If not, how do we determine which to use - is checking for
> non-emptiness enough?

My hunch is that we can all paths in order and use the sets in that
priority order. As an example if ubuntu-community is in /usr/share and
/usr/share/local, only the the set in /usr/share will be used. Make
sense?

   Jono

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

Jono Bacon (jonobacon)
Changed in ubuntu-accomplishments-daemon:
status: Confirmed → Incomplete
Revision history for this message
Rafał Cieślak (rafalcieslak256) wrote :

I am surprised that /usr/local has lower priority than /usr, I've always thought that the convention is to use just the opposite order, but I guess that does not matter much, so it shouldn't be a problem.

Few important conclusions about proposed solution:
 - For each accomplishments set available we will need to remember it's path. That path would be used instead of accomplishments_path every time the API wants to access accomplishment's files.
 - We should assume these paths will not change while the daemon is running. Otherwise we would need rechecking their location every API call, which feels wrong, and consumes time&resources. This means the set's location detection may be done just once, when the daemon starts, and the paths would be remembered for later use.

Revision history for this message
Jono Bacon (jonobacon) wrote :

To be honest, I am not sure what the priority order would be, I just assumed /usr/share as that is where the current ubuntu-community-accomplishments PPA package is installing to. :-)

In terms of your points, I agree that we might need to now include the specific location of the accomplishments path for completely.

As for the accomplishments sets changing while the daemon is running, we should probably figure out a way to re-scan every so often (possibly at the beginning of each new scripts run which is every 15 mins). We will need to solve this problem as the user will likely have the daemon running full time in a typical use case.

Changed in ubuntu-accomplishments-daemon:
status: Incomplete → Confirmed
Jono Bacon (jonobacon)
Changed in ubuntu-accomplishments-daemon:
importance: High → Critical
Revision history for this message
Jono Bacon (jonobacon) wrote :

Rafal, my inclination for this for 0.1 is that we only allow a single path to be set in the user's configuration file. Right now I recommend we default to where the packages install the files /usr/share/accomplishments - this will help satisfy the need to deliver a working 0.1. Supporting additional paths seems more of a feature in my mind.

I am going to keep this bug open to ensure that we change the code to set it to /usr/share/accomplishments in a default installation - we can also provide documentation on https://wiki.ubuntu.com/Accomplishments/Installing for how to set this to another path for custom/developer installations.

Revision history for this message
Rafał Cieślak (rafalcieslak256) wrote :

In my opinion, this is a good temporary fix for this bug, it will
satisfy our needs in full, and will indeed allow us to consider
multiple paths as an additional feature.

2012/4/24, Jono Bacon <email address hidden>:
> Rafal, my inclination for this for 0.1 is that we only allow a single
> path to be set in the user's configuration file. Right now I recommend
> we default to where the packages install the files
> /usr/share/accomplishments - this will help satisfy the need to deliver
> a working 0.1. Supporting additional paths seems more of a feature in my
> mind.
>
> I am going to keep this bug open to ensure that we change the code to
> set it to /usr/share/accomplishments in a default installation - we can
> also provide documentation on
> https://wiki.ubuntu.com/Accomplishments/Installing for how to set this
> to another path for custom/developer installations.
>
> --
> You received this bug notification because you are a member of Ubuntu
> Accomplishments System Drivers, which is subscribed to Ubuntu
> Accomplishments Daemon.
> https://bugs.launchpad.net/bugs/977362
>
> Title:
> Ensure .accomplishments is pre-loaded with common accomplishment set
> paths, including packaging location
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu-accomplishments-daemon/+bug/977362/+subscriptions
>

Jono Bacon (jonobacon)
Changed in ubuntu-accomplishments-daemon:
assignee: nobody → Jono Bacon (jonobacon)
status: Confirmed → Fix Committed
Jono Bacon (jonobacon)
Changed in ubuntu-accomplishments-daemon:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.