Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions .github/workflows/semgrep.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ compile-requirements: ## Regenerate uv.lock for the root project and all uv sub-
@# independent of the root project's dependency graph) before exporting any
@# compat file below, so a failure in one halts the whole target before
@# anything downstream of it is (re)generated.
@for d in requirements/edx-sandbox scripts/xblock scripts/semgrep scripts/user_retirement scripts/structures_pruning; do \
@for d in requirements/edx-sandbox scripts/xblock scripts/user_retirement scripts/structures_pruning; do \
echo ; \
echo "== $$d ===============================" ; \
uv run --no-project --isolated --with edx-lint edx_lint write_uv_constraints $$d/pyproject.toml && \
Expand Down
2 changes: 0 additions & 2 deletions cms/djangoapps/cms_user_tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from celery.utils.log import get_task_logger
from django.conf import settings
from django.core import mail
from edx_django_utils.monitoring import set_code_owner_attribute

from common.djangoapps.edxmako.shortcuts import render_to_string
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
Expand All @@ -20,7 +19,6 @@


@shared_task(bind=True)
@set_code_owner_attribute
def send_task_complete_email(self, task_name, task_state_text, dest_addr, detail_url,
olx_validation_text=None, is_course_optimizer_task=False):
"""
Expand Down
24 changes: 0 additions & 24 deletions cms/djangoapps/contentstore/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
from django.test import RequestFactory
from django.utils.text import get_valid_filename
from edx_django_utils.monitoring import (
set_code_owner_attribute,
set_code_owner_attribute_from_module,
set_custom_attribute,
set_custom_attributes_for_course_key,
)
Expand Down Expand Up @@ -164,7 +162,6 @@ def clone_instance(instance, field_values):


@shared_task
@set_code_owner_attribute
def rerun_course(source_course_key_string, destination_course_key_string, user_id, fields=None):
"""
Reruns a course in a new celery task.
Expand Down Expand Up @@ -253,7 +250,6 @@ def _parse_time(time_isoformat):


@shared_task
@set_code_owner_attribute
def update_search_index(course_id, triggered_time_isoformat):
""" Updates course search index. """
try:
Expand Down Expand Up @@ -284,7 +280,6 @@ def update_search_index(course_id, triggered_time_isoformat):


@shared_task
@set_code_owner_attribute
def update_special_exams_and_publish(course_key_str):
"""
Registers special exams for a given course and calls publishing flow.
Expand Down Expand Up @@ -345,13 +340,10 @@ def generate_name(cls, arguments_dict):


@shared_task(base=CourseExportTask, bind=True)
# Note: The decorator @set_code_owner_attribute cannot be used here because the UserTaskMixin
# does stack inspection and can't handle additional decorators.
def export_olx(self, user_id, course_key_string, language):
"""
Export a course or library to an OLX .tar.gz archive and prepare it for download.
"""
set_code_owner_attribute_from_module(__name__)
courselike_key = CourseKey.from_string(course_key_string)

try:
Expand Down Expand Up @@ -523,14 +515,11 @@ def sync_discussion_settings(course_key, user):


@shared_task(base=CourseImportTask, bind=True)
# Note: The decorator @set_code_owner_attribute cannot be used here because the UserTaskMixin
# does stack inspection and can't handle additional decorators.
# pylint: disable=too-many-statements
def import_olx(self, user_id, course_key_string, archive_path, archive_name, language):
"""
Import a course or library from a provided OLX .tar.gz or .zip archive.
"""
set_code_owner_attribute_from_module(__name__)
current_step = 'Unpacking'
courselike_key = CourseKey.from_string(course_key_string)
set_custom_attributes_for_course_key(courselike_key)
Expand Down Expand Up @@ -766,7 +755,6 @@ def read_chunk():


@shared_task
@set_code_owner_attribute
def update_all_outlines_from_modulestore_task():
"""
Celery task that creates multiple celery tasks - one per learning_sequence course outline
Expand All @@ -793,7 +781,6 @@ def update_all_outlines_from_modulestore_task():


@shared_task
@set_code_owner_attribute
def update_outline_from_modulestore_task(course_key_str: str):
"""
Celery task that creates a learning_sequence course outline.
Expand Down Expand Up @@ -938,7 +925,6 @@ def _get_users_by_access_level(v1_library_key):


@shared_task(time_limit=30)
@set_code_owner_attribute
def delete_v1_library(v1_library_key_string):
"""
Delete a v1 library index by key string.
Expand Down Expand Up @@ -998,13 +984,10 @@ def generate_name(cls, arguments_dict):


@shared_task(base=CourseLinkCheckTask, bind=True)
# Note: The decorator @set_code_owner_attribute cannot be used here because the UserTaskMixin
# does stack inspection and can't handle additional decorators.
def check_broken_links(self, user_id, course_key_string, language):
"""
Checks for broken links in a course and store the results in a file.
"""
set_code_owner_attribute_from_module(__name__)
return _check_broken_links(self, user_id, course_key_string, language)


Expand Down Expand Up @@ -1472,7 +1455,6 @@ def _write_broken_links_to_file(broken_or_locked_urls, broken_links_file):


@shared_task
@set_code_owner_attribute
def handle_create_xblock_upstream_link(usage_key):
"""
Create upstream link for a single xblock.
Expand Down Expand Up @@ -1500,7 +1482,6 @@ def handle_create_xblock_upstream_link(usage_key):


@shared_task
@set_code_owner_attribute
def handle_update_xblock_upstream_link(usage_key):
"""
Update upstream link for a single xblock.
Expand All @@ -1517,7 +1498,6 @@ def handle_update_xblock_upstream_link(usage_key):


@shared_task
@set_code_owner_attribute
def create_or_update_upstream_links(
course_key_str: str,
force: bool = False,
Expand Down Expand Up @@ -1558,7 +1538,6 @@ def create_or_update_upstream_links(


@shared_task
@set_code_owner_attribute
def handle_unlink_upstream_block(upstream_usage_key_string: str) -> None:
"""
Handle updates needed to downstream blocks when the upstream link is severed.
Expand All @@ -1578,7 +1557,6 @@ def handle_unlink_upstream_block(upstream_usage_key_string: str) -> None:


@shared_task
@set_code_owner_attribute
def handle_unlink_upstream_container(upstream_container_key_string: str) -> None:
"""
Handle updates needed to downstream blocks when the upstream link is severed.
Expand Down Expand Up @@ -1635,7 +1613,6 @@ def update_course_rerun_links(
"""
Updates course links to point to the latest re-run.
"""
set_code_owner_attribute_from_module(__name__)
return _update_course_rerun_links(
self, user_id, course_id, action, data, language
)
Expand Down Expand Up @@ -2191,7 +2168,6 @@ def migrate_course_legacy_library_blocks_to_item_bank(
leaving migrated blocks as drafts.
"""
ensure_cms("Legacy library content references may only be executed in CMS")
set_code_owner_attribute_from_module(__name__)
_cancel_old_tasks(course_key, self.status.user, [self.status.task_id])
try:
key = CourseKey.from_string(course_key)
Expand Down
2 changes: 0 additions & 2 deletions cms/djangoapps/export_course_metadata/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from celery import shared_task
from django.core.files.base import ContentFile
from edx_django_utils.monitoring import set_code_owner_attribute
from opaque_keys.edx.keys import CourseKey

from openedx.core.djangoapps.schedules.content_highlights import get_all_course_highlights
Expand All @@ -15,7 +14,6 @@


@shared_task(bind=True)
@set_code_owner_attribute
def export_course_metadata_task(self, course_key_string): # pylint: disable=unused-argument
"""
Export course metadata
Expand Down
4 changes: 0 additions & 4 deletions cms/djangoapps/modulestore_migrator/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from django.db import transaction
from django.utils.text import slugify
from django.utils.translation import gettext_lazy as _
from edx_django_utils.monitoring import set_code_owner_attribute_from_module
from lxml import etree
from lxml.etree import _ElementTree as XmlTree
from opaque_keys import InvalidKeyError
Expand Down Expand Up @@ -490,8 +489,6 @@ def _set_migrations_to_fail(source_data_list: list[_MigrationSourceData]):


@shared_task(base=_BulkMigrationTask, bind=True)
# Note: The decorator @set_code_owner_attribute cannot be used here because the UserTaskMixin
# does stack inspection and can't handle additional decorators.
def bulk_migrate_from_modulestore(
self: _BulkMigrationTask,
*,
Expand Down Expand Up @@ -548,7 +545,6 @@ def bulk_migrate_from_modulestore(
# This is a large function, but breaking it up futher would probably not
# make it any easier to understand.

set_code_owner_attribute_from_module(__name__)
status: UserTaskStatus = self.status

# Validating input
Expand Down
3 changes: 0 additions & 3 deletions common/djangoapps/entitlements/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from celery.utils.log import get_task_logger
from django.conf import settings # pylint: disable=unused-import # noqa: F401
from django.contrib.auth import get_user_model
from edx_django_utils.monitoring import set_code_owner_attribute

from common.djangoapps.entitlements.models import CourseEntitlement, CourseEntitlementSupportDetail

Expand All @@ -24,7 +23,6 @@


@shared_task(bind=True, ignore_result=True)
@set_code_owner_attribute
def expire_old_entitlements(self, start, end, logid='...'):
"""
This task is designed to be called to process a bundle of entitlements
Expand Down Expand Up @@ -69,7 +67,6 @@ def expire_old_entitlements(self, start, end, logid='...'):


@shared_task(bind=True)
@set_code_owner_attribute
def expire_and_create_entitlements(self, entitlement_ids, support_username):
"""
Expire entitlements older than one year.
Expand Down
2 changes: 0 additions & 2 deletions common/djangoapps/student/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from celery import shared_task
from django.conf import settings
from django.contrib.auth import get_user_model
from edx_django_utils.monitoring import set_code_owner_attribute
from opaque_keys.edx.keys import CourseKey

from common.djangoapps.course_modes.models import CourseMode
Expand All @@ -28,7 +27,6 @@


@shared_task(bind=True, ignore_result=True)
@set_code_owner_attribute
def send_course_enrollment_email(
self, user_id, course_id, course_title, short_description, course_ended, pacing_type, track_mode
):
Expand Down
3 changes: 0 additions & 3 deletions common/djangoapps/third_party_auth/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import requests
from celery import shared_task
from django.core.exceptions import ObjectDoesNotExist
from edx_django_utils.monitoring import set_code_owner_attribute
from lxml import etree
from requests import exceptions
from social_django.models import UserSocialAuth
Expand All @@ -28,7 +27,6 @@


@shared_task
@set_code_owner_attribute
def fetch_saml_metadata():
"""
Fetch and store/update the metadata of all IdPs
Expand Down Expand Up @@ -139,7 +137,6 @@ def fetch_saml_metadata():


@shared_task
@set_code_owner_attribute
def update_saml_users_social_auth_uid(reader, slug):
"""
Update the UserSocialAuth UID for users based on a CSV reader input.
Expand Down
2 changes: 0 additions & 2 deletions lms/djangoapps/bulk_email/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from django.utils import timezone
from django.utils.translation import gettext as _
from django.utils.translation import override as override_language
from edx_django_utils.monitoring import set_code_owner_attribute
from eventtracking import tracker
from markupsafe import escape

Expand Down Expand Up @@ -232,7 +231,6 @@ def _create_send_email_subtask(to_list, initial_subtask_status):


@shared_task(default_retry_delay=settings.BULK_EMAIL_DEFAULT_RETRY_DELAY, max_retries=settings.BULK_EMAIL_MAX_RETRIES)
@set_code_owner_attribute
def send_course_email(entry_id, email_id, to_list, global_email_context, subtask_status_dict):
"""
Sends an email to a list of recipients.
Expand Down
2 changes: 0 additions & 2 deletions lms/djangoapps/ccx/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from ccx_keys.locator import CCXLocator
from django.dispatch import receiver
from edx_django_utils.monitoring import set_code_owner_attribute
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locator import CourseLocator

Expand All @@ -28,7 +27,6 @@ def course_published_handler(sender, course_key, **kwargs): # pylint: disable=u


@CELERY_APP.task
@set_code_owner_attribute
def send_ccx_course_published(course_key):
"""
Find all CCX derived from this course, and send course published event for them.
Expand Down
3 changes: 0 additions & 3 deletions lms/djangoapps/certificates/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from celery import shared_task
from celery_utils.persist_on_failure import LoggedPersistOnFailureTask, LoggedTask
from django.contrib.auth import get_user_model
from edx_django_utils.monitoring import set_code_owner_attribute
from opaque_keys.edx.keys import CourseKey

from lms.djangoapps.certificates.data import CertificateStatuses
Expand All @@ -27,7 +26,6 @@
@shared_task(
base=LoggedPersistOnFailureTask, bind=True, default_retry_delay=30, max_retries=2
)
@set_code_owner_attribute
def generate_certificate(self, **kwargs): # pylint: disable=unused-argument
"""
Generates a certificate for a single user.
Expand Down Expand Up @@ -60,7 +58,6 @@ def generate_certificate(self, **kwargs): # pylint: disable=unused-argument


@shared_task(base=LoggedTask, ignore_result=True)
@set_code_owner_attribute
def handle_modify_cert_template(options: Dict[str, Any]) -> None: # noqa: UP006
"""
Celery task to handle the modify_cert_template management command.
Expand Down
Loading