Skip to content

fix(declarative): [DO-NOT-MERGE] pass config into declarative source - #1113

Open
Aaron ("AJ") Steers (aaronsteers) wants to merge 13 commits into
mainfrom
devin/1787019774-declarative-config-passthrough
Open

fix(declarative): [DO-NOT-MERGE] pass config into declarative source#1113
Aaron ("AJ") Steers (aaronsteers) wants to merge 13 commits into
mainfrom
devin/1787019774-declarative-config-passthrough

Conversation

@aaronsteers

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented Aug 18, 2026

Copy link
Copy Markdown
Member

Replaces: #869

Summary

This PR extends the contribution from Adileo Barone (@adileo) (thank you! 🙏), cherry-picked from #869 so the original commit authorship is preserved. Requested by Aaron ("AJ") Steers (@aaronsteers).

Closes #868.

Declarative sources were built with an effectively empty config, so every {{ config[...] }} interpolation a manifest performs at resolution time (dynamic streams, stream templates) resolved to nothing:

# before
ConcurrentDeclarativeSource(config=self._config_dict, ...)  # only ever held the components.py payload

The contributor's commits thread config from get_source()get_connector_executor()DeclarativeExecutor.__init__. The maintainer follow-ups then cover the paths that construction-time config alone misses — config supplied later via source.set_config(), and secret_reference:: values, which are only hydrated into the --config temp file at execute time:

def execute(self, args, ...):
    mapped_args = self.map_cli_args(args)
    args_config = _get_config_from_args(mapped_args)   # reads the --config temp file
    source = self._create_declarative_source({**self._config_dict, **args_config})

Constructor config stays as the fallback, and the merge order keeps the injected __injected_components_py keys intact. A missing, malformed or non-dict --config file falls back to the constructor config rather than raising.

Also in the follow-ups: config no longer defaults to a mutable {} (ruff B006) and is copied into the executor, so component injection can't mutate the caller's dict; parameters after manifest are now keyword-only, so config can't be silently bound positionally where components_py used to sit.

Test plan

New offline unit tests in tests/unit_tests/test_declarative_executor.py cover config via get_source(), config via set_config() after construction, survival of the injected components keys, and caller-dict immutability. All three fail with the fix reverted.

Manual repro of #868 against a local HTTP server, using a manifest whose url_base is {{ config['base_url'] }}, so a resolved config is observable as a real request rather than inferred:

checkout config supplied via source.check() records read requests reaching the server
main (f65f227) get_source() fail (MissingSchema) fail 0
main (f65f227) set_config() fail (MissingSchema) fail 0
this branch get_source() pass 2 /items
this branch set_config() pass 2 /items

Local checks: ruff check ., ruff format --check ., mypy airbyte, pytest tests/unit_tests/test_declarative_executor.py, pytest tests/integration_tests/destinations/test_source_to_destination.py — all pass. Credential-gated suites were not run locally.

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

@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

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This PyAirbyte Version

You can test this version of PyAirbyte using the following:

# Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1787019774-declarative-config-passthrough' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1787019774-declarative-config-passthrough'

PR Slash Commands

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

  • /fix-pr - Fixes most formatting and linting issues
  • /uv-lock - Updates uv.lock file
  • /test-pr - Runs tests with the updated PyAirbyte
  • /prerelease - Builds and publishes a prerelease version to PyPI
📚 Show Repo Guidance

Helpful Resources

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

devin-ai-integration Bot and others added 5 commits August 18, 2026 02:25
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change passes source configuration from get_source through get_connector_executor into DeclarativeExecutor, which now initializes its configuration from the provided dictionary.

Changes

Declarative configuration propagation

Layer / File(s) Summary
Declarative executor configuration
airbyte/_executors/declarative.py
DeclarativeExecutor accepts an optional config dictionary and uses it as the initial executor configuration before component injection.
Executor creation forwarding
airbyte/_executors/util.py, airbyte/sources/util.py
get_source forwards config to get_connector_executor, which passes it to DeclarativeExecutor for local, dictionary, and registry manifests.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🟡 Moderate · up to 33256

The change forwards connector configuration into declarative execution, but optional configuration can still reach component injection as None and shared defaults can leak injected data between runs; this should be corrected before merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes pass caller-provided configuration through get_source() and get_connector_executor() into DeclarativeExecutor, addressing issue #868.
Out of Scope Changes check ✅ Passed All reviewed changes support configuration propagation for declarative source initialization and remain within issue #868 scope.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: passing configuration into declarative sources.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch devin/1787019774-declarative-config-passthrough

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

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

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 3 commits August 18, 2026 02:30
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review August 18, 2026 02:34
Copilot AI lite review requested due to automatic review settings August 18, 2026 02:34

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes declarative manifest interpolation by ensuring connector configuration is available to ConcurrentDeclarativeSource during manifest resolution, including config supplied at construction time and config supplied later via --config (e.g., after source.set_config()).

Changes:

  • Threads config from get_source() through get_connector_executor() into DeclarativeExecutor.
  • Updates DeclarativeExecutor.execute() to read the --config file at runtime and merge it with constructor config when creating the declarative source.
  • Adds unit tests validating config propagation, late config handling, injected component key preservation, and caller-dict immutability.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/unit_tests/test_declarative_executor.py Adds unit tests covering declarative executor config resolution and immutability.
airbyte/sources/util.py Passes config from get_source() into the connector executor factory.
airbyte/_executors/util.py Extends get_connector_executor() to accept config and forward it to DeclarativeExecutor.
airbyte/_executors/declarative.py Accepts config in DeclarativeExecutor, reads --config at execute time, and recreates the declarative source with merged config.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 77 to 82
- If `manifest` is a path, it will be read as a json file.
- If `manifest` is a string, it will be parsed as an HTTP path.
- If `manifest` is a dict, it will be used as is.
- If `config` is provided, it will be used to resolve manifest interpolations.
- If `components_py` is provided, components will be injected into the source.
- If `components_py_checksum` is not provided, it will be calculated automatically.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🙋 Not changing here, flagging for the maintainer. Correct that those two bullets are wrong — manifest is parsed with yaml.safe_load() and the annotation is dict | Path, so neither "read as a json file" nor the str/HTTP-path bullet matches the code. Both predate this PR, though; this branch only added the config bullet. Leaving them alone to keep this diff to the #868 fix — happy to correct them here if Aaron ("AJ") Steers (@aaronsteers) prefers.

Comment on lines 156 to +162
mapped_args: list[str] = self.map_cli_args(args)
args_config = _get_config_from_args(mapped_args)
source_entrypoint = AirbyteEntrypoint(
self._create_declarative_source(
{**self._config_dict, **args_config},
)
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 On it. Agreed — the injected keys are the executor's own and shouldn't be clobberable by whatever lands in the --config file. Pushing a follow-up commit so user config still wins for normal fields while __injected_components_py* is re-applied after the merge, with a regression test that a bogus injected value in the config file is ignored.

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

github-code-quality Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: Python

Python / code-coverage/pytest-fast

The overall coverage in commit 95d7aae in the devin/1787019774-dec... branch is 69%. The coverage in commit d9f652f in the main branch is 65%.

Show a code coverage summary of the most impacted files.
File main d9f652f devin/1787019774-dec... 95d7aae +/-
airbyte/mcp/cloud.py 52% 55% +3%
airbyte/mcp/_tool_utils.py 72% 87% +15%
airbyte/mcp/server.py 69% 88% +19%
airbyte/mcp/_arg_resolvers.py 13% 44% +31%
airbyte/mcp/int...c_history_ui.py 0% 36% +36%
airbyte/mcp/int...hared_models.py 0% 81% +81%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/cloud/models.py 0% 93% +93%
airbyte/mcp/http_main.py 0% 95% +95%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest-no-creds

The overall coverage in commit 95d7aae in the devin/1787019774-dec... branch is 68%. The coverage in commit d9f652f in the main branch is 65%.

Show a code coverage summary of the most impacted files.
File main d9f652f devin/1787019774-dec... 95d7aae +/-
airbyte/mcp/cloud.py 52% 55% +3%
airbyte/mcp/_tool_utils.py 72% 87% +15%
airbyte/mcp/server.py 69% 88% +19%
airbyte/mcp/_arg_resolvers.py 13% 44% +31%
airbyte/mcp/int...c_history_ui.py 0% 36% +36%
airbyte/mcp/int...hared_models.py 0% 81% +81%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/cloud/models.py 0% 93% +93%
airbyte/mcp/http_main.py 0% 95% +95%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest

The overall coverage in commit 95d7aae in the devin/1787019774-dec... branch is 73%. The coverage in commit d9f652f in the main branch is 71%.

Show a code coverage summary of the most impacted files.
File main d9f652f devin/1787019774-dec... 95d7aae +/-
airbyte/mcp/cloud.py 52% 55% +3%
airbyte/mcp/_tool_utils.py 72% 87% +15%
airbyte/mcp/server.py 69% 88% +19%
airbyte/mcp/_arg_resolvers.py 13% 44% +31%
airbyte/mcp/int...c_history_ui.py 0% 36% +36%
airbyte/mcp/int...hared_models.py 0% 81% +81%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/cloud/models.py 0% 93% +93%
airbyte/mcp/http_main.py 0% 95% +95%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Updated August 18, 2026 03:04 UTC

@devin-ai-integration devin-ai-integration Bot changed the title fix(declarative): pass connector config into the declarative source do-not-merge: fix(declarative): pass connector config into the declarative source Aug 18, 2026
@devin-ai-integration devin-ai-integration Bot changed the title do-not-merge: fix(declarative): pass connector config into the declarative source fix(declarative): [DO-NOT-MERGE] pass config into declarative source Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeclarativeExecutor passing down empty configs

4 participants