Skip to content

Conversation

@darynaishchenko
Copy link
Contributor

@darynaishchenko darynaishchenko commented Nov 3, 2025

Summary by CodeRabbit

  • New Features
    • Added support for a new IGNORE status in async job processing. Jobs marked IGNORE are treated as terminal, will stop further work, and participate in overall status tracking.
    • Configuration/schema updated to allow mapping API statuses to the new ignore state.

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Testing This CDK Version

You can test this version of the CDK using the following:

# Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@daryna/low-code/add-ignored-status-to-async-retriever#egg=airbyte-python-cdk[dev]' --help

# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch daryna/low-code/add-ignored-status-to-async-retriever

Helpful Resources

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment

📝 Edit this welcome message.

@github-actions github-actions bot added the enhancement New feature or request label Nov 3, 2025
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

PyTest Results (Fast)

3 817 tests  ±0   3 805 ✅ ±0   6m 40s ⏱️ -3s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 48880e3. ± Comparison against base commit 6504148.

♻️ This comment has been updated with latest results.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 3, 2025

📝 Walkthrough

Walkthrough

A new IGNORE status is introduced to the async job orchestration system. The changes add an IGNORE enum member to AsyncJobStatus as a terminal state, update the schema and model to include an ignore field for status mapping configuration, extend the parser to map "ignore" to AsyncJobStatus.IGNORE and skip mapping when no API statuses are provided, and update the orchestrator to treat IGNORE as a terminal state and stop running partitions reporting it.

Changes

Cohort / File(s) Summary
Status enum expansion
airbyte_cdk/sources/declarative/async_job/status.py
Added new enum member IGNORE to AsyncJobStatus marked as terminal.
Schema and data model updates
airbyte_cdk/sources/declarative/declarative_component_schema.yaml,
airbyte_cdk/sources/declarative/models/declarative_component_schema.py
Added ignore property to AsyncJobStatusMap schema and ignore: Optional[List[str]] = None to the model to allow configuring statuses to ignore.
Parser status mapping
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py
_create_async_job_status_mapping now skips mapping when api_statuses is None for the CDK status "ignore"; _get_async_job_status maps "ignore" to AsyncJobStatus.IGNORE.
Orchestration logic
airbyte_cdk/sources/declarative/async_job/job_orchestrator.py
_KNOWN_JOB_STATUSES updated to include IGNORE; AsyncPartition.status() treats IGNORE as terminal; running-partition processing now handles IGNORE by stopping the partition and logging a warning, and avoids reallocation logic for ignored partitions.

Sequence Diagram

sequenceDiagram
    participant Parser as ModelToComponentFactory
    participant StatusMap as AsyncJobStatusMap
    participant Orchestrator as AsyncJobOrchestrator
    participant Partition as AsyncPartition

    Parser->>StatusMap: _create_async_job_status_mapping("ignore", None)
    Note over StatusMap: api_statuses is None → skip mapping for "ignore"

    Parser->>StatusMap: _get_async_job_status("ignore")
    StatusMap->>Parser: AsyncJobStatus.IGNORE

    Orchestrator->>Partition: Check partition status
    Partition->>Orchestrator: returns AsyncJobStatus.IGNORE
    Note over Partition: IGNORE treated as terminal

    alt Running partition reports IGNORE
        Orchestrator->>Orchestrator: Stop partition
        Orchestrator->>Orchestrator: Log warning (ignored partition)
        Note over Orchestrator: Skip reallocation / restart logic
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Could you verify that every comparison or set membership check treating terminal statuses includes AsyncJobStatus.IGNORE so no code path treats it as non-terminal?
  • Could you confirm _create_async_job_status_mapping skipping when api_statuses is None for "ignore" doesn't leave any downstream mappings missing unexpectedly?
  • Could you double-check that stopping a partition on IGNORE performs the same necessary cleanup (resources/logging/metrics) as other terminal paths where appropriate?

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'feat(low-code): add ignore status to AsyncJobStatus' clearly and concisely summarizes the main change in the changeset. The title directly corresponds to the primary modification—adding a new IGNORE member to the AsyncJobStatus enum—and uses appropriate conventional commit formatting. It's specific enough that a teammate can quickly understand the core purpose of this enhancement without needing to review the full changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch daryna/low-code/add-ignored-status-to-async-retriever

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 000aac1 and 48880e3.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Check: source-intercom
  • GitHub Check: Check: source-pokeapi
  • GitHub Check: Check: destination-motherduck
  • GitHub Check: Check: source-shopify
  • GitHub Check: Check: source-hardcoded-records
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Manifest Server Docker Image Build
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.12, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.13, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (python)

Comment @coderabbitai help to get the list of available commands and usage tips.

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6504148 and 000aac1.

📒 Files selected for processing (5)
  • airbyte_cdk/sources/declarative/async_job/job_orchestrator.py (3 hunks)
  • airbyte_cdk/sources/declarative/async_job/status.py (1 hunks)
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml (1 hunks)
  • airbyte_cdk/sources/declarative/models/declarative_component_schema.py (1 hunks)
  • airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: pnilan
Repo: airbytehq/airbyte-python-cdk PR: 0
File: :0-0
Timestamp: 2024-12-11T16:34:46.319Z
Learning: In the airbytehq/airbyte-python-cdk repository, ignore all `__init__.py` files when providing a recommended reviewing order.
📚 Learning: 2024-12-11T16:34:46.319Z
Learnt from: pnilan
Repo: airbytehq/airbyte-python-cdk PR: 0
File: :0-0
Timestamp: 2024-12-11T16:34:46.319Z
Learning: In the airbytehq/airbyte-python-cdk repository, the `declarative_component_schema.py` file is auto-generated from `declarative_component_schema.yaml` and should be ignored in the recommended reviewing order.

Applied to files:

  • airbyte_cdk/sources/declarative/models/declarative_component_schema.py
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml
  • airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py
📚 Learning: 2024-11-18T23:40:06.391Z
Learnt from: ChristoGrab
Repo: airbytehq/airbyte-python-cdk PR: 58
File: airbyte_cdk/sources/declarative/yaml_declarative_source.py:0-0
Timestamp: 2024-11-18T23:40:06.391Z
Learning: When modifying the `YamlDeclarativeSource` class in `airbyte_cdk/sources/declarative/yaml_declarative_source.py`, avoid introducing breaking changes like altering method signatures within the scope of unrelated PRs. Such changes should be addressed separately to minimize impact on existing implementations.

Applied to files:

  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml
🧬 Code graph analysis (2)
airbyte_cdk/sources/declarative/async_job/job_orchestrator.py (1)
airbyte_cdk/sources/declarative/async_job/status.py (1)
  • AsyncJobStatus (9-25)
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py (1)
airbyte_cdk/sources/declarative/async_job/status.py (1)
  • AsyncJobStatus (9-25)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Check: source-shopify
  • GitHub Check: Check: destination-motherduck
  • GitHub Check: Check: source-pokeapi
  • GitHub Check: Check: source-intercom
  • GitHub Check: Check: source-hardcoded-records
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.12, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.13, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Manifest Server Docker Image Build
  • GitHub Check: Analyze (python)
🔇 Additional comments (5)
airbyte_cdk/sources/declarative/async_job/status.py (1)

14-14: LGTM! Clean addition of IGNORE status.

The new IGNORE enum member follows the exact same pattern as the other terminal statuses, and the is_terminal() method will handle it correctly. Nice and consistent implementation.

airbyte_cdk/sources/declarative/models/declarative_component_schema.py (1)

1209-1209: Good addition of the optional ignore field.

Making the ignore field optional (while the other status fields are required) is the right choice for backward compatibility. This allows existing configurations to continue working without specifying ignore status mappings.

Note: Based on learnings, this file is auto-generated from declarative_component_schema.yaml, so any manual edits would be overwritten.

airbyte_cdk/sources/declarative/declarative_component_schema.yaml (1)

3866-3869: Schema maps IGNORE states

Appreciate the extra ignore bucket here—this lets manifest authors cleanly route API statuses to the new terminal state without workarounds.

airbyte_cdk/sources/declarative/async_job/job_orchestrator.py (1)

103-105: Orchestrator short-circuits IGNORE partitions cleanly

Nice touch treating IGNORE as a terminal outcome and freeing resources immediately; this keeps the retry/error paths untouched while honoring the new status.

Also applies to: 371-374

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py (1)

3564-3565: LGTM!

The new case for "ignore" status is implemented correctly and consistently with the existing status cases. It properly returns AsyncJobStatus.IGNORE as defined in the enum.

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

PyTest Results (Full)

3 820 tests   3 808 ✅  11m 9s ⏱️
    1 suites     12 💤
    1 files        0 ❌

Results for commit 48880e3.

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.

2 participants