Skip to content

fix(declarative): keep components code out of AirbyteCodeTamperedError and match standard-test checksums - #1196

Merged
Baz (bazarnov) merged 1 commit into
mainfrom
bazarnov/fix-components-checksum-error-message
Oct 2, 2026
Merged

Baz (bazarnov) merged 1 commit into
mainfrom
bazarnov/fix-components-checksum-error-message

Conversation

@bazarnov

Copy link
Copy Markdown
Contributor

Summary

Two small problems found while tracing #645:

  1. AirbyteCodeTamperedError puts the whole components.py (code_text) into its message, next to both checksums. The message lands in job failure reasons, the SDM trace message and logs. That exposes customer code, including anything hardcoded in it that the secret filter does not know about, and makes the error very long.
  2. md5_checksum in the standard tests hashes the raw file bytes, while create_connector injects read_text(), which applies universal newlines and the locale encoding. A components.py with CRLF line endings, or a non-UTF-8 locale, fails the checksum in the standard tests only.

Changes

  • validate_python_code drops code_text from the error. Both checksums stay.
  • md5_checksum hashes read_text().encode(), the same text that is injected, encoded as UTF-8 the way _hash_text and the manifest server do.

Compatibility

  • The error text changes only on a checksum mismatch. Nothing in this repo or the monorepo parses it.
  • None of the 56 monorepo components.py files has CRLF line endings, and all are valid UTF-8, so their standard-test checksums are unchanged (raw-bytes and text hashes compared for every file).

Tests

  • test_invalid_checksum_fails_to_run[md5|sha256] asserts the exact error message: both checksums and no code.
  • test_md5_checksum_matches_injected_text_with_crlf: a CRLF components.py gets a checksum that validate_python_code accepts for its read_text().

All 3 fail on main. unit_tests/source_declarative_manifest and unit_tests/test: 140 passed.

Fixes #1187

…r and hash the injected text in standard tests
@bazarnov
Baz (bazarnov) requested a review from a team as a code owner October 2, 2026 09:16
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

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@bazarnov/fix-components-checksum-error-message#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 bazarnov/fix-components-checksum-error-message

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
  • /prerelease - Triggers a prerelease publish with default arguments
  • /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
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

PyTest Results (Fast)

4 923 tests  +1   4 911 ✅ +1   10m 57s ⏱️ +6s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 3b317b7. ± Comparison against base commit d5536bc.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

PyTest Results (Full)

4 926 tests   4 914 ✅  12m 2s ⏱️
    1 suites     12 💤
    1 files        0 ❌

Results for commit 3b317b7.

@bazarnov
Baz (bazarnov) merged commit c756dce into main Oct 2, 2026
29 of 30 checks passed
@bazarnov
Baz (bazarnov) deleted the bazarnov/fix-components-checksum-error-message branch October 2, 2026 11:42
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.

AirbyteCodeTamperedError embeds the full components code; standard tests hash different text than they inject

2 participants