maiera / gde-app

Apache License 2.0
22 stars 9 forks source link

refactor update architecture to "plug in" #147

Closed patt0 closed 9 years ago

patt0 commented 9 years ago
  1. Expresses an architecture to gather new posts and update them using app engine tasks, which are scheduled using cron jobs. This same approach will be used to write data gathering plugins so we can collect impact metrics automatically. I intend to get one ready that pulls view data from blogger in time for the presentation at the GDE summit so we may invite many GDE's to write data gathering plugins (I use the word plugin loosely).
  2. /tasks/new_gplpus is run daily and as the previous cron job gets new activities, this time for one gde at the time.

The implementation is different in that we only merge AP is they are actual shares from another post, if they are not we will create a new AR and leave it to the GDE to decide how and why he merges AR's and their associated AP's. In order to do this, I process the new activities from oldest to newest.

  1. /tasks/upd_gplus is run weekly and updates existing activities, similarly as above for one gde at the time.

The implementation is pretty much the same as previously. In particular we continue to ignore the fact that a #gde tag is removed from a gplus post, we consider currently that it has to be deleted in the front end, to be discussed at the summit.

  1. ActivityRecord -> find_or_create as a function, is really the responsibility of the Business Logic (ie. the task plugin architecture) so I am moving it out of ActivityPost Endpoints class and attaching it to update_gplus Module in the name find_or_create_ar.
  2. The API_KEY to access the GPLUS service is now obtained from secrets.json and the keys have been regenerated, so they are not what they where it the source code tree anymore.
  3. The insert ActivityPost endpoint has been removed.

@Scarygami thanks for having a good look at this :)

Scarygami commented 9 years ago

Except for the two minor non-critical inline-comments I made this looks great! :+1:

Thanks!

patt0 commented 9 years ago

https://github.com/maiera/gde-app/issues/54 can be closed

Scarygami commented 9 years ago

Sounds/looks good to me, feel free to merge and close whenever you deploy this into production :)

patt0 commented 9 years ago

Disabling writes, taking a backup and uploading the code, reenable writes -> All Done