Skip to content

Release 1.164.0 - #3905

Merged
odlbot merged 9 commits into
releasefrom
release-candidate
Aug 31, 2026
Merged

odlbot merged 9 commits into
releasefrom
release-candidate

Conversation

@odlbot

@odlbot odlbot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Zaman Afzal

Chris Chudzicki

annagav

Dan Subak

Ahtisham Shahid

@github-actions

Copy link
Copy Markdown

OpenAPI Changes

Show/hide changes
## Changes for v0.yaml:
8 changes: 4 error, 0 warning, 4 info
error	[response-required-property-removed] at head/openapi/specs/v0.yaml
	in API GET /api/v2/pages/?fields=*&type=cms.coursepage
		removed the required property `items/items/show_stay_updated` from the response with the `200` status

error	[response-required-property-removed] at head/openapi/specs/v0.yaml
	in API GET /api/v2/pages/?fields=*&type=cms.programpage
		removed the required property `items/items/show_stay_updated` from the response with the `200` status

error	[response-required-property-removed] at head/openapi/specs/v0.yaml
	in API GET /api/v2/pages/{id}/
		removed the required property `oneOf[#/components/schemas/CoursePageItem]/show_stay_updated` from the response with the `200` status

error	[response-required-property-removed] at head/openapi/specs/v0.yaml
	in API GET /api/v2/pages/{id}/
		removed the required property `oneOf[#/components/schemas/ProgramPageItem]/show_stay_updated` from the response with the `200` status

info	[response-required-property-added] at head/openapi/specs/v0.yaml
	in API GET /api/v2/pages/?fields=*&type=cms.coursepage
		added the required property `items/items/hubspot_form_id` to the response with the `200` status

info	[response-required-property-added] at head/openapi/specs/v0.yaml
	in API GET /api/v2/pages/?fields=*&type=cms.programpage
		added the required property `items/items/hubspot_form_id` to the response with the `200` status

info	[response-required-property-added] at head/openapi/specs/v0.yaml
	in API GET /api/v2/pages/{id}/
		added the required property `oneOf[#/components/schemas/CoursePageItem]/hubspot_form_id` to the response with the `200` status

info	[response-required-property-added] at head/openapi/specs/v0.yaml
	in API GET /api/v2/pages/{id}/
		added the required property `oneOf[#/components/schemas/ProgramPageItem]/hubspot_form_id` to the response with the `200` status



## Changes for v1.yaml:
8 changes: 4 error, 0 warning, 4 info
error	[response-required-property-removed] at head/openapi/specs/v1.yaml
	in API GET /api/v2/pages/?fields=*&type=cms.coursepage
		removed the required property `items/items/show_stay_updated` from the response with the `200` status

error	[response-required-property-removed] at head/openapi/specs/v1.yaml
	in API GET /api/v2/pages/?fields=*&type=cms.programpage
		removed the required property `items/items/show_stay_updated` from the response with the `200` status

error	[response-required-property-removed] at head/openapi/specs/v1.yaml
	in API GET /api/v2/pages/{id}/
		removed the required property `oneOf[#/components/schemas/CoursePageItem]/show_stay_updated` from the response with the `200` status

error	[response-required-property-removed] at head/openapi/specs/v1.yaml
	in API GET /api/v2/pages/{id}/
		removed the required property `oneOf[#/components/schemas/ProgramPageItem]/show_stay_updated` from the response with the `200` status

info	[response-required-property-added] at head/openapi/specs/v1.yaml
	in API GET /api/v2/pages/?fields=*&type=cms.coursepage
		added the required property `items/items/hubspot_form_id` to the response with the `200` status

info	[response-required-property-added] at head/openapi/specs/v1.yaml
	in API GET /api/v2/pages/?fields=*&type=cms.programpage
		added the required property `items/items/hubspot_form_id` to the response with the `200` status

info	[response-required-property-added] at head/openapi/specs/v1.yaml
	in API GET /api/v2/pages/{id}/
		added the required property `oneOf[#/components/schemas/CoursePageItem]/hubspot_form_id` to the response with the `200` status

info	[response-required-property-added] at head/openapi/specs/v1.yaml
	in API GET /api/v2/pages/{id}/
		added the required property `oneOf[#/components/schemas/ProgramPageItem]/hubspot_form_id` to the response with the `200` status



## Changes for v2.yaml:
8 changes: 4 error, 0 warning, 4 info
error	[response-required-property-removed] at head/openapi/specs/v2.yaml
	in API GET /api/v2/pages/?fields=*&type=cms.coursepage
		removed the required property `items/items/show_stay_updated` from the response with the `200` status

error	[response-required-property-removed] at head/openapi/specs/v2.yaml
	in API GET /api/v2/pages/?fields=*&type=cms.programpage
		removed the required property `items/items/show_stay_updated` from the response with the `200` status

error	[response-required-property-removed] at head/openapi/specs/v2.yaml
	in API GET /api/v2/pages/{id}/
		removed the required property `oneOf[#/components/schemas/CoursePageItem]/show_stay_updated` from the response with the `200` status

error	[response-required-property-removed] at head/openapi/specs/v2.yaml
	in API GET /api/v2/pages/{id}/
		removed the required property `oneOf[#/components/schemas/ProgramPageItem]/show_stay_updated` from the response with the `200` status

info	[response-required-property-added] at head/openapi/specs/v2.yaml
	in API GET /api/v2/pages/?fields=*&type=cms.coursepage
		added the required property `items/items/hubspot_form_id` to the response with the `200` status

info	[response-required-property-added] at head/openapi/specs/v2.yaml
	in API GET /api/v2/pages/?fields=*&type=cms.programpage
		added the required property `items/items/hubspot_form_id` to the response with the `200` status

info	[response-required-property-added] at head/openapi/specs/v2.yaml
	in API GET /api/v2/pages/{id}/
		added the required property `oneOf[#/components/schemas/CoursePageItem]/hubspot_form_id` to the response with the `200` status

info	[response-required-property-added] at head/openapi/specs/v2.yaml
	in API GET /api/v2/pages/{id}/
		added the required property `oneOf[#/components/schemas/ProgramPageItem]/hubspot_form_id` to the response with the `200` status



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

Comment thread b2b/api.py
Comment on lines +2043 to +2046
mailgun_log_response["timestamp"] = datetime.fromisoformat(
mailgun_log_response["@timestamp"]
).timestamp()
return mailgun_log_response

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The code directly accesses the "@timestamp" key from an external API response without error handling, which will cause a KeyError if the key is missing.
Severity: MEDIUM

Suggested Fix

Add defensive error handling when accessing the "@timestamp" key. Use the .get() method to provide a default or check for the key's existence before access. Alternatively, wrap the access in a try...except KeyError block to gracefully handle cases where the key is not in the response, preventing the admin action from crashing.

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/api.py#L2043-L2046

Potential issue: The function `_unpack_event_data_from_api_response` directly accesses
the `@timestamp` key from a Mailgun API response using bracket notation
(`mailgun_log_response["@timestamp"]`). This assumes the key will always be present. If
the external Mailgun API returns a response where an item is missing the `@timestamp`
key for any reason (e.g., API change, malformed data, or version mismatch), this will
raise an unhandled `KeyError`. This exception would crash the newly introduced
`backfill_email_events` admin action. The code path that parses the API response is not
covered by any tests, increasing the risk.

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

@odlbot
odlbot merged commit 787dd91 into release Aug 31, 2026
18 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.

6 participants