[ckan-changes] [okfn/ckan] 6b187f: Initial implementation of activity streams model

noreply at github.com noreply at github.com
Mon Dec 12 16:57:22 UTC 2011


  Branch: refs/heads/feature-1515-activity-streams
  Home:   https://github.com/okfn/ckan

  Commit: 6b187f2617a03f4db87e17571c5f9dd33e9ab64e
      https://github.com/okfn/ckan/commit/6b187f2617a03f4db87e17571c5f9dd33e9ab64e
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-17 (Thu, 17 Nov 2011)

  Changed paths:
    A ckan/lib/activity.py
  A ckan/model/activity.py
  M ckan/model/meta.py
  M ckan/model/package.py
  M ckan/model/resource.py
  A ckan/tests/models/test_activity.py

  Log Message:
  -----------
  Initial implementation of activity streams model

New module ckan/tests/models/test_activity.py:
Model-level tests for the new activity streams feature. These tests
access the model directly and make changes to it, then again access the
model directly to test that the right activity stream items and details
were emitted. These tests are not complete yet.

New module ckan/model/activity.py:
Defines two new database tables: the activity table contains the
top-level activity stream items and the activity_detail table contains
related second-level detail items (each activity row has 0 or more
related activity detail rows). Defines SQLAlchemy mapper classes for the
new tables.

New module ckan/lib/activity.py:
Contains DatasetActivitySessionExtension, an SQLAlchemy SessionExtension
that listens for new, changed or deleted Package objects (defined as
objects that implement a activity_stream_item() method) and objects
with related packages (defined as objects that implement a
related_packages() method) and writes rows to the activity and
activity_detail tables for these events.

ckan/model/meta.py:
Import DatasetActivityExtension, add it to SQLAlchemy session
extensions.

ckan/model/package.py:
Add activity_stream_item() and activity_stream_detail() methods
used by DatasetActivitySessionExtension.

ckan/model/resource.py:
Add activity_stream_detail() method used by
DatasetActivitySessionExtension.


  Commit: 90e4ac0886a16e5f45eb200ee9112a1fd91856d8
      https://github.com/okfn/ckan/commit/90e4ac0886a16e5f45eb200ee9112a1fd91856d8
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-22 (Tue, 22 Nov 2011)

  Changed paths:
    M ckan/config/routing.py
  M ckan/controllers/package.py
  M ckan/lib/helpers.py
  A ckan/migration/versions/045_user_name_unique.py
  M ckan/model/meta.py
  M ckan/model/resource.py
  M ckan/model/types.py
  M ckan/public/css/style.css
  M ckan/templates/layout_base.html
  M ckan/templates/package/read_core.html
  A ckan/templates/package/resource_read.html
  M ckan/templates/package/search_form.html
  M ckan/tests/functional/test_admin.py
  M ckan/tests/functional/test_home.py
  M ckan/tests/functional/test_search.py
  M ckan/tests/lib/test_navl.py
  M ckan/tests/test_authz.py
  M ckan/tests/test_wsgi_ckanclient.py
  M doc/extensions.rst
  M doc/theming.rst

  Log Message:
  -----------
  Merge branch 'master' into feature-1298-activities-table


  Commit: f09a83236c5a0709ff2cc811990e1fca7aa8a92d
      https://github.com/okfn/ckan/commit/f09a83236c5a0709ff2cc811990e1fca7aa8a92d
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-22 (Tue, 22 Nov 2011)

  Changed paths:
    M ckan/model/package.py
  M ckan/tests/models/test_activity.py

  Log Message:
  -----------
  Use IP address in activity stream if not logged in

Use the user's IP address or "Unknown IP Address" in the user_id column
of the activity table when the user is not logged in (and therefore has
no real user_id for us to use).


  Commit: c286457dde151b5f139663f7b9819357454be7ac
      https://github.com/okfn/ckan/commit/c286457dde151b5f139663f7b9819357454be7ac
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-22 (Tue, 22 Nov 2011)

  Changed paths:
    M ckan/model/package.py
  M ckan/tests/models/test_activity.py

  Log Message:
  -----------
  Add activity details for new and deleted packages


  Commit: 45606e39a0ee129d06c040d86ca265287577383c
      https://github.com/okfn/ckan/commit/45606e39a0ee129d06c040d86ca265287577383c
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-23 (Wed, 23 Nov 2011)

  Changed paths:
    M ckan/lib/activity.py

  Log Message:
  -----------
  Don't call activity_stream_item more than once


  Commit: b452823d724dbc20d6cfb5a01c5c994e0e8e600d
      https://github.com/okfn/ckan/commit/b452823d724dbc20d6cfb5a01c5c994e0e8e600d
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-23 (Wed, 23 Nov 2011)

  Changed paths:
    M ckan/lib/activity.py

  Log Message:
  -----------
  Delete some whitespace


  Commit: 92b2ef2fa52efb8763716c08b7ac4ad0f6f67727
      https://github.com/okfn/ckan/commit/92b2ef2fa52efb8763716c08b7ac4ad0f6f67727
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-23 (Wed, 23 Nov 2011)

  Changed paths:
    M ckan/lib/activity.py

  Log Message:
  -----------
  Add a debug message


  Commit: d87b79f950f2903049260650200aba6d9e78a16c
      https://github.com/okfn/ckan/commit/d87b79f950f2903049260650200aba6d9e78a16c
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-23 (Wed, 23 Nov 2011)

  Changed paths:
    M ckan/model/package.py

  Log Message:
  -----------
  Handle unavailable pylons context and request

Catch TypeError when trying to access Pylons context or request when
creating an activity stream item, fall back on default values


  Commit: be8a7c07c7b8aa00d2afa38978979d70dcdd75c7
      https://github.com/okfn/ckan/commit/be8a7c07c7b8aa00d2afa38978979d70dcdd75c7
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-23 (Wed, 23 Nov 2011)

  Changed paths:
    M ckan/tests/models/test_activity.py

  Log Message:
  -----------
  Use logic functions in test_activity.py

Make the activity streams unit tests go through the ckan.logic module
for creating, updating and deleting packages, instead of accessing the
model directly. Much more to be done on this test module


  Commit: 38f4fad7361550336474e05b47859e4a7e28a211
      https://github.com/okfn/ckan/commit/38f4fad7361550336474e05b47859e4a7e28a211
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-23 (Wed, 23 Nov 2011)

  Changed paths:
    M .gitignore
  M ckan/config/routing.py
  M ckan/controllers/api.py
  M ckan/controllers/package.py
  M ckan/forms/common.py
  M ckan/forms/package.py
  M ckan/forms/package_dict.py
  M ckan/lib/create_test_data.py
  M ckan/lib/munge.py
  M ckan/lib/navl/dictization_functions.py
  M ckan/lib/search/query.py
  M ckan/logic/action/get.py
  M ckan/logic/schema.py
  M ckan/logic/validators.py
  M ckan/misc.py
  A ckan/model/misc.py
  M ckan/model/package.py
  M ckan/model/tag.py
  M ckan/public/scripts/application.js
  M ckan/templates/group/new_group_form.html
  M ckan/templates/package/new_package_form.html
  M ckan/tests/__init__.py
  M ckan/tests/forms/test_package.py
  M ckan/tests/functional/api/base.py
  M ckan/tests/functional/api/model/test_package.py
  M ckan/tests/functional/api/model/test_tag.py
  M ckan/tests/functional/api/test_action.py
  R ckan/tests/functional/api/test_ajax.py
  M ckan/tests/functional/api/test_misc.py
  M ckan/tests/functional/api/test_package_search.py
  M ckan/tests/functional/api/test_resource_search.py
  A ckan/tests/functional/api/test_util.py
  M ckan/tests/functional/test_package.py
  M ckan/tests/functional/test_tag.py
  M ckan/tests/lib/test_dictization.py
  M ckan/tests/lib/test_dictization_schema.py
  M ckan/tests/lib/test_munge.py
  M ckan/tests/lib/test_solr_package_search.py
  M ckan/tests/lib/test_tag_search.py
  M ckan/tests/misc/test_format_text.py
  M ckan/tests/models/test_misc.py
  M ckan/tests/models/test_package.py
  M ckan/tests/pylons_controller.py
  A ckan/tests/schema/__init__.py
  A ckan/tests/schema/test_schema.py
  M ckan/tests/test_dumper.py
  M doc/api.rst

  Log Message:
  -----------
  Merge branch 'master' of https://github.com/okfn/ckan into feature-1298-activities-table


  Commit: f131ace9fc3d48598d4e0ffc71f4a2b1900ca227
      https://github.com/okfn/ckan/commit/f131ace9fc3d48598d4e0ffc71f4a2b1900ca227
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-23 (Wed, 23 Nov 2011)

  Changed paths:
    M ckan/lib/dictization/model_save.py

  Log Message:
  -----------
  Obey "allow_partial_update" in package_resource_list_save

Fixes #1486


  Commit: 6eaaf7f8ca4740ecc767541dacffafd224d3f219
      https://github.com/okfn/ckan/commit/6eaaf7f8ca4740ecc767541dacffafd224d3f219
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-23 (Wed, 23 Nov 2011)

  Changed paths:
    M ckan/lib/activity.py

  Log Message:
  -----------
  Correct a typo in a comment


  Commit: e8604013e2a2863be3cb019c7a597db8decf9af2
      https://github.com/okfn/ckan/commit/e8604013e2a2863be3cb019c7a597db8decf9af2
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-23 (Wed, 23 Nov 2011)

  Changed paths:
    M ckan/lib/activity.py
  M ckan/tests/models/test_activity.py

  Log Message:
  -----------
  Test creating package with resources and tags

ckan/tests/models/test_activity.py: When testing activity streams for
new packages use a package with some resources and tags.

ckan/lib/activity.py: Process new packages first to prevent them from
being logged as changed packages instead.


  Commit: a55d47dcede3426deaa5623d91676df7dadc9e7c
      https://github.com/okfn/ckan/commit/a55d47dcede3426deaa5623d91676df7dadc9e7c
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-23 (Wed, 23 Nov 2011)

  Changed paths:
    M ckan/lib/dictization/model_save.py

  Log Message:
  -----------
  Merge branch 'defect-1486' into feature-1298-activities-table


  Commit: 125620eea8a082893472fcdb9010c2fc9eb87852
      https://github.com/okfn/ckan/commit/125620eea8a082893472fcdb9010c2fc9eb87852
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-24 (Thu, 24 Nov 2011)

  Changed paths:
    M ckan/lib/activity.py

  Log Message:
  -----------
  Fix handling of updated packages

Fixes a bug introduced by commit e860401 that was causing
test_update_package() to fail sometimes.


  Commit: f97eee0d9c1a7642f0f89abe7353af969ea5c0ab
      https://github.com/okfn/ckan/commit/f97eee0d9c1a7642f0f89abe7353af969ea5c0ab
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-24 (Thu, 24 Nov 2011)

  Changed paths:
    M ckan/tests/models/test_activity.py

  Log Message:
  -----------
  Add test_resource_update


  Commit: ca6d7b935d71d8c1b20fd07bd94ffb3cc341229c
      https://github.com/okfn/ckan/commit/ca6d7b935d71d8c1b20fd07bd94ffb3cc341229c
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-24 (Thu, 24 Nov 2011)

  Changed paths:
    M ckan/lib/activity.py
  M ckan/tests/models/test_activity.py

  Log Message:
  -----------
  Implement delete resources test case.

ckan/tests/models/test_activity.py:
Implement test_delete_resource test case.

ckan/lib/activity.py:
Add some debug messages.


  Commit: 463c4defac45bd4fffa4a8c9252d73b62b75fead
      https://github.com/okfn/ckan/commit/463c4defac45bd4fffa4a8c9252d73b62b75fead
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-11-24 (Thu, 24 Nov 2011)

  Changed paths:
    M ckan/tests/models/test_activity.py

  Log Message:
  -----------
  Add test_add_resources test case.

ckan/tests/models/test_activity.py:

Remove the test_create_resource test case, it was failing because
ckan.logic.action.create:resource_create() is not implemented yet.

Replace it with a test_add_resources test case, which tests adding new
resources to existing packages via
ckan.logic.action.update:package_update().


  Commit: c41855f561923bad681e03da983fc8c769f41838
      https://github.com/okfn/ckan/commit/c41855f561923bad681e03da983fc8c769f41838
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-12-05 (Mon, 05 Dec 2011)

  Changed paths:
    A ckan/lib/activity.py
  M ckan/lib/dictization/model_save.py
  A ckan/model/activity.py
  M ckan/model/meta.py
  M ckan/model/package.py
  M ckan/model/resource.py
  A ckan/tests/models/test_activity.py

  Log Message:
  -----------
  Merge branch 'feature-1298-activities-table' into feature-1515-activity-streams


  Commit: 6cfb8b4eed1500369fd2a388f1a8c0131cba824f
      https://github.com/okfn/ckan/commit/6cfb8b4eed1500369fd2a388f1a8c0131cba824f
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2011-12-12 (Mon, 12 Dec 2011)

  Changed paths:
    M ckan/lib/activity.py
  M ckan/model/package.py
  M ckan/tests/models/test_activity.py

  Log Message:
  -----------
  Get user ID for activity streams from revision

When creating Activity objects for activity streams, get the user_id
from the revision, not from the pylons context. It's not good to access
the global pylons context from the model module, e.g. because when unit
tests do things through the logic module directly (instead of through
API calls) then the pylons context will not be present.

Also change activity_test.py, can now test for correct user IDs.


Compare: https://github.com/okfn/ckan/compare/6b187f2^...6cfb8b4




More information about the ckan-changes mailing list