feat(tasks): migrate GET /api/apify/runs/{runId}#145
Conversation
- URL: `https://api.recoupable.com/api/apify/scraper?runId=X` → `${NEW_API_BASE_URL}/api/apify/runs/${runId}` (path segment, url-encoded). - Auth: adds `x-api-key: RECOUP_API_KEY` header — new endpoint requires auth. - Wire shape: `datasetId` → `dataset_id` (snake_case) in the response schemas; `pollScraperResults` adapted to read the new field and fall back to the upstream-known `run.datasetId` when the response field is null. - Adds `src/recoup/__tests__/getScraperResults.test.ts` covering URL, headers, in-progress / completed / non-ok paths, empty runId, and url-encoding.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 36 minutes and 36 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dev test via Trigger.dev — passingTriggered How I know it worksThe migrated path is Observed during the run:
If the migration were broken (e.g. Not covered
🤖 Tested with Claude Code via Trigger.dev MCP |
Cuts the Apify-scraper polling helper off the legacy
api.recoupable.com/api/apify/scraper?runId=XURL and onto${NEW_API_BASE_URL}/api/apify/runs/${runId}with anx-api-keyheader. Response schemas updated for thedatasetId→dataset_idrename;pollScraperResultsreads the new field and falls back to the upstream-known run value when null. Depends on api#463.Test plan
pnpm testpasses (356/356 locally)pro-artist-social-profiles-scrapeagainst a preview and observe a full poll cycle completesSummary by cubic
Switches Apify scraper polling to the new authenticated GET endpoint
/api/apify/runs/{runId}and updates response handling to snake_case with a safe fallback whendataset_idis null.Refactors
https://api.recoupable.com/api/apify/scraper?runId=Xto${NEW_API_BASE_URL}/api/apify/runs/${runId}(URL-encoded) withx-api-key: RECOUP_API_KEY.datasetIdtodataset_id(nullable);pollScraperResultsfalls back torun.datasetIdwhen null.runId, and URL encoding.Migration
NEW_API_BASE_URLandRECOUP_API_KEYare set in the environment.Written for commit 40b02ad. Summary will update on new commits.