Skip to content

Release 0.138.2#3307

Merged
odlbot merged 7 commits intoreleasefrom
release-candidate
Feb 19, 2026
Merged

Release 0.138.2#3307
odlbot merged 7 commits intoreleasefrom
release-candidate

Conversation

@odlbot
Copy link
Contributor

@odlbot odlbot commented Feb 19, 2026

Carey P Gumaer

James Kachel

Dan Subak

@github-actions
Copy link

OpenAPI Changes

Show/hide ## Changes for v0.yaml:
## Changes for v0.yaml:
2 changes: 0 error, 0 warning, 2 info
info	[response-optional-property-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v3/program_enrollments/
		added the optional property '/items/enrollment_mode' to the response with the '200' status

info	[response-optional-property-added] at head/openapi/specs/v0.yaml	
	in API GET /api/v3/program_enrollments/{program_id}/
		added the optional property 'enrollment_mode' to the response with the '200' status



## Changes for v1.yaml:
2 changes: 0 error, 0 warning, 2 info
info	[response-optional-property-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v3/program_enrollments/
		added the optional property '/items/enrollment_mode' to the response with the '200' status

info	[response-optional-property-added] at head/openapi/specs/v1.yaml	
	in API GET /api/v3/program_enrollments/{program_id}/
		added the optional property 'enrollment_mode' to the response with the '200' status



## Changes for v2.yaml:
2 changes: 0 error, 0 warning, 2 info
info	[response-optional-property-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v3/program_enrollments/
		added the optional property '/items/enrollment_mode' to the response with the '200' status

info	[response-optional-property-added] at head/openapi/specs/v2.yaml	
	in API GET /api/v3/program_enrollments/{program_id}/
		added the optional property 'enrollment_mode' to the response with the '200' status



Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

Comment on lines 88 to 95
if not clone_course_run:
continue

new_run_tag = B2B_RUN_TAG_FORMAT.format(
year=now_in_utc().year,
contract_id=contract.id,
)
source_id = CourseKey.from_string(clone_course_run.courseware_id)
new_readable_id = f"{UAI_COURSEWARE_ID_PREFIX}{contract.organization.org_key}+{source_id.course}+{new_run_tag}"

# Check if run already exists
if CourseRun.objects.filter(
course=course, courseware_id=new_readable_id
).exists():
if CourseRun.objects.filter(course=course, b2b_contract=contract).exists():
skipped_count += 1
log.debug(
"Contract run already exists for course %s in contract %s",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The create_program_contract_runs task incorrectly skips creating new course runs, blocking the intended feature of allowing multiple, indexed reruns for the same course and contract.
Severity: MEDIUM

Suggested Fix

Remove the if CourseRun.objects.filter(course=course, b2b_contract=contract).exists(): check from the create_program_contract_runs task. Let the create_contract_run function handle the logic for creating new indexed runs or raising errors, as it is designed to do.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: b2b/tasks.py#L88-L95

Potential issue: The task `create_program_contract_runs` checks if any `CourseRun`
exists for a given `course` and `b2b_contract` and skips creation if one is found. This
check is too broad and conflicts with the underlying `create_contract_run` API, which
was updated to support multiple, indexed reruns for the same course and contract (e.g.,
with keys ending in `1T`, `2T`, etc.). Because the task skips unconditionally if any run
exists, it prevents the new indexed rerun functionality from ever being used, making the
feature inaccessible through the primary workflow.

Did we get this right? 👍 / 👎 to inform future reviews.

@odlbot odlbot merged commit ac5dab0 into release Feb 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants