Commit Graph

9752 Commits

Author SHA1 Message Date
Demid
16fa97dde4 feat: deprecate filestore
This:

1. Removes the `filestore` property from the `ModuleSystem` in favor of
   the `runtime.resources_fs` property.
   In the original code, `filestore` is equal to
   `DescriptorSystem.runtime.resources_fs`. It's safe to replace it with
   `ModuleSystem.runtime.resources_fs` because both runtimes are combined
   using the `CachingDescriptorSystem`. It provides the `resources_fs` property
   that uses the same file storage.

2. Renames `filestore` argument to `resources_fs` in the `LoncapaSystem`
   constructor.

3. Adds the deprecated `filestore` property to the `ModuleSystemShim`
   and `RuntimeShim`.
2022-04-14 14:45:05 +02:00
connorhaugh
65d4435b0e fix: don't reroute xblock settings button. (#30203)
for: https://openedx.atlassian.net/browse/TNL-9831
2022-04-08 09:26:12 -04:00
muhammad-ammar
735607a752 feat: add an xblock renderer endpoint to serve videos as public having
public access set by course author in studio
2022-04-05 16:42:39 +05:00
Zainab Amir
921dadac99 feat: add password compliance check for login (#30149)
Add nudge and block checks for HIBP API on login view

VAN-667
VAN-668
2022-04-05 11:18:52 +05:00
Kyle McCormick
42fcfc8217 docs: update CourseGraph README, notably w.r.t. new Tutor plugin
Update the README of the CMS's CourseGraph support app:
* Point to the newly-developed CourseGraph plugin for Tutor,
  and remove some prose that's now redundant with the Tutor
  plugin's README.
* Add a link to the now-public CourseGraph Queries wiki page.
* Capitalize the G in CourseGraph.
* Fix a couple misc. formatting things.
2022-03-29 11:21:20 -04:00
Kyle McCormick
d16fe9d427 feat: add admin action for dump to coursegraph
This introduces two admin actions:
* Dump to CourseGraph (respect cache), and
* Dump to CourseGraph (override cache)

which allow admins to select a collection of courses from Django
admin and dump them to the Neo4j instance specified by
settings.COURSEGRAPH_CONNECTION, with or without respecting
the cache (that is: whether the course has already been dumped
since its last publishing).
2022-03-29 11:21:20 -04:00
Kyle McCormick
d75a32c009 refactor: read course publish date from overview, not block structure
The `get_course_last_published` function is used by CourseGraph to
determine whether or not a course should be dumped to Neo4j.
If the course hasn't been published since it was last dumped to
Neo4j, then it can be skipped (unless the override_cache option
is enabled).

The function was previously built using the BlockStructure
data model. While this worked fine in Production instances that
enable `block_structure.storage_backing_for_cache`, this
implementation did NOT work in development environments,
which do not use the BlockStrcture model.

Instead, we switch to using CourseOverview.modified to
approximate when a course was last published. This is method
has fewer moving parts and is universally available across
instances.
2022-03-29 11:21:20 -04:00
Kyle McCormick
696984a2bd feat: dump to cousegraph on course publish signal
Previously, CourseGraph needed to be kept up-to-date by
running `./manage.py dump_to_neo4j ...` manually or on a cron timer.

This introduces a CMS new setting: COURSEGRAPH_DUMP_COURSE_ON_PUBLISH.
When enabled, the CMS course_published signal handler will
asynchronously dump each individual course to CourseGraph when it
is published.

This follows a pattern established by other subsystems like
learning_sequences and special exam registration, both of which
fire off asynchronous post-processing tasks from the course-
publish handler.
2022-03-29 11:21:20 -04:00
Kyle McCormick
1bf8af5f72 feat: specify dump_to_neo4j defaults in COURSEGRAPH_CONNECTION
Introduce a new CMS settings COURSEGRAPH_CONNECTION,
which allows operators to specify default connection paramters
for a Neo4j instance.

This has three purposes:
* The `./manage.py cms dump_to_neo4j` management command will be
  much easier for developers and operators to type out because connection
  arguments can now be omitted. Note that connection arguments, if
  supplied, will override the arguments specified in CMS settings.
* The automatic push-to-coursegraph-on-publish-signal introduced in
  subsequent commits can use these connection settings.
* The CourseGraph Django admin actions introduced in subsequent
  commits can use these connection settings.
2022-03-29 11:21:20 -04:00
Kyle McCormick
c7693cfa20 docs: enrich dump_to_neo4j help text & docstrings
Move most docs out of docstring and into programatically-
displayable argument help text.

Also, the 'Example Usage' was out of date. This commit updates it to:
 * use `./manage.py cms ...' instead of `./manage.py lms ...', and
 * use `--port` instead of `--https_port`.
2022-03-29 11:21:20 -04:00
Kyle McCormick
8039e40f47 refactor: move coursegraph to cms
This code was originally located at:
  ./openedx/core/djangoapps/coursegraph

However, code makes more sense within the ./cms tree, because:
* it is responsible for publishing course content to an
  external system, with is within the responsibilities of CMS, and
* is uses modulestore, which is discouraged for use in LMS
  (see 0011-limit-modulestore-use-in-lms.rst).

So, we move the code to:
  ./cms/djangoapps/coursegraph
and uninstall coursegraph from LMS.

We do not expect this refactor to have any breaking downstream effects.
2022-03-29 11:21:20 -04:00
Tim McCormack
7c7d7d8b6f feat: Allow REST_FRAMEWORK to be configured by (shallow) merge (#30112)
ARCHBOM-2073
2022-03-28 20:38:34 +00:00
Feanil Patel
b2488d8f6f Merge pull request #30117 from openedx/feanil/update_production_default_values
feat: Update how some settings are read in production.py settings files.
2022-03-25 10:07:10 -04:00
Awais Qureshi
bc45f1ee48 fix: Removed usage of djangoratelimitbackend. (#30116)
* fix: Removed usage of djangoratelimitbackend.
2022-03-25 15:27:39 +05:00
Shafqat Farhan
935c01c9ee Merge pull request #30122 from openedx/shafqat/VAN-669
feat: VAN-669 - Disallow bad passwords on Registration
2022-03-25 15:18:36 +05:00
Shafqat Farhan
df22dfbe0d feat: VAN-669 - Disallow bad passwords on Registration 2022-03-25 15:00:07 +05:00
Awais Jibran
51e0742737 Merge branch 'master' into feanil/update_production_default_values 2022-03-25 13:34:56 +05:00
Matjaz Gregoric
8633249853 Merge pull request #28268 from open-craft/agrendalath/bb-4503_library_content_block_completion
feat: allow marking Library Content Block as complete on view [BB-4503]
2022-03-25 08:27:13 +01:00
Feanil Patel
7d2a8340c5 feat: Update how some settings are read in production.py settings files.
Most settings in the production.py files fall back to their values in
common.py if they aren't set in the yaml config files but some
historically didn't.  Update them so that they are more in-line with the
rest of the settings in this file.
2022-03-24 09:59:53 -04:00
Usama Sadiq
1cebd3ed7b Remove django-ratelimit-backend (#30054)
* fix: remove the usage of django-ratelimit-backend

Co-authored-by: Awais Qureshi <awais.qureshi@arbisoft.com>
2022-03-24 17:21:56 +05:00
Agrendalath
d05e5c639f feat: allow marking Library Content Block as complete on view
edx/edx-platform#24365 has changed the completion mode of these blocks.
Before Koa, it was sufficient to view the block to get a completion checkmark.
Since Koa, all children of the block must be completed.

This adds a toggle to change the completion behavior back to the previous one
so that the user experience can be consistent if needed.
2022-03-22 19:09:50 +01:00
Michael Terry
7300072ce5 Merge pull request #30091 from openedx/mikix/backfill-args
feat: add a config model for the backfill_course_tabs command
2022-03-18 12:08:38 -04:00
Michael Terry
35df2723d8 feat: add a config model for the backfill_course_tabs command
- Adds a BackfillCourseTabsConfig model to manage the arguments
  to that command
- Adds batching arguments using that model
- Adds some extra logging for the failed courses
2022-03-18 11:50:55 -04:00
Robert Raposa
c51a0c3e22 Merge pull request #30081 from openedx/robrap/ARCHBOM-2054-move-cookie-monitoring-middleware
refactor: CookieMonitoringMiddleware moved to edx-django-utils
2022-03-18 09:07:50 -04:00
Robert Raposa
9fa79809d8 refactor: CookieMonitoringMiddleware moved to edx-django-utils
The CookieMonitoringMiddleware and its related script
moved to edx-django-utils.

ARCHBOM-2054
2022-03-17 16:59:00 -04:00
Feanil Patel
13ecd80e86 Merge pull request #30086 from openedx/feanil/remove_edx4edx_lite_ref
docs: Update a help string to reference a more up-to-date sample course.
2022-03-17 14:53:52 -04:00
Feanil Patel
2ce5f63756 docs: Update a help string to reference a more up-to-date sample course. 2022-03-17 14:10:05 -04:00
Dillon Dumesnil
46a93ed23c feat: Be even more permissive with errors for this command 2022-03-15 10:14:14 -04:00
Dillon Dumesnil
fc474e92ea Merge pull request #30058 from openedx/ddumesnil/backfill-tabs-update
feat: Add some error handling to Backfill Course Tabs Command
2022-03-14 19:00:51 -07:00
Dillon Dumesnil
0a1fe04565 feat: Add some error handling to Backfill Course Tabs Command 2022-03-14 15:42:36 -04:00
Kaustav Banerjee
c48c655998 refactor: deprecates replace url related properties from ModuleSystem
Deprecates the following attributes from ModuleSystem:
 * replace_urls
 * replace_course_urls
 * replace_jump_to_id_urls

A new ReplaceURLService is created as replacement with a unified replace_urls method
2022-03-14 09:35:41 -04:00
Arslan
2bc6a8ac0a fix: Use PipelineManifestStorage instead of PipelineCachedStorage 2022-03-14 12:57:23 +05:00
Dillon Dumesnil
61b93d953d feat: Add backfill course tabs management command
Previously, course tabs would only be created once and never try to
update the default tabs again. This leads to an issue if you ever want
to add a new tab. With this command, you can now update the default tabs
for all existing courses and new courses will pick it up upon creation
when CourseTabList.initialize_default is called.
2022-03-11 11:16:18 -05:00
Robert Raposa
29e50710dc feat: enhance cookie monitoring and logging
Contains a number of cookie monitoring changes.

Enhancements:
- Add sampling capability for cookie logging on headers
 smaller than the threshold. For details, see
 COOKIE_SAMPLING_REQUEST_COUNT.
- Add cookie header size to log message.
- Sort logged cookies starting with largest cookie.
- Move logging from Middleware request processing
 to response processing to ensure the user id is
 available for logging for authenticated calls.
- Added cookies.header.size.computed to check
 if there are any large hidden duplicate cookies.
 Can be compared against the cookies.header.size
 custom attribute.
- Add delimiters into logs to make it simpler to parse
 when the logging tools accidentally exports multiple
 log lines together.

Removed:
- Legacy cookie capture code. This code was dangerous to
  to enable and provided more limited insight than the
  newer logging, so this was removed to simplify the code.

Other refactors:
- Switched Middleware to use new Django format, rather
 than the Mixin.
- Moved tests to its own test class. Note: this
 middleware is likely to move to a separate
 library.

ARCHBOM-2055
2022-03-09 20:39:27 -05:00
Robert Raposa
8b775961a6 fix: rename table_blacklist to table_ignorelist 2022-03-09 16:43:47 -05:00
Simon Chen
60cf4d7ded fix: allow exam_type change when exam do not have external_id specified (#30032)
Co-authored-by: Simon Chen <schen@edX-C02FW0GUML85.local>
2022-03-09 15:08:33 -05:00
Braden MacDonald
dcb7ef8821 feat: Read course indexes from MySQL, not MongoDB (#29184)
Description
This is a follow up to #29058 and #29413. This is the next step in moving part of the modulestore data (the course indexes / "active versions" table) from MongoDB to MySQL.

There are four steps planned in moving course index data to MySQL:

Step 1: create the tables in MySQL, start writing to MySQL + MongoDB  done
Step 2: migrate all remaining courses to MySQL  done
Step 3: switch reads from MongoDB to MySQL (this PR)
Step 4 (much later, once we know this is working well): stop writing to MongoDB altogether.
Supporting information
OpenCraft Jira ticket: MNG-2557

Status
 Tested with a large Open edX instance is in progress.

Testing instructions
Try making changes in Studio and verify that they work fine.

Deadline
None
2022-03-09 10:21:09 -05:00
Simon Chen
0940fc5e49 fix: Loosen the restriction on updating exam_type (#30022)
Currently, if a subsection was a special exam, we do not allow it to be changed back as a special exam. This PR would loosen that change to only disallow reintroducing the exam back to proctored exam. Timed exam can be updated however the user wants

Co-authored-by: Simon Chen <schen@edX-C02FW0GUML85.local>
2022-03-08 13:00:59 -05:00
Maria Grimaldi
c6cd064194 test: favor CourseOverview when getting course listing for groups 2022-03-03 10:04:39 -05:00
Maria Grimaldi
3322d18446 perf: improve course listing performance for non-staff users 2022-03-03 10:04:39 -05:00
Awais Qureshi
fe57074dab feat!: Remove django-admin default login (#29876)
* feat!: Remove django-admin default login
2022-03-01 17:38:36 +05:00
Zainab Amir
bd08bc7bdc feat: add optional fields rest api (#29942) 2022-02-22 17:51:34 +05:00
Carlos Muniz
37bf73ca50 refactor: Replace videosequence & problemset (#29905)
`videosequence` and `problemset` have been replaced with `sequential`.

`problemset` and `videosequence` are old-but-not-entirely-unused aliases to the `sequential` block type (in Studio-speak, "Subsection").
Since [these block types have been removed from the 6 courses that used them](https://openedx.atlassian.net/browse/DEPR-151?focusedCommentId=588197), this ticket removes the support for the `problemset` and `videosequence` block-types.

For more information, see ticket: [DEPR-151](https://openedx.atlassian.net/browse/DEPR-151)
2022-02-16 10:21:31 -05:00
Bianca Severino
af81b3a609 chore: replace integrity signature flag with django setting 2022-02-15 09:57:00 -05:00
Awais Ansari
5a4cbc56ae feat: link discussions feedback URL with feedback button (#29919)
* feat: link discussions feedback URL with feedback button
2022-02-15 17:28:03 +05:00
Michael Terry
e81c4fe49d Merge pull request #29911 from openedx/mikix/more-old-mongo-test-cleanup
test: more Old Mongo removal from tests
2022-02-11 15:10:45 -05:00
Michael Terry
b905de757b test: more Old Mongo removal from tests
Convert more tests from MONGO_AMNESTY to SPLIT modulestores.

This is in preparation for just wholesale denying access to Old
Mongo, so I either converted tests to split or just deleted some
test variants that were Old Mongo specific. (e.g. ddt lines)
2022-02-11 14:50:30 -05:00
Keith Grootboom
9d3f52ed67 feat: add PREPEND_LOCALE_PATHS configuration setting (#29851)
edx-platform supports COMPREHENSIVE_THEME_LOCALE_PATHS setting, which
appends paths to the end of LOCALE_PATHS,  but there's currently no
way to add additional paths to the start of the list.

https://tasks.opencraft.com/browse/SE-5299
2022-02-09 13:30:21 -05:00
ha-D
a4b36346c9 feat: options for excluding courses from search
Adds two new fields to the indexed course data:
- invitation_only
- catalog_visibility

Also adds two new settings:
`SEARCH_SKIP_INVITATION_ONLY_FILTERING`
`SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING`

These settings can be used to filter out courses in the search results
based on their catalog visibility or based on whether they are
invitation-only courses.
2022-02-08 10:19:43 -08:00
Michael Terry
cb1bb7fa64 test: switch default test store to the split store
It's long past time that the default test modulestore was Split,
instead of Old Mongo. This commit switches the default store and
fixes some tests that now fail:
- Tests that didn't expect MFE to be enabled (because we don't
  enable MFE for Old Mongo) - opt out of MFE for those
- Tests that hardcoded old key string formats
- Lots of other random little differences

In many places, I didn't spend much time trying to figure out how to
properly fix the test, and instead just set the modulestore to Old
Mongo.

For those tests that I didn't spend time investigating, I've set
the modulestore to TEST_DATA_MONGO_AMNESTY_MODULESTORE - search for
that string to find further work.
2022-02-04 14:32:50 -05:00