Commit Graph

65817 Commits

Author SHA1 Message Date
Feanil Patel
08b3f0bf32 fix: Create a bad unicode file differently.
In Python 3.11 CSV files are allowed to have null characters so the test
data is no longer a valid. We update it to not have a valid unicode
character to still test this code path correctly.

I'm not concerned about the fact that the files with null will get past
this test beacause there are other checks on the content of the file
that catch if it doesn't have enough or the right fields so this should
be a safe change to make to the tests.

Relevant Change in Python: https://github.com/python/cpython/issues/71767
2024-04-18 13:28:30 -04:00
Feanil Patel
87b9c759f0 fix: Provide a sequence to random.sample
The sample function used to automatically convert sets to sequences but
that is no longer supported starting in 3.11 so we have to do it
manually.

Reference: https://docs.python.org/3/library/random.html#random.sample
2024-04-18 13:28:30 -04:00
Feanil Patel
b20ac9c515 fix: Be able to clear the process_cache manually in Python 3.11
Given code like the following

```
class Foo:
    @process_cached
    def bar(self):
        pass
```

In Python 3.8 referencing `bar` would not call its `__get__` method.

```
x = Foo().bar
```

However in Python 3.11, making the same call would call the `__get__`
method, permanently replacing the underlying `process_cached` object
with the partial function that references it.

This meant that code to clear the cache would work in Python 3.8 but
would break in 3.11

```
Foo().bar.cache.clear()  # Works in 3.8 but not in 3.11
```

In 3.11 this results in the following error:
```
E       AttributeError: 'functools.partial' object has no attribute 'cache'
```

To make this compatible in both version, we just add the cache as an
accessible attribute on the partial we generate for our wrapped
function.
2024-04-18 13:28:30 -04:00
feanil
ad00e35266 feat: Upgrade Python dependency edx-drf-extensions
Update to a Python 3.11 compatible version

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
2024-04-18 13:21:17 -04:00
feanil
a24aa83f19 feat: Upgrade Python dependency edx-milestones
Update to a Python 3.11 compatible version

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
2024-04-18 17:10:39 +00:00
connorhaugh
f866545bb9 temp: trace celery tasks in dd (#34537) 2024-04-18 13:08:25 -04:00
Feanil Patel
16b82dbb31 Merge pull request #34533 from openedx/feanil/upgrade-edx-bulk-grades-890aa15
feat: Upgrade Python dependency edx-bulk-grades
2024-04-18 12:53:58 -04:00
Rômulo Penido
90b253a38a feat: update Studio search index when course content is updated (#34391) 2024-04-18 09:53:21 -07:00
Feanil Patel
9bd4474f7d test: Reduce query counts now that we dropped django-splash. 2024-04-18 12:43:33 -04:00
Feanil Patel
83ace4d925 chore: Run make compile-requirements to drop django-splash. 2024-04-18 12:43:26 -04:00
Feanil Patel
cec7969ce8 feat!: Remove the django-splash app.
DEPR: https://github.com/openedx/public-engineering/issues/224

The django-splash repo was created 11 years ago to let the LMS redirect
users to a splash screen when a user comes to the site for the first
time. It works by looking for a configurable cookie value and
redirecting from the middleware.

This feature was never documented, has some edx.org hardcoded defaults,
and is not compatible with MFEs.

BREAKING CHANGE: The django splash feature will no longer be available.
2024-04-18 12:43:26 -04:00
feanil
1ae052aad3 feat: Upgrade Python dependency edx-django-sites-extensions
Update to a Python 3.11 compatible version

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
2024-04-18 15:35:07 +00:00
Jeremy Ristau
f18629e132 chore: update 2U teams in CODEOWNERS (#34352) 2024-04-17 16:42:05 -04:00
Jillian
d67211051b feat: restrict Studio search results based on user permissions (#34471)
* feat: adds SearchAccess model

Stores a numeric ID for each course + library, which will generally be
shorter than the full context_key, so we can pack more of them into the
the Meilisearch search filter.

Also:

* Adds data migration pre-populates the SearchAccess model from the existing
  CourseOverview and ContentLibrary records
* Adds signal handlers to add/remove SearchAccess entries when content
  is created or deleted.
* Adds get_access_ids_for_request() helper method for use in views.
* Adds tests.

* test: can't import content.search in lms tests

* feat: use SearchAccess in documents and views

* Adds an access_id field to the document, which stores the
  SearchAccess.id for the block's context.
* Use the requesting user's allowed access_ids to filter search results
  to documents with those access_ids.
* Since some users have a lot of individual access granted, limit the
  number of access_ids in the filter to a large number (1_000)
* Updates tests to demonstrate.

* test: can't import content.search or content_staging in lms tests

* fix: make access_id field filterable

* fix: use SearchAccess.get_or_create in signal handlers

In theory, we shouldn't have to do this, because the CREATE and DELETE
events should keep the SearchAccess table up-to-date.

But in practice, signals can be missed (or in tests, they may be
disabled). So we assume that it's ok to re-use a SearchAccess.id created
for a given course or library context_key.

* refactor: refactors the view tests to make them clearer

Uses helper methods and decorators to wrap the settings and patches used
by multiple view tests.

* feat: adds org filters to meilisearch filter

* Uses content_tagging.rules.get_user_orgs to fetch the user's
  content-related orgs for use in the meilisearch filter.
* Limits the number of orgs used to 1_000 to keep token size down

* refactor: removes data migration

Users should use the reindex_studio management command to populate SearchAccess.

* refactor: adds functions to common.djangoapps.student.role_helpers

to allow general access to the user's RoleCache without having to access
private attributes of User or RoleCache.

Related changes:

* Moves some functionality from openedx.core.djangoapps.enrollments.data.get_user_roles
  to this new helper method.
* Use these new helper method in content_tagging.rules

* fix: get_access_ids_for_request only returns individual access

instead of all course keys that the user can read.

Org- and GlobalStaff access checks will handle the rest.

* fix: use org-level permissions when generating search filter

Also refactors tests to demonstrate this change for OrgStaff and
OrgInstructor users.

* refactor: remove SearchAccess creation signal handlers

Lets SearchAccess entries be created on demand during search indexing.

* feat: omit access_ids from the search filter that are covered by the user's org roles

---------

Co-authored-by: Rômulo Penido <romulo.penido@gmail.com>
2024-04-17 11:21:34 -07:00
feanil
8c4f6692da feat: Upgrade Python dependency edx-bulk-grades
Update to a Python 3.11 compatible version

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
2024-04-17 12:53:32 -04:00
Feanil Patel
96f634937a Merge pull request #34532 from openedx/feanil/upgrade-edx-ace-890aa15
feat: Upgrade Python dependency edx-ace
2024-04-17 12:49:51 -04:00
Feanil Patel
ab0ae506bb Merge pull request #34531 from openedx/feanil/upgrade-openedx-django-wiki-890aa15
feat: Upgrade Python dependency openedx-django-wiki
2024-04-17 12:48:38 -04:00
feanil
9bb3b10930 feat: Upgrade Python dependency edx-ace
Update to a Python 3.11 compatible version

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
2024-04-17 15:23:27 +00:00
feanil
cf484b8e52 feat: Upgrade Python dependency openedx-django-wiki
Update to a Python 3.11 compatible version

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
2024-04-17 15:04:33 +00:00
Feanil Patel
890aa15fdf Merge pull request #33905 from openedx/dependabot/github_actions/aws-actions/amazon-ecr-login-2
build(deps): bump aws-actions/amazon-ecr-login from 1 to 2
2024-04-17 10:43:15 -04:00
github-actions[bot]
262b8a7f2b chore: upgrade XBlock version to 3.0.0 2024-04-17 09:43:12 -04:00
Kyle D. McCormick
3447cbcb90 chore: tweak tests to work with XBlock==3.0.0 2024-04-17 09:43:12 -04:00
Kyle D. McCormick
3c5e1f5769 chore: remove reference to deprecated HierarchyMixin
This has been a no-op for a long time anyway, since HierarchyMixin
has been explicitly mixed into XBlock for as long as I remember.

Ref: https://github.com/openedx/XBlock/issues/714
2024-04-17 09:43:12 -04:00
Kyle D. McCormick
38d350f48c docs: document XBLOCK_MIXINS and XBLOCK_EXTRA_MIXINS 2024-04-17 09:43:12 -04:00
Feanil Patel
28a105b1d2 Merge pull request #34522 from openedx/feanil/upgrade-edx-ccx-keys-8d8ff29
feat: Upgrade Python dependency edx-ccx-keys
2024-04-17 08:37:07 -04:00
MueezKhan246
e187d70233 Merge branch 'master' of https://github.com/openedx/edx-platform into MueezKhan/Remove-ENABLE_USER_ID_SCOPE-Flag-From-Platform 2024-04-17 09:54:41 +00:00
MueezKhan246
86c49f7dce test: removed redundant test case 2024-04-17 09:50:31 +00:00
Saad Yousaf
6dd5157fee fix: fix cadence value for instant cadence and update version 2024-04-17 14:16:50 +05:00
MueezKhan246
726392b1fa feat: removed ENABLE_USER_ID_SCOPE flag from validator 2024-04-17 03:53:07 +00:00
MueezKhan246
a057ed44c1 Merge pull request #34525 from openedx/MueezKhan246/upgrade-edx-enterprise-9d29595
feat: Upgrade Python dependency edx-enterprise
2024-04-17 07:54:29 +05:00
MueezKhan246
983afc7c92 feat: Upgrade Python dependency edx-enterprise
replaced non encrypted fields of degreed config model with encrypted ones

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
2024-04-17 02:22:39 +00:00
Feanil Patel
9d29595602 Merge pull request #34520 from openedx/feanil/upgrade-edx-completion-8d8ff29
feat: Upgrade Python dependency edx-completion
2024-04-16 14:47:04 -04:00
feanil
09ffb94845 feat: Upgrade Python dependency edx-ccx-keys
Update to a Python 3.11 compatible version

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
2024-04-16 18:35:33 +00:00
feanil
06182d978e feat: Upgrade Python dependency edx-completion
Update to a Python 3.11 compatible version

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
2024-04-16 16:15:18 +00:00
Jansen Kantor
8d8ff29d4c fix: don't urljoin empty string (#34516) 2024-04-16 11:30:15 -04:00
Troy Sankey
1244a9f854 Merge pull request #34510 from openedx/pwnage101/add-debugging-force-enrollment
feat: add more verbose logging around force_enrollment
2024-04-15 08:50:40 -07:00
Troy Sankey
f30ae71c23 feat: add more verbose logging around force_enrollment
After testing the enterprise bulk enrollment flow with
force_enrollment=True, I'm finding that the enrollment is still not
forced. This extra logging will hopefully help shed light on where this
boolean might be accidentally ignored.
2024-04-15 08:21:35 -07:00
Saad Yousaf
0270809808 feat: add email cadence setting in notification preferences for emails 2024-04-15 17:04:56 +05:00
Feanil Patel
1968d8fb0d Merge pull request #34505 from openedx/feanil/upgrade-edx-i18n-tools-d98164f
feat: Upgrade Python dependency edx-i18n-tools
2024-04-12 15:42:50 -04:00
feanil
be1cf6b8cd feat: Upgrade Python dependency edx-i18n-tools
Update to a Python 3.11 compatible version

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
2024-04-12 13:50:53 -04:00
Kyle D. McCormick
5fe131c858 fix: --theme-dirs argument to compile_sass management command
This fixes the ability to pass custom theme directories to
the management command which compiles site themes, a la:

   ./manage.py lms compile_sass --theme-dirs /my/custom/themes/dir

The exception, which was due to a incompatible use of @lru_cache, was:

   File "openedx/core/djangoapps/theming/management/commands/compile_sass.py",
   line 93, in parse_arguments:
     available_themes.update({t.theme_dir_name: t for t in get_themes([theme_dir])})
   TypeError: unhashable type: 'list'

This has been broken since the @lru_cache decorator was added, but it
wasn't noticed because:

* We weren't compiling any comprehensive themes in CI.
* Tutor supports compehensive theming, but not *site theming*, so
  it doesn't use this management command at all
  (site themeing == comp theming * site configuration).
* Although edx.org executes this management command, it does not provide
  use the `--theme-dirs` argument, so the bug was not hit.
2024-04-12 11:33:31 -04:00
Kyle D. McCormick
0d52e370f5 test: compile built-in themes as part of static assets check
This will help safe-guard against bugs in the Sass and Webpack build
which only arise from certain uses of the legacy Comprehensive Theming
system.
2024-04-12 11:33:31 -04:00
Kyle D. McCormick
c546bd870a test: add a dummy empty theme
This will be used to protect against bugs like the on fixed in the
previous commit.
2024-04-12 11:33:31 -04:00
Kyle D. McCormick
2cd3dc844d fix: NameErrors in compile_sass.py
Fixes three NameErrors which were introduced by the previous commit,
leading to it being reverted.

These NameErrors slipped through because the script was not tested on
any themes that had zero SCSS overrides.
2024-04-12 11:33:31 -04:00
Kyle D. McCormick
f57d412c71 revert: revert: build: remove dependency on Python sass module
This reverts commit a27cda2fd9.
2024-04-12 11:33:31 -04:00
ruzniaievdm
a9db690900 feat: refactoring xblock actions (#34452) 2024-04-12 11:17:54 -04:00
Glenn R. Martin
81e781c34d feat: waffle refunds for commerce-coordinator
# feat: waffle refunds for commerce-coordinator

Based on approved: #34438

However CLA is invalid now for initial creator so a new PR was required.
2024-04-12 10:43:37 -04:00
Feanil Patel
d98164fcd0 Merge pull request #34477 from openedx/feanil/more_python_updates
Python 3.11 package updates
2024-04-11 12:48:42 -04:00
Sarina Canelake
b004fe064a Merge pull request #34357 from raccoongang/lunyachek/fix/course-about-teacher-images-fix-master
fix: Space around techers images on course about page
2024-04-11 12:44:31 -04:00
Feanil Patel
3719c5375f Merge pull request #34489 from openedx/update-readme-with-tutor
Point to Tutor in README
2024-04-11 11:01:09 -04:00