Skip to content

Conversation

aaronsteers
Copy link
Contributor

Remove dagger dependencies and replace with uv scripts

This PR targets the following PR:


Summary

Completely replaces the dagger-based containerized build system with uv scripts using inline dependencies. This change resolves the /poe build slash command failures in GitHub Actions caused by missing dagger dependencies, while maintaining identical functionality for generating pydantic models and JSON schemas from YAML files.

Key Changes:

  • Replaced dagger containerization with uv scripts that declare inline dependencies (datamodel-code-generator==0.26.3, PyYAML>=6.0.1)
  • Converted async dagger operations to synchronous subprocess calls using subprocess.run()
  • Updated shell script to use uv run instead of pip install dagger-io==0.13.3
  • Preserved all datamodel-codegen command line arguments exactly as they were
  • Maintained post-processing logic for pydantic v1 imports and deprecated field handling

Review & Testing Checklist for Human

  • Verify generated models are identical - Compare airbyte_cdk/sources/declarative/models/declarative_component_schema.py before/after this change to ensure byte-for-byte identical output
  • Test CI functionality - Verify that /poe build slash command now works in GitHub Actions without dagger dependency errors
  • Test local build process - Run poetry run poe build locally and confirm it completes successfully with same output
  • Verify JSON schema generation - Confirm airbyte_cdk/sources/declarative/generated/declarative_component_schema.json is still generated correctly
  • Check uv dependency isolation - Ensure datamodel-codegen dependencies don't leak into the main environment

Recommended Test Plan:

  1. Take a snapshot of current generated files
  2. Run the build process with these changes
  3. Compare generated files byte-for-byte
  4. Test both local execution and CI execution
  5. Verify the original dagger container behavior is fully replicated

Diagram

%%{ init : { "theme" : "default" }}%%
graph TB
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit  
        L3[Context/No Edit]:::context
    end

    YamlSchema["airbyte_cdk/sources/declarative/<br/>declarative_component_schema.yaml"]:::context
    
    BuildScript["bin/generate_component_manifest_files.py"]:::major-edit
    ShellScript["bin/generate-component-manifest-dagger.sh"]:::major-edit
    
    PyprojectToml["pyproject.toml<br/>(poe assemble task)"]:::context
    
    GeneratedModels["airbyte_cdk/sources/declarative/models/<br/>declarative_component_schema.py"]:::context
    GeneratedJson["airbyte_cdk/sources/declarative/generated/<br/>declarative_component_schema.json"]:::context
    
    YamlSchema --> BuildScript
    BuildScript --> GeneratedModels
    BuildScript --> GeneratedJson
    ShellScript --> BuildScript
    PyprojectToml --> ShellScript
    
    classDef major-edit fill:#90EE90
    classDef minor-edit fill:#87CEEB  
    classDef context fill:#FFFFFF
Loading

Notes

  • Architecture Change: This completely replaces the build system from dagger containerization to uv scripts - a significant architectural change that requires careful testing
  • Environment Parity: The uv script approach should provide the same isolation benefits as the dagger container while being much simpler
  • Dependency Versions: Preserved exact same datamodel-codegen version (0.26.3) to ensure identical pydantic v1 model generation
  • CI Fix: This change specifically addresses the ModuleNotFoundError: No module named 'dagger' that was causing /poe build slash command failures

Session Info: Requested by AJ Steers (@aaronsteers) - Session: https://app.devin.ai/sessions/5fc8aa08db104607acbe970add5f1002

devin-ai-integration bot and others added 2 commits August 7, 2025 00:45
- Replace dagger containerized execution with uv scripts using inline dependencies
- Use subprocess calls instead of async dagger operations
- Maintain identical datamodel-codegen command line arguments
- Keep same post-processing logic for pydantic imports and deprecated fields
- Update shell script to use 'uv run' instead of dagger installation

Co-Authored-By: AJ Steers <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings August 7, 2025 00:46
Copy link
Contributor

Original prompt from AJ Steers
@Devin - Can you please locate the 'build' step (also poe build) in the Python CDK? I specifically want to add a step so that in addition to building pydantic models from the yaml file (double-check I have that direction correct), we would also generate a json version of that file. The json version of the file can then be registered with <http://schemastore.org|schemastore.org>.

Copy link
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 and CI monitoring

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the dagger-based containerized build system and replaces it with simpler uv scripts to address /poe build slash command failures in GitHub Actions. The change maintains identical functionality for generating pydantic models and JSON schemas from YAML files while eliminating complex containerization dependencies.

  • Replaces dagger containerization with uv scripts using inline dependencies
  • Converts async dagger operations to synchronous subprocess calls
  • Updates shell script to use uv run instead of pip installing dagger-io
Comments suppressed due to low confidence (1)

Copy link

github-actions bot commented Aug 7, 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@devin/1754527091-remove-dagger-dependencies#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 devin/1754527091-remove-dagger-dependencies

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.

Copy link

github-actions bot commented Aug 7, 2025

PyTest Results (Fast)

3 696 tests  ±0   3 685 ✅ ±0   6m 23s ⏱️ -3s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit ecb6fae. ± Comparison against base commit bd615ad.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 7, 2025

PyTest Results (Full)

3 699 tests  ±0   3 688 ✅ ±0   11m 38s ⏱️ -1s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit ecb6fae. ± Comparison against base commit bd615ad.

♻️ This comment has been updated with latest results.

@aaronsteers
Copy link
Contributor Author

aaronsteers commented Aug 7, 2025

/poe build

Running poe build...

Link to job logs.

❌ Poe command build failed. Please inspect the logs.

devin-ai-integration bot and others added 2 commits August 7, 2025 00:53
- Restore base_model_with_deprecations.py file that was accidentally deleted
- Update pyproject.toml assemble task to use uv run instead of deleted shell script
- Regenerate models and JSON schema with working build process
- Resolves ModuleNotFoundError that was causing pytest failures

Co-Authored-By: AJ Steers <[email protected]>
- Recreate the missing base_model_with_deprecations.py file that was lost during formatting
- This resolves the ModuleNotFoundError in CI that was preventing imports
- File contains the BaseModelWithDeprecations class needed by generated models
- All local tests now pass (3694 passed) and formatting checks pass

Co-Authored-By: AJ Steers <[email protected]>
@aaronsteers aaronsteers changed the title Remove dagger dependencies and replace with uv scripts fix: remove dagger dependencies and replace with uv scripts Aug 7, 2025
@devin-ai-integration devin-ai-integration bot changed the title fix: remove dagger dependencies and replace with uv scripts chore(build): Remove dagger dependencies and replace with uv scripts Aug 7, 2025
@devin-ai-integration devin-ai-integration bot changed the title chore(build): Remove dagger dependencies and replace with uv scripts fix(build): Remove dagger dependencies and replace with uv scripts Aug 7, 2025
@github-actions github-actions bot added the bug Something isn't working label Aug 7, 2025
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file was just a shim and is deleted. Replaced in poe-tasks assemble reference with simply uv run bin/generate_component_manifest_files.py.

@aaronsteers aaronsteers merged commit 8b9171c into devin/1754519222-add-json-schema-generation Aug 28, 2025
21 checks passed
@aaronsteers aaronsteers deleted the devin/1754527091-remove-dagger-dependencies branch August 28, 2025 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant