Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.172.0 #3390

Open
wants to merge 12 commits into
base: release
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
- 5432:5432

redis:
image: redis:7.4.1
image: redis:7.4.2
ports:
- 6379:6379

elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:8.16.0
image: docker.elastic.co/elasticsearch/elasticsearch:8.17.0
env:
network.host: "0.0.0.0"
http.cors.enabled: "true"
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ repos:
- --exclude-files
- "_test.js$"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.9.1"
rev: "v0.9.2"
hooks:
- id: ruff-format
- id: ruff
Expand Down Expand Up @@ -103,7 +103,7 @@ repos:
- id: shellcheck
args: ["--severity=warning"]
- repo: https://github.com/rhysd/actionlint
rev: v1.7.6
rev: v1.7.7
hooks:
- id: actionlint
name: actionlint
Expand Down
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
"filename": "sheets/dev-setup.md",
"hashed_secret": "1348b145fa1a555461c1b790a2f66614781091e9",
"is_verified": false,
"line_number": 179
"line_number": 178
}
],
"static/js/constants.js": [
Expand Down Expand Up @@ -261,5 +261,5 @@
}
]
},
"generated_at": "2024-09-26T09:26:28Z"
"generated_at": "2025-01-13T12:49:44Z"
}
14 changes: 14 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Release Notes
=============

Version 0.172.0
---------------

- fix: filter enrollments instead of get in defer_enrollment (#3215)
- fix: external sync when there is no platform with passed name (#3385)
- fix(deps): update dependency boto3 to v1.36.2 (#3383)
- [pre-commit.ci] pre-commit autoupdate (#3382)
- chore(deps): update docker.elastic.co/elasticsearch/elasticsearch docker tag to v8.17.0 (#3381)
- refactor: remove COUPON_SHEETS (#3370)
- chore(deps): update node.js to v20.18.1 (#3379)
- chore(deps): update redis docker tag to v7.4.2 (#3380)
- chore(deps): update nginx docker tag to v1.27.3 (#3378)
- refactor: migrate digital credentials flag to posthog (#3367)

Version 0.171.0 (Released January 30, 2025)
---------------

Expand Down
12 changes: 10 additions & 2 deletions courses/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,17 @@ def defer_enrollment(
(CourseRunEnrollment, CourseRunEnrollment): The deactivated enrollment paired with the
new enrollment that was the target of the deferral
"""
from_enrollment = CourseRunEnrollment.all_objects.get(
user=user, run__courseware_id=from_courseware_id
from_enrollment = (
CourseRunEnrollment.all_objects.filter(
user=user, run__courseware_id=from_courseware_id
)
.order_by("-created_on")
.first()
)
if not from_enrollment:
raise ValidationError(
f"User is not enrolled in course run '{from_courseware_id}'" # noqa: EM102
)
if not force and not from_enrollment.active:
raise ValidationError(
f"Cannot defer from inactive enrollment (id: {from_enrollment.id}, run: {from_enrollment.run.courseware_id}, user: {user.email}). " # noqa: EM102
Expand Down
13 changes: 10 additions & 3 deletions courses/management/commands/sync_external_course_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ def handle(self, *args, **options): # noqa: ARG002
"""Handle command execution"""
vendor_name = options["vendor_name"]
keymap = EXTERNAL_COURSE_VENDOR_KEYMAPS.get(vendor_name.lower())
if not keymap:
platform = Platform.objects.filter(name__iexact=vendor_name).first()

if not platform:
self.stdout.write(self.style.ERROR(f"Unknown vendor name {vendor_name}."))
return

platform = Platform.objects.filter(name__iexact=vendor_name).first()
if platform and not platform.enable_sync and not options.get("force"):
if not keymap:
self.stdout.write(
self.style.ERROR(f"Mapping does not exist for {vendor_name}.")
)
return

if not platform.enable_sync and not options.get("force"):
self.stdout.write(
self.style.ERROR(
f"Course sync is off for {vendor_name}. Please enable it before syncing."
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ services:
- "5432"

redis:
image: redis:7.4.1
image: redis:7.4.2
ports:
- "6379"

nginx:
image: nginx:1.27.2
image: nginx:1.27.3
ports:
- "8053:8053"
links:
Expand Down Expand Up @@ -68,7 +68,7 @@ services:
extra_hosts: *default-extra-hosts

watch:
image: node:20.18.0
image: node:20.18.1
working_dir: /src
command: >
/bin/bash -c './webpack_dev_server.sh --install'
Expand Down
1 change: 1 addition & 0 deletions mitxpro/features.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""MIT xPRO features"""

DIGITAL_CREDENTIALS = "digital_credentials"
ENABLE_ENTERPRISE = "enable_enterprise"
ENROLLMENT_WELCOME_EMAIL = "enrollment_welcome_email"
47 changes: 24 additions & 23 deletions mitxpro/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from mitxpro.celery_utils import OffsettingSchedule
from mitxpro.sentry import init_sentry

VERSION = "0.171.0"
VERSION = "0.172.0"

env.reset()

Expand Down Expand Up @@ -905,39 +905,40 @@
month_of_year="*",
),
},
}
if FEATURES.get("COUPON_SHEETS"):
CELERY_BEAT_SCHEDULE["renew_all_file_watches"] = {
"renew_all_file_watches": {
"task": "sheets.tasks.renew_all_file_watches",
"schedule": (
DRIVE_WEBHOOK_EXPIRATION_MINUTES - DRIVE_WEBHOOK_RENEWAL_PERIOD_MINUTES
)
* 60,
}
alt_sheets_processing = FEATURES.get("COUPON_SHEETS_ALT_PROCESSING")
if alt_sheets_processing:
CELERY_BEAT_SCHEDULE.update(
{
"handle-coupon-request-sheet": {
"task": "sheets.tasks.handle_unprocessed_coupon_requests",
"schedule": SHEETS_MONITORING_FREQUENCY,
}
}
)
},
}

alt_sheets_processing = FEATURES.get("COUPON_SHEETS_ALT_PROCESSING")
if alt_sheets_processing:
CELERY_BEAT_SCHEDULE.update(
{
"update-assignment-delivery-dates": {
"task": "sheets.tasks.update_incomplete_assignment_delivery_statuses",
"schedule": OffsettingSchedule(
run_every=timedelta(seconds=SHEETS_MONITORING_FREQUENCY),
offset=timedelta(
seconds=0 if not alt_sheets_processing else SHEETS_TASK_OFFSET
),
),
"handle-coupon-request-sheet": {
"task": "sheets.tasks.handle_unprocessed_coupon_requests",
"schedule": SHEETS_MONITORING_FREQUENCY,
}
}
)

CELERY_BEAT_SCHEDULE.update(
{
"update-assignment-delivery-dates": {
"task": "sheets.tasks.update_incomplete_assignment_delivery_statuses",
"schedule": OffsettingSchedule(
run_every=timedelta(seconds=SHEETS_MONITORING_FREQUENCY),
offset=timedelta(
seconds=0 if not alt_sheets_processing else SHEETS_TASK_OFFSET
),
),
}
}
)

# Hijack
HIJACK_INSERT_BEFORE = "</body>"

Expand Down
2 changes: 1 addition & 1 deletion mitxpro/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def get_js_settings(request: HttpRequest):
"help_widget_enabled": settings.ZENDESK_CONFIG.get("HELP_WIDGET_ENABLED"),
"help_widget_key": settings.ZENDESK_CONFIG.get("HELP_WIDGET_KEY"),
},
"digital_credentials": settings.FEATURES.get("DIGITAL_CREDENTIALS", False),
"digital_credentials": is_enabled(features.DIGITAL_CREDENTIALS, default=False),
"digital_credentials_supported_runs": settings.DIGITAL_CREDENTIALS_SUPPORTED_RUNS,
"is_tax_applicable": is_tax_applicable(request),
"enable_enterprise": is_enabled(features.ENABLE_ENTERPRISE, default=False),
Expand Down
6 changes: 4 additions & 2 deletions mitxpro/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from ecommerce.api import is_tax_applicable
from ecommerce.models import Order
from mitxpro import features
from mitxpro.test_utils import MockResponse
from mitxpro.utils import (
all_equal,
Expand Down Expand Up @@ -463,6 +464,8 @@ def posthog_is_enabled_side_effect(*args, **kwargs):
"""
Side effect to return True/False for specific features while mocking posthog is_enabled.
"""
if args[0] == features.DIGITAL_CREDENTIALS: # noqa: SIM103
return True
return False

settings.GA_TRACKING_ID = "fake"
Expand All @@ -476,7 +479,6 @@ def posthog_is_enabled_side_effect(*args, **kwargs):
"HELP_WIDGET_ENABLED": False,
"HELP_WIDGET_KEY": "fake_key",
}
settings.FEATURES["DIGITAL_CREDENTIALS"] = True
settings.DIGITAL_CREDENTIALS_SUPPORTED_RUNS = "test_run1,test_run2"
mocker.patch(
"mitol.olposthog.features.is_enabled",
Expand All @@ -498,7 +500,7 @@ def posthog_is_enabled_side_effect(*args, **kwargs):
"support_email": settings.EMAIL_SUPPORT,
"site_name": settings.SITE_NAME,
"zendesk_config": {"help_widget_enabled": False, "help_widget_key": "fake_key"},
"digital_credentials": settings.FEATURES.get("DIGITAL_CREDENTIALS", False),
"digital_credentials": True,
"digital_credentials_supported_runs": settings.DIGITAL_CREDENTIALS_SUPPORTED_RUNS,
"is_tax_applicable": is_tax_applicable(request),
"enable_enterprise": False,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"yup": "^1.0.0"
},
"engines": {
"node": "20.18.0"
"node": "20.18.1"
},
"scripts": {
"postinstall": "./webpack_if_prod.sh",
Expand Down
30 changes: 15 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ python = "3.12.6"
Pillow = "10.4.0"
PyNaCl = "1.5.0"
beautifulsoup4 = "4.8.2"
boto3 = "1.35.97"
boto3 = "1.36.2"
celery = "5.4.0"
celery-redbeat = "2.2.0"
dj-database-url = "0.5.0"
Expand Down
1 change: 0 additions & 1 deletion sheets/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@pytest.fixture(autouse=True)
def sheets_settings(settings):
"""Default settings for sheets tests"""
settings.FEATURES["COUPON_SHEETS"] = True
settings.SHEETS_REQ_EMAIL_COL = 7
settings.SHEETS_REQ_PROCESSED_COL = 8
settings.SHEETS_REQ_ERROR_COL = 9
Expand Down
1 change: 0 additions & 1 deletion sheets/dev-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ First, gather a bunch of ID-type values from Drive:
_If it's not obvious, remove the angle brackets (`<>`) for the actual values._

```dotenv
FEATURE_COUPON_SHEETS=True
SHEETS_ADMIN_EMAILS=<Your email address>
DRIVE_CLIENT_ID=<Client ID from step 1>
DRIVE_CLIENT_SECRET=<Client secret from step 1>
Expand Down
Loading
Loading