Skip to content

feat(source-harvest): Add HTTPAPIBudget and concurrency_level#75543

Draft
devin-ai-integration[bot] wants to merge 4 commits intomasterfrom
devin/1774645961-source-harvest-add-api-budget-concurrency
Draft

feat(source-harvest): Add HTTPAPIBudget and concurrency_level#75543
devin-ai-integration[bot] wants to merge 4 commits intomasterfrom
devin/1774645961-source-harvest-add-api-budget-concurrency

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot commented Mar 27, 2026

What

Resolves https://github.com/airbytehq/airbyte-internal-issues/issues/15308:

Adds rate limiting (HTTPAPIBudget) and configurable concurrency (ConcurrencyLevel) to source-harvest to prevent 429 errors and enable parallel syncing.

How

Three additions to manifest.yaml:

  1. api_budgetHTTPAPIBudget with two MovingWindowCallRatePolicy entries:

    • Reports API (^/reports/): 100 requests per 15 minutes
    • General API (catch-all): 100 requests per 15 seconds
    • Respects Retry-After header on 429 responses
  2. concurrency_levelConcurrencyLevel with default 2 workers, max 7, driven by a new num_workers config parameter.

  3. num_workers spec parameter — Optional integer (2–7, default 2) allowing users to tune concurrency.

Version bumped to 1.3.0-rc.1 (MINOR, progressive rollout enabled).

Review guide

  1. manifest.yaml — Core changes: concurrency_level block, api_budget block, num_workers in spec
  2. unit_tests/mock_server/test_api_budget_and_concurrency.py — 6 new tests covering sync behavior, custom num_workers, manifest structure, 429 retry, and spec validation
  3. metadata.yaml — Version bump
  4. docs/integrations/sources/harvest.md — Changelog entry

Human review checklist:

  • Verify the reports URL path regex ^/reports/ correctly matches all report stream paths in the manifest (streams like expenses_categories hit /reports/expenses/categories)
  • Confirm the optional num_workers spec field (with default) won't require action from existing connections
  • Verify the Jinja template {{ config.get('num_workers', 2) }} in default_concurrency is valid declarative manifest syntax
  • Confirm rate limits (100/15s general, 100/15m reports) match Harvest API docs

User Impact

  • Users gain automatic rate limiting, reducing 429 errors during syncs
  • Users can optionally increase num_workers (up to 7) to speed up syncs
  • No action required for existing connections — defaults preserve current behavior (single-threaded equivalent with 2 workers)

Can this PR be safely reverted and rolled back?

  • YES 💚

Link to Devin session: https://app.devin.ai/sessions/a66874b8b76b4c20bad99c9a45e61016

devin-ai-integration bot and others added 3 commits March 27, 2026 21:19
- Add HTTPAPIBudget with two MovingWindowCallRatePolicy entries:
  - Reports API: 100 requests per 15 minutes
  - General API: 100 requests per 15 seconds
- Add ConcurrencyLevel with default 2 workers, max 7
- Add configurable num_workers spec parameter (integer, 2-7)
- Bump version to 1.3.0-rc.1 (MINOR, progressive rollout)
- Add unit tests for api_budget, concurrency, and spec validation

Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Copy Markdown
Contributor

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

PR Slash Commands

Airbyte Maintainers (that's you!) can execute the following slash commands on your PR:

  • 🛠️ Quick Fixes
    • /format-fix - Fixes most formatting issues.
    • /bump-version - Bumps connector versions, scraping changelog description from the PR title.
  • ❇️ AI Testing and Review (internal link: AI-SDLC Docs):
    • /ai-prove-fix - Runs prerelease readiness checks, including testing against customer connections.
    • /ai-canary-prerelease - Rolls out prerelease to 5-10 connections for canary testing.
    • /ai-review - AI-powered PR review for connector safety and quality gates.
  • 🚀 Connector Releases:
    • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-preview.{git-sha}) for all modified connectors in the PR.
    • /bump-progressive-rollout-version - Bumps connector version with an RC suffix (2.16.10-rc.1) for progressive rollouts (enableProgressiveRollout: true).
      • Example: /bump-progressive-rollout-version changelog="Add new feature for progressive rollout"
  • ☕️ JVM connectors:
    • /update-connector-cdk-version connector=<CONNECTOR_NAME> - Updates the specified connector to the latest CDK version.
      Example: /update-connector-cdk-version connector=destination-bigquery
  • 🐍 Python connectors:
    • /poe connector source-example lock - Run the Poe lock task on the source-example connector, committing the results back to the branch.
    • /poe source example lock - Alias for /poe connector source-example lock.
    • /poe source example use-cdk-branch my/branch - Pin the source-example CDK reference to the branch name specified.
    • /poe source example use-cdk-latest - Update the source-example CDK dependency to the latest available version.
  • ⚙️ Admin commands:
    • /force-merge reason="<REASON>" - Force merges the PR using admin privileges, bypassing CI checks. Requires a reason.
      Example: /force-merge reason="CI is flaky, tests pass locally"
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

Deploy preview for airbyte-docs ready!

✅ Preview
https://airbyte-docs-h8opvak1j-airbyte-growth.vercel.app

Built with commit e2fd686.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

source-harvest Connector Test Results

193 tests   192 ✅  3m 40s ⏱️
  2 suites    1 💤
  2 files      0 ❌

Results for commit e2fd686.

♻️ This comment has been updated with latest results.

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.

1 participant