Commit Graph

4229 Commits

Author SHA1 Message Date
Régis Behmo
5a618bfdbb Annotate git export settings and toggles in CMS
We take the opportunity to resolve a few linting issues, without affecting the
feature behaviour.
2021-02-09 12:39:48 +01:00
Usama Sadiq
7eb2c40106 Merge branch 'master' into usamasadiq/bom-2327-pylint-amnesty 2021-02-08 18:24:53 +05:00
usamasadiq
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +05:00
usamasadiq
e6d43ac69c Applied pylint amnesty 2021-02-08 12:45:57 +05:00
Zulqarnain
ffb9e6cb4b pylint amnesty in cms apps 2021-02-02 15:31:33 +05:00
David Ormsbee
4fde69441c Fix build: use @shared_task for update_outline_from_modulestore_task (#26216)
Update to make update_outline_from_modulestore_task use @shared_task
and @set_code_owner_attribute.
2021-01-28 11:22:39 -05:00
David Ormsbee
5353324c80 Merge pull request #26145 from edx/ormsbee/course-outline-publish-tnl-7733
Push Course Outlines to learning_sequences on publish.
2021-01-28 10:21:11 -05:00
David Ormsbee
669677c78a Push Course Outlines to learning_sequences on publish.
The learning_sequences app has its own model for Course Outlines.
Prior to this commit, these course outlines were only populated by
a management command in the learning_sequences app that queried
modulestore. This commit does a few things:

1. Move the update_course_outline command to live in contentstore
   (i.e. Studio). This makes learning_sequences unaware of
   modulestore, and makes it easier for us to extract it from
   edx-platform (or to plug in different kinds of course outlines).
2. Add tests.
3. Add performance and debug logging to course outline creation.
4. Make course outline creation happen every time a course publish
   happens.

This will allow us to start collecting data about how long building
course outlines takes, and get error reporting around any content
edge cases that break the course outline code.
2021-01-28 09:56:28 -05:00
Muhammad Soban Javed
d26a59eb67 import task decorator from celery APP instance in CMS (#25953)
* import task decorator from celery APP instance instead of celery package in CMS

* replaced task decorator with shared_task in cms and common

* Fixed import of shared_task

* Fixed import
2021-01-27 18:35:11 +05:00
Régis Behmo
97399cf97c Fix TypeError during transcript upload to S3
On a platform that is configured to upload video transcripts to S3
(`DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"`),
uploads from the studio fail with a TypeError: "Unicode-objects must be
encoded before hashing"

A full stacktrace of the issue can be found here:
https://sentry.overhang.io/share/issue/2249b6f67d794c7e986cc288758f4ebe/

This error is triggered by md5 hashing in the botocore library, which
itself is used by the S3Boto3Storage storage class. This error does not
occur with filesystem-based uploads because it does not perform checksum
verification. The reason why this error would not occur on edx.org is
unknown. Similar issues were already fixed from edxval.

To address this issue, we encode the transcript file content prior to
sending it to s3.
2021-01-25 12:23:31 +01:00
Ahtisham Shahid
ed1156a690 Improved traces for new relic in CMS dashboard (#26126)
* Improved traces for new relic in cms dashboard
2021-01-25 14:15:54 +05:00
David Ormsbee
1d028c9baa Merge pull request #25572 from open-craft/raul/import-export-boto3-support
[SE-3530] Adds Boto3 support for Import/Export functionality
2021-01-19 13:08:04 -05:00
Shimul Chowdhury
e339cc1b07 Add Unit & Nested blocks to breadcrumbs
hide links that has no url

Hide sequence nav in nested pages

Improve doc
2021-01-15 18:49:01 +06:00
stvn
a40feee9c7 Increase logging verbosity on update_search_index task
to gain insight into CR-3119/TNL-7866.
We know that one or more errors are occuring during this job, but it's
not obvious what these errors are.
2021-01-13 10:04:08 -08:00
Usman Khalid
9e38b17202 Convert ErrorModule and NonStaffErrorModule to XBlocks. (#25570) 2021-01-07 10:51:33 -05:00
Kyle McCormick
7d2f8de03b Add type annotations to backfill_orgs_and_org_courses 2021-01-06 16:00:41 -05:00
Kyle McCormick
599d663779 Add option to backfill org data as inactive
Add an `--inactive` option to the
`bulk_add_orgs_and_org_courses` management
command, which causes the backfill to set
`active=False` on all rows created in the
Organization and OrganizationCourse tables.

This will lower the potential data
integrity risk to production systems
such as courses.edx.org.

Upgrade edx-organizations to 6.6.0

TNL-7774
2021-01-06 16:00:41 -05:00
Kyle McCormick
70f910935c Improve backfill_orgs_and_org_courses output formatting (#25880)
The output was previously surfaced via `log.info` calls.
Given that the command is reporting on thousands of records,
that ended up being very difficult to parse.
Instead, print one organization or org-course linkage
per line.

Add example run of command with output to command
class docstring.

TNL-7774
2021-01-06 13:23:19 -05:00
Usman Khalid
75391262da [BD-04] Convert SplitTest XModule to XBlock. (#25696) 2021-01-05 09:55:14 -05:00
Robert Raposa
de16529ab6 Merge pull request #25885 from regisb/regisb/fix-deprecated-waffle-usage
[BD-21] Fix deprecated waffle usage
2020-12-17 12:41:40 -05:00
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
Régis Behmo
f29e415353 Fix deprecated usage of WaffleFlag.namespaced_flag_name
As of edx-toggles==1.2.0, the `WaffleFlag.namespaced_flag_name`
attribute is deprecated in favour of `WaffleFlag.name`.
2020-12-15 12:28:57 +01:00
Kyle McCormick
f5134e1201 Fix typo in backfill_orgs_and_org_courses dry-run call (#25859)
Also, add test to confirm fix of typo.

TNL-7774
2020-12-11 11:13:35 -05:00
Justin Lapierre
dfe15503ce Merge pull request #25012 from open-craft/farhaan/bb-2961-ora-button-support
[BB-2961] [BD-05] [TNL-7577] Added open response button to the component tray
2020-12-09 07:55:52 -05:00
Ned Batchelder
eb82e64b51 Merge pull request #25809 from raccoongang/rg/fix/bookmarks_deletion
In the LMS, bookmarks associated to deleted units are not deleted
2020-12-09 06:19:27 -05:00
Max Sokolski
22a88de1ea In the LMS, bookmarks associated to deleted units are not deleted 2020-12-09 04:51:09 +02:00
Kyle McCormick
739e8a1e71 Stringify keys in backfill_orgs_and_org_courses (#25802)
The command was failing when it encountered both Old Mongo
and Split Mongo course keys, as it tried to `sort` the keys,
but Opaque Keys are only comparable if they are of the same
type. The solution is to convert them to strings before sorting.
The edx-organizations code that instruments the backfill knows
to parse them back into CourseKeys.
2020-12-08 09:36:46 -05:00
Farhaan Bukhsh
aa18d88fa9 Fix test with updated ORA template
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-08 00:58:23 +05:30
Farhaan Bukhsh
4c61ba28bc Added the condition for the first template to be blank assessment.
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:03 -03:00
Farhaan Bukhsh
92a561e085 Removed unnecessary checks in test case
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:02 -03:00
Farhaan Bukhsh
9c434cc8b2 Changed the order of the button
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:02 -03:00
Farhaan Bukhsh
4ad50ef5d9 Adding proper indentation for pep8
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:01 -03:00
Farhaan Bukhsh
95a219f395 Added improved comments
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:01 -03:00
Farhaan Bukhsh
48595cd38d Added tests for ORA button
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:00 -03:00
Farhaan Bukhsh
30632f87cc Added Open response button to the component tray
Author needs to have a quick access to ORA menu in order
to get proceed with assesment design. This introduces ORA
button to the tray.

Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:00 -03:00
Kyle McCormick
d4026382a5 [BD-14] Ensure new content libraries map to valid organizations (#25752)
If ORGANIZATIONS_AUTOCREATE, this will create a new
org in the case that the organization is missing.

If !ORGANIZATIONS_AUTOCREATE, this will raise a
validation error in the case that the organization is
missing.

TNL-7646
2020-12-04 09:29:45 -05: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
Kyle McCormick
4dda73d797 [BD-14] Migrate all environments to use database-backed organizations (#25153)
* Install `organizations` app into LMS and Studio non-optionally.
* Add toggle `ORGANIZATIONS_AUTOCREATE` to Studio.
* Remove the `FEATURES["ORGANIZATIONS_APP"]` toggle.
* Use the new `organizations.api.ensure_organization` function to
  either validate or get-or-create organizations, depending
  on the value of `ORGANIZATIONS_AUTOCREATE`,
  when creating course runs and V2 content libraries.
  We'll soon use it for V1 content libraries as well.
* Remove the `util.organizations_helpers` wrapper layer
  that had to exist because `organizations` was an optional app.
* Add `.get_library_keys()` method to the Split modulestore.
* Add Studio management command for backfilling organizations tables
  (`backfill_orgs_and_org_courses`).

For full details, see
https://github.com/edx/edx-organizations/blob/master/docs/decisions/0001-phase-in-db-backed-organizations-to-all.rst

TNL-7646
2020-12-02 13:58:40 -05:00
Kyle McCormick
9f239ffe8f Add reset_course_content Studio management command (#25653)
Given a course key and a split-mongo version GUID,
it resets the course run's draft branch to a specified
version and publishes.

The purpose of this is to allow us to restore overwritten
course content without having to write to Mongo via a
dbshell.

Adds `reset_course_to_version` method to modulestore API.

TNL-7705
2020-11-23 15:14:10 -05:00
Robert Raposa
9ae82024fc Merge pull request #25584 from edx/robrap/ARCHBOM-1260-code-owner-decorator
ARCHBOM-1260: set code_owner for celery tasks
2020-11-17 19:32:59 -05:00
Robert Raposa
8eef18710d set code_owner for celery tasks
ARCHBOM-1260

Co-authored-by: Tim McCormack <tmccormack@edx.org>
2020-11-17 15:33:33 -05:00
Diana Huang
65d0c11591 Catch individual errors instead of failing the entire job for course
indexing.
2020-11-17 13:23:13 -05:00
Diana Huang
08c24ed0bf Add an increased timeout for courseware indexing. 2020-11-17 13:23:13 -05:00
Diana Huang
afeea75d9e Add changes to support ES7 and edx-search 2.0 back into the tree. 2020-11-17 13:23:13 -05:00
Diana Huang
8d652e6a4b Revert "Merge pull request #25515 from edx/diana/edx-search"
This reverts commit 9714d7412f, reversing
changes made to 5bc7c3996b.
2020-11-13 13:16:16 -05:00
Diana Huang
ece3c30ee3 Quality fixes 2020-11-13 11:13:02 -05:00
Diana Huang
33d0a18d56 Update edx-platform to use Elasticsearch 7.
This reverts commit b73f755487.
2020-11-13 11:13:01 -05:00
David Ormsbee
2086f11a22 Merge pull request #24838 from open-craft/symbolist/convert-conditional-module-to-xblock
[BD-04] Convert Conditional XModule to XBlock
2020-11-12 13:04:26 -05:00
Raul Gallegos
236d5d7b78 Adds Boto3 support for Import/Export functionality 2020-11-10 22:33:08 -05:00
Awais Qureshi
7201edb11d Revert "Update routing config" (#25536)" (#25549)" (#25553)" (#25561)
This reverts commit db4c3b1210.
2020-11-11 00:13:47 +05:00