Skip to content

feat(source-github): replace custom token rotation with CDK TokenPoolAuthenticator#80341

Draft
Aaron ("AJ") Steers (aaronsteers) wants to merge 4 commits into
masterfrom
devin/1782145850-source-github-token-pool
Draft

feat(source-github): replace custom token rotation with CDK TokenPoolAuthenticator#80341
Aaron ("AJ") Steers (aaronsteers) wants to merge 4 commits into
masterfrom
devin/1782145850-source-github-token-pool

Conversation

@aaronsteers

Copy link
Copy Markdown
Member

What

Replaces source-github's custom MultipleTokenAuthenticatorWithRateLimiter (~273 lines in utils.py) with the new CDK TokenPoolAuthenticator + RateLimitAwareRotation strategy from airbytehq/airbyte-python-cdk#1057.

This validates the CDK component end-to-end with a real connector as proof of functionality.

TK-TODO: Pin to stable CDK release after airbytehq/airbyte-python-cdk#1057 is merged and released.

How

  • source.py: Swap MultipleTokenAuthenticatorWithRateLimiterTokenPoolAuthenticator with RateLimitAwareRotation
  • backoff_strategies.py: Feed rate-limit response headers to the authenticator via on_http_response() so the rotation strategy can track per-token quota state
  • pyproject.toml: Pin CDK dependency to the feature branch (devin/1750005100-token-pool-authenticator)

The old custom implementation tracked x-ratelimit-remaining / x-ratelimit-reset headers internally and rotated tokens when exhausted. The new CDK component provides the same behavior as a generic, reusable declarative component. The update_token() compatibility method ensures the existing backoff strategy continues to force-rotate when backoff exceeds 10 minutes.

Review guide

  1. source_github/source.py — new _get_authenticator() using CDK components
  2. source_github/backoff_strategies.py — added on_http_response call for state feedback
  3. pyproject.toml — CDK pinned to dev branch (temporary)

User Impact

No user-facing behavior change. Token rotation and rate-limit handling remain functionally equivalent. The old MultipleTokenAuthenticatorWithRateLimiter class in utils.py is retained for now (used by existing tests) but no longer referenced by production code.

Can this PR be safely reverted and rolled back?

  • YES 💚

Devin session

Requested by: Aaron ("AJ") Steers (@aaronsteers)

…r with CDK TokenPoolAuthenticator

Uses the new TokenPoolAuthenticator from the CDK with RateLimitAwareRotation
strategy, replacing the connector-specific token rotation implementation.

TK-TODO: Pin to stable CDK release after airbytehq/airbyte-python-cdk#1057
is merged and released.

Co-Authored-By: AJ Steers <aj@airbyte.io>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 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, CI, and merge conflict 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.
      • Bump types: patch (default), minor, major, major_rc, rc, promote.
      • The rc type is a smart default: applies minor_rc if stable, or bumps the RC number if already RC.
      • The promote type strips the RC suffix to finalize a release.
      • Example: /bump-version type=rc or /bump-version type=minor
    • /bump-progressive-rollout-version - Alias for /bump-version type=rc. Bumps with an RC suffix and enables progressive rollout.
  • ❇️ 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.
  • 📝 AI Documentation:
    • /ai-docs-review - AI-powered documentation review for PRs with connector changes.
    • /ai-create-docs-pr - Creates a documentation PR for connector changes, stacked on the current PR.
  • 🚀 Connector Releases:
    • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-preview.{git-sha}) for all modified connectors in the PR.
  • ☕️ 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.

@datadog-airbytehq

This comment has been minimized.

Co-Authored-By: AJ Steers <aj@airbyte.io>
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

source-github Connector Test Results

173 tests   166 ✅  21s ⏱️
  3 suites    4 💤
  3 files      3 ❌

For more details on these failures, see this check.

Results for commit e964cae.

♻️ This comment has been updated with latest results.

devin-ai-integration Bot and others added 2 commits June 22, 2026 16:39
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
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.

2 participants