Skip to content

fix(source-slack): use RATE_LIMITED action for rate limit response filters#76997

Open
devin-ai-integration[bot] wants to merge 3 commits intomasterfrom
devin/1777064852-fix-slack-rate-limit-action
Open

fix(source-slack): use RATE_LIMITED action for rate limit response filters#76997
devin-ai-integration[bot] wants to merge 3 commits intomasterfrom
devin/1777064852-fix-slack-rate-limit-action

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Apr 24, 2026

What

The Slack connector's error handlers use action: RETRY for rate-limited responses (both the ratelimited JSON predicate and http_codes: [429] filters). The CDK only emits RATE_LIMITED stream status messages when the response action is RATE_LIMITED, not RETRY. This causes rate-limiting events to be invisible in the source logs and connection timeline UI.

The CDK's DEFAULT_ERROR_MAPPING correctly maps HTTP 429 to ResponseAction.RATE_LIMITED, but the connector's custom response filters intercept the response first and downgrade to RETRY, bypassing the RATE_LIMITED status emission in http_client.py.

How

Changed action: RETRY to action: RATE_LIMITED in all 5 rate-limit response filters across the manifest:

  1. slack_api_error_handler -- ratelimited predicate
  2. Default requester -- ratelimited predicate
  3. Default requester -- http_codes: [429]
  4. users_stream -- ratelimited predicate
  5. users_stream -- http_codes: [429]

Transient error filters (request_timeout, service_unavailable, etc.) and 500/503 filters remain RETRY.

Updated test_should_retry to expect RATE_LIMITED for the ok_false_ratelimited test case.

Review guide

  1. airbyte-integrations/connectors/source-slack/manifest.yaml -- all manifest changes
  2. airbyte-integrations/connectors/source-slack/unit_tests/test_streams.py -- test expectation update

User Impact

  • Rate limiting events now properly emit RATE_LIMITED stream status, making them visible in source logs and the connection timeline UI
  • When the Retry-After header is missing from a rate-limited response, the connector will now retry endlessly instead of giving up after max_retries attempts

Can this PR be safely reverted and rolled back?

  • YES

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

…lters

The Slack connector's error handlers used action: RETRY for rate-limited
responses (both the ratelimited predicate and http_codes: [429] filters).
The CDK only emits RATE_LIMITED stream status messages and logs when the
response action is RATE_LIMITED, not RETRY. This caused rate limiting to
be invisible in the source logs and UI timeline.

Changed all rate-limit response filters from action: RETRY to
action: RATE_LIMITED across the shared slack_api_error_handler, the
default requester, and the users_stream error handler.

Co-Authored-By: Christo Grabowski <christo.grab@gmail.com>
@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.
      • 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.
  • 🚀 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

source-slack Connector Test Results

80 tests   74 ✅  1m 3s ⏱️
 2 suites   6 💤
 2 files     0 ❌

Results for commit 706f495.

♻️ This comment has been updated with latest results.

…d responses

Co-Authored-By: Christo Grabowski <christo.grab@gmail.com>
Co-Authored-By: Christo Grabowski <christo.grab@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

Deploy preview for airbyte-docs ready!

Project:airbyte-docs
Status: ✅  Deploy successful!
Preview URL:https://airbyte-docs-66hd4438g-airbyte-growth.vercel.app
Latest Commit:706f495

Deployed with vercel-action

@octavia-bot
Copy link
Copy Markdown
Contributor

octavia-bot Bot commented Apr 25, 2026

AI PR Review starting...

Reviewing PR for connector safety and quality.
View playbook

Devin AI session created successfully!

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

↪️ Triggering /ai-review per Hands-Free AI Triage Project triage next step.

Reason: PR is ready for review with no prior AI review on file.

Devin session

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

devin-ai-integration Bot commented Apr 25, 2026

AI PR Review Report

Review Action: APPROVED
Risk Level: 4 — Changes rate-limit response action from RETRY to RATE_LIMITED in source-slack error handlers; Behavioral Changes gate triggered; user-visible impact on retry semantics when Retry-After header is absent.

Gate Status
PR Hygiene PASS
Code Hygiene PASS
Test Coverage PASS
Code Security PASS
Per-Record Performance PASS
Breaking Dependencies PASS
Backwards Compatibility PASS
Forwards Compatibility PASS
Behavioral Changes FAIL
Out-of-Scope Changes PASS
CI Checks PASS
Live / E2E Tests PASS

Behavioral Changes Warning: This PR changes the response action for rate-limited responses from RETRY to RATE_LIMITED across 5 error handler filters. The PR description notes: "When the Retry-After header is missing from a rate-limited response, the connector will now retry endlessly instead of giving up after max_retries attempts." This is a user-visible behavioral change. Human reviewers should evaluate whether the endless-retry semantic is acceptable for all Slack API rate-limit scenarios.


📋 PR Details

Connector & PR Info

Connector(s): source-slack
PR: #76997
HEAD SHA: 706f4954e54657f9ff805e763e30e32426179a24
Session: https://app.devin.ai/sessions/e2ceae46aff943989b4aa9da4632e51d

Risk Level

Level: 4 — High
Rationale: Changes rate-limit response action from RETRY to RATE_LIMITED in source-slack manifest.yaml error handlers; Behavioral Changes gate triggered (retry/rate-limit keywords in diff); user-visible impact on retry behavior when Retry-After header is absent.

Risk Level is reported for downstream consumers (e.g. auto-merge policy, reviewer routing). It does not change the review action — APPROVE here means "no blocking objection," not "safe to merge unattended."

Review Action Details

APPROVED - All enforced gates pass. Submitted APPROVE PR review. This does NOT authorize auto-merge; the merge decision remains with humans or a separate policy.

Note: The bot submits APPROVE whenever all enforced gates PASS, regardless of what the PR changes. APPROVE is a quality signal, not a merge authorization; any auto-merge behavior is governed by separate policy reading decision and risk_level from the metrics marker.

🔍 Gate Evaluation Details

Gate-by-Gate Analysis

Gate Status Enforced? Details
PR Hygiene PASS Yes Description present with detailed What/How/Review guide/User Impact sections (well over 50 chars). Changelog updated in docs/integrations/sources/slack.md. No unresolved human reviewer comments.
Code Hygiene PASS WARNING Source file modified (manifest.yaml); test file modified (unit_tests/test_streams.py). Coverage evidence found.
Test Coverage PASS Yes Behavioral change detected (title keyword: fix). Test file unit_tests/test_streams.py modified with updated test expectation for ok_false_ratelimited case (ResponseAction.RETRYResponseAction.RATE_LIMITED).
Code Security PASS Yes No auth/credential file paths matched. No security keywords (authenticator, OAuthAuthenticator, api_token, client_id, client_secret, etc.) found in diff hunks. metadata.yaml diff only changes dockerImageTag, not dockerRepository/allowedHosts/connectorBuildOptions.
Per-Record Performance PASS WARNING Changes are to error handler response filters (action field), not per-record processing paths. No performance-sensitive code paths affected.
Breaking Dependencies PASS WARNING No dependency version changes. Only connector version bump in metadata.yaml (3.1.23 → 3.1.24).
Backwards Compatibility PASS Warning (elevates Risk Level) No spec changes. No streams removed/renamed. No primary key or cursor field changes. No schema modifications. metadata.yaml only changes dockerImageTag.
Forwards Compatibility PASS Warning (elevates Risk Level) No state/cursor/checkpoint/pagination/transformation keywords found in diff hunks. Changes are limited to error handler action fields.
Behavioral Changes FAIL Warning (elevates Risk Level) Keyword RETRY (matches retry) found in removed diff lines; RATE_LIMITED (matches rate_limit pattern) found in added diff lines. Changes affect how rate-limited responses are handled — switching from RETRY (finite retries) to RATE_LIMITED (potentially infinite retries without Retry-After header).
Out-of-Scope Changes PASS Skip All 4 changed files are within airbyte-integrations/connectors/source-slack/ or docs/integrations/sources/.
CI Checks PASS Yes All core CI checks passed: Lint source-slack (✅), Test source-slack (✅), Build and Verify Artifacts (✅), Connector CI Checks Summary (✅). Pre-release check excluded (evaluated by Live / E2E Tests).
Live / E2E Tests PASS Yes Validation required (PR title contains fix). MCP verification unavailable (Cloud SQL Proxy not running). Fallback to Priority 2: source-slack Pre-Release Checks check-run exists and passed (✅).

Behavioral Changes — Detail

Changed diff lines (manifest.yaml, 5 hunks):

  • Removed: action: RETRY (5 occurrences in rate-limit response filters)
  • Added: action: RATE_LIMITED (5 occurrences)

Matched keywords: retry (in removed lines), rate_limit pattern (in added lines)

Impact: The CDK treats RATE_LIMITED differently from RETRY:

  1. Emits RATE_LIMITED stream status messages (visible in logs/UI)
  2. When Retry-After header is absent, RATE_LIMITED retries indefinitely vs. RETRY which respects max_retries

Filters changed:

  1. slack_api_error_handlerratelimited predicate
  2. Default requesterratelimited predicate
  3. Default requesterhttp_codes: [429]
  4. users_streamratelimited predicate
  5. users_streamhttp_codes: [429]

Transient error filters (500/503, request_timeout, service_unavailable) remain RETRY — unchanged.

📚 Evidence Consulted

Evidence

  • Changed files: 4 files
    • airbyte-integrations/connectors/source-slack/manifest.yaml
    • airbyte-integrations/connectors/source-slack/metadata.yaml
    • airbyte-integrations/connectors/source-slack/unit_tests/test_streams.py
    • docs/integrations/sources/slack.md
  • CI checks: 37 passed, 0 failed, 0 pending, 6 skipped. Key checks: Lint ✅, Test ✅, Build ✅, Pre-Release Checks ✅
  • PR labels: connectors/source/slack
  • PR description: Present — detailed What/How/Review guide/User Impact/Revert safety sections
  • Existing bot reviews: None
  • MCP verification: Unavailable (Cloud SQL Proxy not running); fell back to CI check-run evidence

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