Skip to content

Fix settings.integration_events() to request the events path - #131

Merged
lelia merged 3 commits into
mainfrom
lelia/fix-integration-events-path
Nov 20, 2026
Merged

lelia merged 3 commits into
mainfrom
lelia/fix-integration-events-path

Conversation

@lelia

@lelia lelia commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

settings.integration_events() always failed. It requested GET orgs/{org_slug}/settings/integrations/{integration_id}, and that path has no GET route: the API only defines PUT and DELETE there.

Root Cause

The method's path stops at the integration ID. The integration events listing is one segment deeper, at .../integrations/{integration_id}/events.

Fix

  • Request orgs/{org_slug}/settings/integrations/{integration_id}/events. The endpoint checks integration:list.
  • Annotate the return as list and fall back to []. The endpoint returns a bare JSON array of events, not an object.
  • Add a unit test that asserts the method and path, with a fixture shaped like a real event.
  • Bump to 3.6.3, with a CHANGELOG entry.

Unit tests pass: 194 passed, 1 skipped.

#130 adds a scope table to the README that lists this method with the /events path, so merge this PR before that one.

Public Changelog

Fixed settings.integration_events(), which requested a path with no GET route and always failed.

Refs: CE-462

The method requested orgs/{org}/settings/integrations/{id}, which has no
GET route, so it always failed. The events listing lives under /events
and checks integration:list.
@lelia lelia changed the title Fix settings.integration_events() to request the events path Fix settings.integration_events() to request the events path Nov 14, 2026
@lelia
lelia marked this pull request as ready for review November 14, 2026 02:45
@lelia
lelia requested a review from a team as a code owner November 14, 2026 02:45
@cursor

cursor Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Targeted bug fix to one settings helper with a clearer list return type; no auth or core request-path changes beyond the corrected URL.

Overview
Fixes settings.integration_events(), which previously always failed because it called GET orgs/{org}/settings/integrations/{id} (no GET on that route). It now requests .../integrations/{integration_id}/events, matching the API that returns a JSON array of integration events.

The method’s return type is updated from dict to list, with errors returning [] instead of {}. Release 3.6.3 includes a CHANGELOG entry and a unit test that checks the GET path and list-shaped response.

Reviewed by Cursor Bugbot for commit 5007b6f. Configure here.

@lelia

lelia commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@flowstate Eric Hibbs (flowstate) left a comment

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.

Path fix checks out against the API: the bare integrations/{integration_id} path only routes PUT and DELETE, and GET …/events requires integration:list. The new test fails on the old path.

Non-blocking, fine as a follow-up: GET …/events returns a bare JSON array, but integration_events() is annotated -> dict and the test mocks {"results": [...]}. Worth aligning the annotation and fixture with the real shape at some point.

GET .../integrations/{integration_id}/events answers with a bare JSON
array of events. The method was annotated -> dict and fell back to {},
and its test mocked a {"results": [...]} wrapper the API never sends.
The annotation and fallback are now a list, and the fixture has the
shape of a real event.
@lelia

lelia commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Took the nit in this PR instead of a follow-up (5007b6f). integration_events() is now annotated -> list with a [] fallback, and the test fixture is a bare array shaped like the API's integration event.

@lelia

lelia commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5007b6f. Configure here.

@lelia
lelia merged commit 1a2fb83 into main Nov 20, 2026
15 checks passed
@lelia
lelia deleted the lelia/fix-integration-events-path branch November 20, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants