-
Notifications
You must be signed in to change notification settings - Fork 0
feat!: return full FetchResponse from context.fetch() #20
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
Open
TheRealAgentK
wants to merge
4
commits into
master
Choose a base branch
from
issue-12/fetch-response
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+263
−33
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
29b65fd
Return full FetchResponse from context.fetch() (#12)
TheRealAgentK 7da1c0c
Update docs and samples for FetchResponse (#12)
TheRealAgentK c6a54ad
Add migration plan for FetchResponse rollout (#12)
TheRealAgentK 4e707ba
Complete migration plan with full file inventory (#12)
TheRealAgentK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,200 @@ | ||
| # Issue #12 — FetchResponse Migration Plan | ||
|
|
||
| > `context.fetch()` now returns a `FetchResponse` (with `.status`, `.headers`, `.data`) | ||
| > instead of the raw parsed body. This is a **breaking change**. | ||
|
|
||
| ## SDK repo (integrations-sdk) — ✅ Done | ||
|
|
||
| All changes committed on branch `issue-12/fetch-response`. | ||
|
|
||
| ### Implementation | ||
| - [x] `src/autohive_integrations_sdk/integration.py` — `FetchResponse` dataclass + updated `fetch()` return type | ||
| - [x] `src/autohive_integrations_sdk/__init__.py` — export `FetchResponse` | ||
|
|
||
| ### Docs & samples | ||
| - [x] `docs/manual/billing.md` | ||
| - [x] `docs/manual/building_your_first_integration.md` | ||
| - [x] `docs/manual/connected_account.md` | ||
| - [x] `docs/manual/integration_structure.md` | ||
| - [x] `docs/manual/patterns.md` | ||
| - [x] `samples/api-fetch/api_fetch.py` | ||
| - [x] `samples/template/my_integration.py` | ||
|
|
||
| ### Not updated (generated) | ||
| - `docs/apidocs/` — regenerate after merge with `pdoc` | ||
|
|
||
| --- | ||
|
|
||
| ## autohive-integrations (public) — 94 file hits | ||
|
|
||
| Repo: `Autohive-AI/autohive-integrations` | ||
|
|
||
| ### Code (Python) — 81 production files, all need `response` → `response.data` | ||
| - [ ] `api-call/api_call.py` | ||
| - [ ] `app-business-reviews/app_business_reviews.py` | ||
| - [ ] `asana/asana.py` | ||
| - [ ] `bigquery/bigquery.py` | ||
| - [ ] `bitly/bitly.py` | ||
| - [ ] `box/box.py` | ||
| - [ ] `calendly/calendly.py` | ||
| - [ ] `canva/canva.py` | ||
| - [ ] `circle/circle.py` | ||
| - [ ] `clickup/clickup.py` | ||
| - [ ] `coda/coda.py` | ||
| - [ ] `companies-register/companies_register.py` | ||
| - [ ] `dropbox/dropbox.py` | ||
| - [ ] `elevenlabs/elevenlabs.py` | ||
| - [ ] `eventbrite/eventbrite.py` | ||
| - [ ] `facebook/actions/comments.py` | ||
| - [ ] `facebook/actions/insights.py` | ||
| - [ ] `facebook/actions/pages.py` | ||
| - [ ] `facebook/actions/posts.py` | ||
| - [ ] `facebook/helpers.py` | ||
| - [ ] `fathom/fathom.py` | ||
| - [ ] `float/float.py` | ||
| - [ ] `freshdesk/freshdesk.py` | ||
| - [ ] `front/front.py` | ||
| - [ ] `github/github.py` | ||
| - [ ] `gitlab/gitlab.py` | ||
| - [ ] `gong/gong.py` | ||
| - [ ] `google-calendar/google_calendar.py` | ||
| - [ ] `google-docs/google_docs.py` | ||
| - [ ] `google-looker/google_looker.py` | ||
| - [ ] `google-tasks/google_tasks.py` | ||
| - [ ] `hackernews/hackernews.py` | ||
| - [ ] `harvest/harvest.py` | ||
| - [ ] `heartbeat/heartbeat.py` | ||
| - [ ] `heygen/heygen.py` | ||
| - [ ] `humanitix/actions/checkin.py` | ||
| - [ ] `humanitix/actions/events.py` | ||
| - [ ] `humanitix/actions/orders.py` | ||
| - [ ] `humanitix/actions/tags.py` | ||
| - [ ] `humanitix/actions/tickets.py` | ||
| - [ ] `humanitix/helpers.py` | ||
| - [ ] `instagram/actions/account.py` | ||
| - [ ] `instagram/actions/comments.py` | ||
| - [ ] `instagram/actions/insights.py` | ||
| - [ ] `instagram/actions/media.py` | ||
| - [ ] `instagram/helpers.py` | ||
| - [ ] `instagram/instagram.py` | ||
| - [ ] `linkedin/linkedin.py` | ||
| - [ ] `linkedin-ads/linkedin_ads.py` | ||
| - [ ] `mailchimp/mailchimp.py` | ||
| - [ ] `microsoft-excel/microsoft_excel.py` | ||
| - [ ] `microsoft-planner/microsoft_planner.py` | ||
| - [ ] `microsoft-powerpoint/microsoft_powerpoint.py` | ||
| - [ ] `microsoft-word/microsoft_word.py` | ||
| - [ ] `microsoft365/microsoft365.py` | ||
| - [ ] `monday-com/monday_com.py` | ||
| - [ ] `netlify/netlify.py` | ||
| - [ ] `notion/notion.py` | ||
| - [ ] `nzbn/nzbn.py` | ||
| - [ ] `pipedrive/pipedrive.py` | ||
| - [ ] `powerbi/powerbi.py` | ||
| - [ ] `productboard/productboard.py` | ||
| - [ ] `reddit/reddit.py` | ||
| - [ ] `retail-express/retail_express.py` | ||
| - [ ] `rss-reader-feedparser-ah-fetch/rss_reader.py` | ||
| - [ ] `shopify-admin/shopify_admin.py` | ||
| - [ ] `shopify-customer/shopify_customer.py` | ||
| - [ ] `shopify-storefront/shopify_storefront.py` | ||
| - [ ] `stripe/stripe.py` | ||
| - [ ] `tiktok/tiktok.py` | ||
| - [ ] `toggl/toggl.py` | ||
| - [ ] `trello/trello.py` | ||
| - [ ] `typeform/typeform.py` | ||
| - [ ] `uber/uber.py` | ||
| - [ ] `webcal/webcal.py` | ||
| - [ ] `whatsapp/whatsapp.py` | ||
| - [ ] `X/x.py` | ||
| - [ ] `xero/xero.py` | ||
| - [ ] `youtube/youtube.py` | ||
| - [ ] `zoho/zoho.py` | ||
| - [ ] `zoom/zoom.py` | ||
|
|
||
| ### Tests (Python) — 13 test files, mock return values need to return `FetchResponse` | ||
| - [ ] `linkedin-ads/tests/test_linkedin_ads.py` | ||
| - [ ] `microsoft-planner/tests/test_microsoft_planner.py` | ||
| - [ ] `microsoft-powerpoint/tests/test_microsoft_powerpoint.py` | ||
| - [ ] `microsoft-word/tests/test_microsoft_word.py` | ||
| - [ ] `microsoft365/tests/test_microsoft365_integration.py` | ||
| - [ ] `monday-com/tests/test_monday_com.py` | ||
| - [ ] `notion/tests/test_notion_integration.py` | ||
| - [ ] `powerbi/tests/test_powerbi_integration.py` | ||
| - [ ] `productboard/tests/test_productboard.py` | ||
| - [ ] `shopify-customer/tests/test_unit.py` | ||
| - [ ] `uber/tests/test_uber.py` | ||
| - [ ] `xero/tests/test_xero.py` | ||
| - [ ] `zoom/tests/run_test.py` | ||
|
|
||
| ### Docs (Markdown) | ||
| - [ ] `README.md` | ||
| - [ ] `api-call/README.md` | ||
|
|
||
| ### Dependency | ||
| - [ ] Bump `autohive-integrations-sdk` version in each integration's `requirements.txt` | ||
|
|
||
| --- | ||
|
|
||
| ## integrations (private) — 5 code hits | ||
|
|
||
| Repo: `Autohive-AI/integrations` | ||
|
|
||
| ### Code (Python) | ||
| - [ ] `discord/discord.py` | ||
| - [ ] `hubspot/hubspot.py` | ||
| - [ ] `perplexity/perplexity.py` | ||
| - [ ] `slack/slack.py` | ||
| - [ ] `telegram/telegram.py` | ||
|
|
||
| ### Dependency | ||
| - [ ] Bump `autohive-integrations-sdk` version in each integration's `requirements.txt` | ||
|
|
||
| --- | ||
|
|
||
| ## Autohive (private/platform) — 2 code hits | ||
|
|
||
| Repo: `Autohive-AI/Autohive` | ||
|
|
||
| ### Code (Python) | ||
TheRealAgentK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - [ ] `integrations/github/github_integration.py` | ||
| - [ ] `integrations/slack/slack.py` | ||
|
|
||
| ### Dependency | ||
| - [ ] Bump `autohive-integrations-sdk` version in `requirements.txt` | ||
|
|
||
| --- | ||
|
|
||
| ## autohive-docs (private) — 1 doc hit | ||
|
|
||
| Repo: `Autohive-AI/autohive-docs` | ||
|
|
||
| ### Docs (Markdown) | ||
| - [ ] `content/docs/integrations/api-call.md` | ||
|
|
||
| --- | ||
|
|
||
| ## Release sequence | ||
|
|
||
| 1. Merge & release SDK (`integrations-sdk`) with new minor version | ||
| 2. Update `autohive-integrations` (public) — bulk PR for all integrations + docs | ||
| 3. Update `integrations` (private) — PR for 5 integrations | ||
| 4. Update `Autohive` (private) — PR for 2 integration files | ||
| 5. Update `autohive-docs` (private) — PR for api-call docs page | ||
| 6. Regenerate `docs/apidocs/` in SDK repo | ||
|
|
||
| ## Migration pattern | ||
|
|
||
| Every call site follows the same mechanical change: | ||
|
|
||
| ```python | ||
| # Before | ||
| response = await context.fetch(url) | ||
| data = response.get("key") # or response["key"], etc. | ||
| return ActionResult(data=response) | ||
|
|
||
| # After | ||
| response = await context.fetch(url) | ||
| data = response.data.get("key") # access body via .data | ||
| return ActionResult(data=response.data) | ||
| ``` | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this plan file belong in this repo? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a fair question, but I think it's useful - I'm a big fan of information in the repo and given that - while 12 is completed in here - there's follow-up work I want to audit against at some point when this change goes into a release, I think it's a good place. Happy to remove in the future.
The other options are to put it into a discussion thread, a new GH issue or in our internal Notion, but none of those are ideal either.