Skip to content

feat(manifest): add max_concurrent_async_job_count as an option in manifest#584

Merged
Aldo Gonzalez (aldogonzalez8) merged 1 commit intomainfrom
ac8/make-max_concurrent_async_job_count-available-in-manifest
Jun 5, 2025
Merged

feat(manifest): add max_concurrent_async_job_count as an option in manifest#584
Aldo Gonzalez (aldogonzalez8) merged 1 commit intomainfrom
ac8/make-max_concurrent_async_job_count-available-in-manifest

Conversation

@aldogonzalez8
Copy link
Contributor

@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) commented Jun 5, 2025

Supporting max_concurrent_async_job_count (this was only working in the Connector Builder, but not during actual reads)

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

Summary by CodeRabbit

  • Tests
    • Added a test to verify that the maximum number of concurrent asynchronous jobs is correctly enforced when specified in the configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 5, 2025

📝 Walkthrough

Walkthrough

The constructor of ConcurrentDeclarativeSource was updated to pass the max_concurrent_async_job_count parameter from the source configuration to the ModelToComponentFactory. Additionally, a new unit test verifies that this concurrency limit is correctly enforced by the internal job tracker.

Changes

File(s) Change Summary
airbyte_cdk/sources/declarative/concurrent_declarative_source.py Passes max_concurrent_async_job_count from config to ModelToComponentFactory in constructor.
unit_tests/sources/declarative/test_concurrent_declarative_source.py Adds a test to verify correct propagation and enforcement of max_concurrent_async_job_count in job tracker. Adds necessary import.

Sequence Diagram(s)

sequenceDiagram
    participant Test as Test
    participant Source as ConcurrentDeclarativeSource
    participant Factory as ModelToComponentFactory
    participant Tracker as JobTracker

    Test->>Source: Create with manifest (includes max_concurrent_async_job_count)
    Source->>Factory: Instantiate (with max_concurrent_async_job_count)
    Factory->>Tracker: Set job limit (max_concurrent_async_job_count)
    Test->>Tracker: Acquire job intents (up to limit)
    Test->>Tracker: Acquire job intent (exceed limit)
    Tracker-->>Test: Raise ConcurrentJobLimitReached
Loading

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • bazarnov

Would you like to consider adding a test for scenarios where max_concurrent_async_job_count is not set in the config, to verify default behavior as well—wdyt?

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
airbyte_cdk/sources/declarative/concurrent_declarative_source.py (1)

92-92: Consider type validation for the async job count parameter

The parameter extraction looks good and safely handles missing keys. However, since source_config.get() returns Any and the test shows manifest values can be strings, should we consider adding type conversion or validation here? For example, what happens if someone passes a non-numeric value? WDYT about adding a simple validation to ensure it's a positive integer when provided?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3469ace and 0372fc3.

📒 Files selected for processing (2)
  • airbyte_cdk/sources/declarative/concurrent_declarative_source.py (1 hunks)
  • unit_tests/sources/declarative/test_concurrent_declarative_source.py (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Check: 'source-pokeapi' (skip=false)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Check: 'source-hardcoded-records' (skip=false)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Analyze (python)
🔇 Additional comments (2)
unit_tests/sources/declarative/test_concurrent_declarative_source.py (2)

33-33: LGTM on the import addition

Clean import addition that's needed for the new test functionality.


1843-1859: Excellent test coverage for the new functionality

This test is well-structured and comprehensive! I appreciate how it:

  • Tests the end-to-end flow from manifest config to job tracker behavior
  • Validates both the successful case (acquiring up to the limit) and the error case (exceeding the limit)
  • Uses descriptive assertions to verify the internal state

The fact that you're setting the limit as a string in the manifest but expecting an integer in the job tracker suggests there's proper type conversion happening in the component factory - nice to see that working correctly.

@github-actions
Copy link

github-actions bot commented Jun 5, 2025

PyTest Results (Fast)

3 657 tests  +1   3 647 ✅ +1   5m 46s ⏱️ -5s
    1 suites ±0      10 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 0372fc3. ± Comparison against base commit 3469ace.

@github-actions
Copy link

github-actions bot commented Jun 5, 2025

PyTest Results (Full)

3 660 tests  +1   3 650 ✅ +1   17m 20s ⏱️ -3s
    1 suites ±0      10 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 0372fc3. ± Comparison against base commit 3469ace.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) merged commit acc1003 into main Jun 5, 2025
30 checks passed
@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) deleted the ac8/make-max_concurrent_async_job_count-available-in-manifest branch June 5, 2025 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants