Commit Graph

537 Commits

Author SHA1 Message Date
Muhammad Soban Javed
bd601cf3a6 Update celery routing for celery 4+ (#25567)
* Update celery routing

- Used routing function instead of class
- Move task queues dictionary to Django settings
- Removed routing_key parameter
- Refactored routing for singleton celery instantiation

Co-authored-by: Awais Qureshi <awais.qureshi@arbisoft.com>
2020-12-16 13:40:47 +05:00
Dillon Dumesnil
d58a080236 Merge pull request #25865 from edx/ddumesnil/aa-260
AA-260/AA-500: Improvements to in course shift deadlines
2020-12-14 12:25:23 -08:00
Dillon Dumesnil
3c1de16eba AA-260/AA-500: Improvements to in course shift deadlines
As part of AA-500, we added a completeness check to showing the
banner since we didn't before. As part of AA-260, we now take into
account if a learner has more attempts left on a problem (regardless
of completeness) and allow them to shift their dates to try again.
2020-12-14 19:05:30 +00:00
Tim McCormack
0c57a02119 Enforce a Celery singleton across cms and lms by using shared module (#25840)
This should prevent the issues we've seen recently where cms modules are
imported by the running lms process, resulting in two celery instances
being created and tasks intermittently being registered to the wrong
instance (and therefore effectively lost.)

In commit ab6bf348d4/PR #25822 we tried to ensure that only one or the
other of the instances was created by adding a startup check.
Unfortunately, there's an external shared library that refers directly
to the lms celery, causing a startup failure in cms, so we had to revert
it. Rather than waiting to fix that library, this commit collapses
the two instances together so that there is only ever one.
2020-12-10 17:54:31 +00:00
Régis Behmo
a16cd71046 Start waffle namespace deprecation
By explicitly importing the legacy namespace classes, we make it clear
that we are using soon-to-be-deprecated classes. We will then be able to
start removing the legacy classes, one module at a time.
2020-12-03 16:06:14 +01:00
Awais Qureshi
7201edb11d Revert "Update routing config" (#25536)" (#25549)" (#25553)" (#25561)
This reverts commit db4c3b1210.
2020-11-11 00:13:47 +05:00
Awais Qureshi
db4c3b1210 Revert "Revert ""Update routing config" (#25536)" (#25549)" (#25553)
This reverts commit c1fe3c3a93.
2020-11-10 23:23:09 +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
Muhammad Soban Javed
c1fe3c3a93 Revert ""Update routing config" (#25536)" (#25549)
This reverts commit 39a22734c1.
2020-11-09 23:43:47 +05:00
Awais Qureshi
39a22734c1 "Update routing config" (#25536)
* Revert "Revert "Update routing config"

* Removed settings from lms/celery.py and cms/celery.py

* Moved settings import from top-level to function's scopes

Co-authored-by: Soban Javed <iamsobanjaved@gmail.com>
2020-11-09 19:06:55 +05:00
Muhammad Soban Javed
5a2ea1f954 Revert "Update routing config" 2020-11-06 02:05:48 +05:00
Muhammad Soban Javed
bfa8f71f33 Update routing config #25419 2020-11-06 01:00:29 +05:00
Régis Behmo
4586002956 Import waffle classes from edx_toggles instead of waffle_utils
Those classes were ported to edx_toggles. The imports remain in
waffle_utils.__init__ for backward compatibility.
2020-11-03 19:25:37 +01:00
Mike OConnell
dbf6ef22df Using logging filters from edx-django-utils (#25492)
The UserIdFilter and RemoteIpFilter logging filter classes
were moved from edx-platform to edx-django-utils for more
distributed use. This updated removes those classes from
edx-platform, and references their counterparts in
edx-django-utils.

ENT-3494
2020-11-02 21:40:59 -05:00
Soban Javed
3206d9cb9a Update celery routing
- Used routing function istead of class
- Move task queues to Djano settings
- Removed routing_key parameter
2020-11-02 15:03:53 +05:00
Tim McCormack
5b331b2d4d Merge branch 'master' into timmc/misc-metric-attribute
# Conflicts:
#	cms/envs/common.py
#	lms/envs/common.py
2020-09-28 13:56:08 +00:00
Tim McCormack
f29e418264 Revert "Revert "ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)" (#25025)" (#25055)
This reverts commit 986a448d9e.
2020-09-28 13:53:57 +00:00
Tim McCormack
92135ad567 Avoid direct use of newrelic (while we're in there) 2020-09-22 23:25:50 +00:00
Tim McCormack
0f33afc20a Fix my weird typo 2020-09-22 22:59:28 +00:00
Ahtisham Shahid
986a448d9e Revert "ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)" (#25025)
This reverts commit ba9ee4e151.

Fixed Style lint issue
2020-09-21 13:48:00 +05:00
Sid Verma
78045115ab Add filtering and search support to library APIs 2020-09-18 10:25:59 -04:00
Tim McCormack
328e790e8a Rename CookieMetricsMiddleware to CookingMonitoringMiddleware
This fixes a misuse of New Relic terminology. Here we are in fact using
custom attributes; custom metrics are a different thing that we may start
using in the future.
2020-09-18 14:25:50 +00:00
Tim McCormack
ba9ee4e151 ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)
This uses the new names introduced in edx-django-utils
3.8.0 (edx/edx-django-utils#59), which we're already using, as
well as updating a few other locations where we incorrectly refer
to New Relic custom metrics instead of custom attributes.

Includes a couple of unrelated lint fixes in a file I modified.
2020-09-18 13:33:50 +00:00
Feanil Patel
d264490fb7 Merge pull request #24952 from regisb/regisb/simplify-waffle-module-name
[BD-21] Simplify hack to obtain waffle module names
2020-09-15 11:19:43 -04:00
Mike OConnell
11e4cab622 Added remote IP to logging (#24932)
* Add remote IP to logging config

Add a new filter to get the remote IP for the current
request and include it in log statements

SEG-34

* Added line for formatting

Added line for formatting

SEG-34
2020-09-14 11:22:11 -04:00
Régis Behmo
307457a255 Simplify hack to obtain waffle module names
Instead of going up the stacktrace to find the module names of waffle
flags and switches, we manually pass the module __name__ whenever the
flag is created. This is similar to `logging.getLogger(__name__)`
standard behaviour.

As the waffle classes are used outside of edx-platform, we make the new
module_name argument an optional keyword argument. This will change once
we pull waffle_utils outside of edx-platform.

Note that the module name is normally only required to view the list of
existing waffle flags and switches. The module name should not be
necessary to verify if a flag is enabled. Thus, maybe it would make
sense to create a `add` class methor similar to:

    class WaffleFlag:
        @classmethod
        def add(cls, namespace, flag, module):
            instance = cls(namespace, flag)
            cls._class_instances.add((instance, module))
2020-09-14 09:30:24 +02:00
Sid Verma
7a3930efe7 Fail to limited metadata if elastic is not available 2020-08-24 10:45:01 -04:00
Sid Verma
1d2fbcc4cc Optimize and paginate list_libraries API, add num_blocks and last_published fields 2020-08-24 10:45:01 -04:00
Nick
10ac2780de Merge pull request #24733 from edx/ndalfonso/AA-287-cta-events
AA-287 cta events
2020-08-12 09:37:13 -04:00
Manjinder Singh
c76ed6ae45 Extracting plugin app from edx-platform (#24678)
* Moving plugins infrastructure to edx-django-utils
This PR extracts the code that enables plugins in edx-platform and puts it in edx-django-utils. This is done to allow other IDAS to add plugin functionality.
2020-08-12 07:48:53 -04:00
Nicholas D'Alfonso
0211a2b0ff AA-287 cta events 2020-08-10 18:00:13 -04:00
Michael Terry
c2033f9667 Small PLS courseware banner fixes
- Hide the submit-button CTA link to reset dates in the mobile
  app. They are working on their own solution.
- Don't show the dates_banner.html code in the courseware. It has
  new CTA banner support with updated wording.
2020-08-10 09:44:43 -04:00
Calen Pennington
f9619d6cad Add a pluggable CallToAction service for XBlocks
This also has an initial use case for Personalized Learner Schedules
to add CTAs to capa and vertical blocks to allow users to shift their
course deadlines.
2020-08-06 14:38:26 -04: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
adeelehsan
d879f9fd00 Merge pull request #23980 from edx/aehsan/PROD-1582/specify_user_message_for_about_me_in_profile
Specify bio field error message for user
2020-06-10 14:46:04 +05:00
adeelehsan
4e1fe2045f Specify bio message for user
Currently user message is generic. Specifying for
bio field so that it make more sense to user.

PROD-1582
2020-06-10 14:19:39 +05:00
Tim McCormack
881cae6c67 Upgrade Python dependencies, including Django 2.2.13 fix (#24137)
- Updating Python Requirements
- Fix cache key generation to use class name and module

This was stringifying the class object directly, resulting in cache keys
like `:1:<class 'xblock_django.models.XBlockConfiguration'>.xblock_django.api.deprecated_xblocks`
which then cause breakage when Django 2.2.13 validates the keys.

Co-authored-by: edX requirements bot <testeng+edx-requirements-bot@edx.org>
2020-06-05 13:25:54 +00:00
stvn
4490e4ca2b Remove 'View In Studio' link from vertical
in favor of display in the Staff Instructor Toolbar.
2020-06-02 16:00:33 -07:00
Ben Warzeski
d357ec9b7b remove old format from teams_config 2020-05-19 15:34:38 -04:00
Ned Batchelder
5caf9b02fa Merge pull request #23922 from regisb/regisb/fix-offset-naive-static-assets
Fix naive offset-naive/aware error in asset compilation [CRI-191]
2020-05-06 17:13:30 -04:00
Régis Behmo
1d859569b6 Fix naive offset-naive/aware error in asset compilation
The XBlockPackageStorage used to return offset-naive datetime objects
which were compared to offset-aware objects when we ran static asset
collection:

    ./manage.py lms collectstatic

Close CRI-191
2020-05-06 18:39:46 +02:00
Simon Chen
f8cc58618a Create a new plugin manager called DynamicPartitionGenerators to remove the dependency of openedx.features.content_type_gating by xmodule.partition_services 2020-05-04 11:16:26 -04:00
David Ormsbee
431fdb9009 Merge pull request #23233 from open-craft/blockstore-library-links
REST API for managing Content Library bundle links
2020-04-30 11:32:48 -04:00
Robert Raposa
5de9eed420 ARCHBOM-1093: Fix unit test enable-migrations (#23789)
* fix old migrations
* fix a test
* fix enable-migrations cmd argument
* enhance verbose logging to log migrations
* update testing doc with help
2020-04-23 14:04:29 -04:00
Braden MacDonald
81b9453462 API to get/update a content library's blockstore bundle links
This adds some simple new python+REST APIs that can be used to create,
read, update, and delete "links" from a content library to other content
libraries.

One can use these links to import content (XBlocks) into a library
without copying the content.

Note that this feature was already fully supported by Blockstore and the
XBlock runtime; it's just that to use it prior to this required one to
use the (lower-level) Blockstore REST API directly to create the links.
Now there is a somewhat higher-level API built in to Studio, using
"content library" abstractions instead of Blockstore primitives.
2020-04-17 13:07:12 -07:00
Aarif
6ee2089077 fixed warnings for wrong-import-order 2020-04-08 23:43:06 +05:00
Nimisha Asthagiri
7f036af429 Django2 CMSH Router: add clarifying comment 2020-04-01 11:28:23 -04:00
Nimisha Asthagiri
03bb132368 Merge pull request #23564 from edx/arch/django22-fix-csmh-router
Django2 CSMH: Database Router update
2020-04-01 11:20:58 -04:00
Nimisha Asthagiri
8991b161dc Django2 CSMH Database Router update 2020-04-01 09:25:56 -04:00
Tim McCormack
b489a4ecb1 Django2 bytestring conversion: Lynx html_to_text output (#23558)
Fixes test of email body for Django 2.0.
2020-04-01 13:12:25 +00:00