Commit Graph

178 Commits

Author SHA1 Message Date
Stu Young
5107aa41e9 DENG-803: add traits to segment context for enrollment activated events (#26842)
add traits to segment context for enrollment activated events
2021-03-16 14:28:22 -04:00
Jawayria
e4cff58bed BOM-2351: Removed unused imports from common/djangoapps/{track, util} 2021-02-23 19:31:57 +05:00
M. Zulqarnain
42fc6aef03 Upgrade django-ipware (#24827) 2021-02-23 18:14:17 +05:00
Aarif
a1406cddf2 replaced unittest assertions pytest assertions (#26528) 2021-02-18 18:09:45 +05:00
Jawayria
dd99f8e02d Resolved quality errors 2021-02-03 17:05:12 +05:00
Jawayria
6be60b2fcc Resolved quality failures 2021-02-03 13:13:00 +05:00
Jawayria
62bc555817 Applied pylint-amnesty to track 2021-02-03 13:10:42 +05:00
Tim McCormack
e0e03dec5f Use more appropriate hash when making tracking ID; document SECRET_KEY use (#26134)
- Make it easier to rotate `SECRET_KEY` by documenting this usage
  for both sensitivity and rotation process. (ARCHBOM-1676).
- Just use a hash of the secret rather than HMAC + MD5. We're not
  authenticating a message, so HMAC isn't really needed -- it just needs
  to be unique, deterministic, and irreversible. SHAKE allows generation
  of an arbitrary length hash without needing to truncate.

Also, rename tracking session ID generator for clarity -- there's no
encryption happening here.

Add additional test for existing claim of uniqueness.
2021-01-27 14:13:42 +00:00
Robert Raposa
186f5fbce2 track: catch unhandled exceptions and add monitoring
Add the following monitoring custom attributes:
- segment_event_name
- segment_event_source
- segment_unexpected_context
- segment_unexpected_data

Also, this explicitly raises a validation error whenever context is a
string instead of throwing a vague TypeError.

Related to LEARNER-8034
2020-11-18 21:45:00 -05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
brianhw
89169443ad Handle more kinds of bad data in segment events. (#25506) 2020-11-03 15:04:05 -05:00
stvn
5eaa532046 Fix segment_context key error
This is one of the frequent TNL errors.
2020-07-20 17:26:38 -07:00
Aarif
9e34cb3df9 Removed deprecated future imports (#24295) 2020-06-28 23:40:03 +05:00
Danial Malik
c962423bbc Replace track calls with eventtracking in task_track and server_track (#24282)
* Replace track calls with eventtracking in task_track and server_track

* Making  events compatible with events emitted via track app

* Fixed broken tests and quality violation

* Removed useless changes in shim. using  in  to have  and  keys in event context

Co-authored-by: zia.fazal@arbisoft.com <zia.fazal@arbisoft.com>
2020-06-26 13:49:16 -04:00
Aarif
27480cdd2f Removed deprecated future imports 2020-06-23 18:51:43 +05:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
Luis Moreno
ae0c051e9e Use authsource instead of auth_source for compatibilities with pymongo 2020-03-02 13:31:07 -05:00
Diana Huang
67ecee91e4 Drop tracking log table. 2020-02-11 09:34:26 -05:00
Diana Huang
1f45181c14 Remove ENABLE_SQL_TRACKING_LOGS and all associated code. 2020-02-05 14:42:33 -05:00
Diana Huang
742868c2da Remove the tracking django backend and the TrackingLog tables. 2020-02-04 14:24:56 -05:00
Aarif
97d327feeb BOM-1121
Old style mixin compatibility with django2.2
2020-01-30 16:36:02 +05:00
Feanil Patel
046feb0cf0 Merge pull request #22649 from edx/feanil/fix_pep8
Fix all E303 pep8 errors.
2019-12-30 13:32:26 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
2df8b8226b Merge pull request #22643 from edx/feanil/2to3_asserts
Run `2to3 -f asserts . -w` on edx-platform.
2019-12-30 12:13:42 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Feanil Patel
70294b0ad2 Run 2to3 -f asserts . -w on edx-platform.
https://docs.python.org/3.5/library/2to3.html#2to3fixer-asserts
2019-12-30 10:22:19 -05:00
Manjinder Singh
a40f1d9bd6 BOM-933: Fix type mismatches in various migrations 2 (#22115)
* Fix type mismatches in track migrations

* Fix type mismatches in oauth_dispatch

* Fix type mismatches in badges migrations

* fix type mismatch in contentserver migrations

* Fix type mismatches in mobile_api migrations

* fix type mismatch in crawlers migrations

* fix type mismatch in dark_lang migrations

* fix type mismatch in branding  migrations
2019-10-23 13:04:36 -04:00
Ayub
846a12939e Merge pull request #21735 from edx/BOM-update_str_method
BOM Project __unicode__ to __str__
2019-09-26 10:47:14 +05:00
Braden MacDonald
8a2d499dd2 Track grades for Blockstore content, emit tracking logs 2019-09-25 10:42:55 -04:00
Ayub khan
5c47a3b425 BOM Project
Updated __unicode__ to __str__
2019-09-25 18:31:54 +05:00
Jeremy Bowman
42cfb3ec8f Fix last common/djangoapps/track test 2019-09-18 12:08:36 -04:00
Jeremy Bowman
6f18383142 Fix bytes/string handling in tracking middleware 2019-09-18 11:59:24 -04:00
Nimisha Asthagiri
d564af8301 Fix for decode errors in bulk_email.tests.test_course_optout.py 2019-08-19 14:26:48 -04:00
aarif
61800c619f replaced StringIO imports with import from six
replaced cStringIO and StringIO imports with import from six

fixed StringIO imports

fixed StringIO imports

fixed XSS python-wrap warning
2019-08-08 00:09:16 +05:00
uzairr
80316c632d Update Help msgs of management commands
PROD-399
2019-08-02 15:20:26 +05:00
Kshitij Sobti
61bb9bc6e2 Add support for using an authentication database for MongoDB.
A popular convention is to have user accounts stored in a separate authentication
database. This change add support for configuring edx-platform to work with
such a setup.
2019-07-24 01:16:33 +05:30
Amit
40068aecb5 INCR-232: Run python-modernize and isort on common/djangoapps/track (#20513) 2019-05-10 12:05:31 -04:00
Anthony Wee
3dcdf96faf INCR-123: Run python-modernize on common/djangoapps/track/backends (#20444)
* anthonywee/INCR-123

* isort
2019-05-07 15:16:42 -04:00
Anthony Wee
a0bb7e572d INCR-125: Run python-modernize on common/djangoapps/track/views and migrations (#20425)
* INCR-125: Run python-modernize on common/djangoapps/track/views and migrations

* isort
2019-05-07 14:26:57 -04:00
Anthony Wee
b095ce15c8 INCR-124: Run python-modernize on common/djangoapps/track/tests (#20445)
* INCR-124: Run python-modernize on common/djangoapps/track/tests

* isort
2019-05-07 14:05:38 -04:00
Evans Dianga
0063c6f3e7 INCR-122 Modernize track/management. (#20433)
* Modernize track/management incr122. Change Author to myself

* Ran isort on common/djangoapps/track/management
2019-05-07 09:33:20 -04:00
David Ormsbee
cf42c67e52 Initial README for Track app 2019-04-25 13:53:55 -04:00
Robert Raposa
e8d60611de Add user_id for username in event data.
In certain use cases, a caller may have the username and not the
user_id. In these cases, we add the user_id since events have
standardized on using the user_id as the unique id of a user.

ARCH-472
2019-03-06 17:06:53 -05:00
Jeremy Bowman
974ae50bf4 Merge pull request #19620 from cclauss/new-style-exceptions
Old style exceptions --> new style for Python 3
2019-02-19 16:31:35 -05:00
Julia Eskew
368f221f0a Initial start on annotations. 2019-02-19 11:24:21 -05:00
cclauss
c0c935b685 Old style exceptions --> new style for Python 3 2019-02-19 13:09:23 +01:00
Michael Youngstrom
4bbd1dee0b Remove shards from commonlib-unit tests 2019-02-12 14:28:35 -05:00
Diana Huang
6572d99e76 Remove all references to datadog from our code. 2019-01-08 15:41:24 -05:00
Awais Jibran
fda85ddcf5 Merge pull request #19418 from edx/aj/fix-segmentio-event
Handle string datetime with datetime parser.
2018-12-12 12:08:08 +05:00
Awais Jibran
ddd69db7cf Handle string datetime with datetime parser. 2018-12-11 13:24:10 -05:00