Repository navigation
fix(low-code): stop leaking interpolation context in undeclared-variable errors - #1241
Draft
devin-ai-integration[bot] wants to merge 1 commit into
Draft
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…ble errors Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou 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/1792510626-jinja-undeclared-vars-no-context#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/1792510626-jinja-undeclared-vars-no-contextPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JinjaInterpolation._evalraisedValueError(f"Jinja macro has undeclared variables: {...}. Context: {context}"), embedding the whole interpolation context — including the full connectorconfig(OAuth tokens, client secrets) andstream_slice. That leaked secrets and made the message non-deterministic (unordered set + varying values → no Sentry grouping).On top of that, two concurrent-path trace emitters built TRACE messages with
as_airbyte_message(), which skipsfilter_secrets, so evenairbyte_secretfields reached the platform unmasked ininternal_message/stack_trace(while the log lines for the same error were masked).Changes:
Jinja macro has undeclared variables: ['components_values']. Template: "{{ components_values['x'] }}". Available variables: ['config', 'stream_interval', 'stream_partition', 'stream_slice'].ConcurrentReadProcessor.on_exception(both branches) andAsyncJobOrchestrator._keep_api_budget_with_failed_job:as_airbyte_message()→as_sanitized_airbyte_message(), matchingAbstractSourceandAirbyteEntrypoint.Resolves https://github.com/airbytehq/oncall/issues/13791:
Close on merge: yes — internally filed, no customer to confirm with.
Review notes
ValueError, so callers that catch it are unaffected; only the message text changes.access_tokenthat isn't markedairbyte_secret). The jinja change stops these from ending up in this error. Other places that emitas_airbyte_message()(connector builder, test entrypoint wrapper) are left unchanged.fix:→ patch).Test Coverage
test_jinja.py::test_undeclared_variables_do_not_include_context_values: fake secrets / slice values are not in the message, and the message is identical across two different contexts (sorted names).test_concurrent_read_processor.py:on_exceptionmasks a registered secret for both AirbyteTracedException and plain exceptions (message,internal_message,stack_trace).test_job_orchestrator.py: a job-start failure carrying a registered secret produces a masked TRACE message on the message repository.mainand pass with this change. Targeted suites (interpolation, concurrent read processor, async_job): 289 passed. ruff + mypy are clean.Link to Devin session: https://app.devin.ai/sessions/567abed3e2c74b01a4c72b81f7a0deed
Open in Devin Desktop: https://app.devin.ai/desktop/session/567abed3e2c74b01a4c72b81f7a0deed?variant=devin