fix: fail input drift for new integrations#42
Conversation
|
This change comes out of a case of a new integration failing the build instantly become of config/code drift. |
🚫 Blocker1. Verify
|
|
I have asked AMP to have a look at the PR |
All addressed, thx @risheetperi - item 2 I went with detecting the rename instead of documenting the gap. |
Code Review Notes
|
There was a problem hiding this comment.
Looks good to me,
Just a few things:
-
High finding (directory interpolation)
Non-blocking: Directory values are interpolated unquoted into shell - technically injection-prone, but in practice these are repo-sourced integration names so risk is low. Worth hardening later via env vars + a Bash array(read -r -a DIR_ARGS <<< "$DIRS" → "${DIR_ARGS[@]}"). -
Medium finding (
base_refvs directories)
Docs nit: Docs saybase_refis optional when directories is set, but without it README checks run with an empty ref and version checks are skipped. Trivial fix - update docs to say base_ref is always required; directories is just an auto-detection override.
Overall summary
Approving - no blockers.
Summary
This changes config/code input drift from warning-only to failure for brand-new integrations, while preserving warning-only behavior for existing integrations.
Key code changes
scripts/check_config_sync.py--base-ref <ref>.--base-refresolves to a local commit before classifying integrations, returning exit code2for missing/unfetched refs._is_new_integration(...)to detect whether<integration>/config.jsonexisted at the base ref.config.jsonand treating renamed integrations as existing.--base-ref.scripts/check_code.py--base-ref <ref>.check_config_sync(...)during the code check step.action.ymlbase_refinput intoscripts/check_code.py --base-ref ..., so PR CI gets the new behavior automatically.Cases now enforced for new integrations
These still warn for existing integrations, but fail for new integrations:
config.jsoninput_schema.input_schemabut never accessed in code.inputs.get(...).inputs["param"].Tests and fixtures
.github/workflows/self-test.ymlcheck_config_sync.py.check_config_sync.py.check_code.py --base-ref HEAD.--base-ref definitely-not-a-refregression expecting exit code2.tests/examples/input-drift/Docs updated
README.mdLOCAL_DEVELOPMENT.mdscripts/docs/check_code.mdscripts/docs/check_config_sync.mdValidation
PYTHONDONTWRITEBYTECODE=1 .venv/bin/python -m py_compile scripts/check_config_sync.py scripts/check_code.py tests/examples/input-drift/input_drift.py.venv/bin/ruff check --config ruff.toml scripts/check_config_sync.py scripts/check_code.py tests/examples/input-drift/input_drift.py.venv/bin/ruff format --check --config ruff.toml scripts/check_config_sync.py scripts/check_code.py tests/examples/input-drift/input_drift.py.venv/bin/python scripts/check_code.py --base-ref HEAD tests/examples/good-integration.venv/bin/python scripts/check_code.py --base-ref HEAD tests/examples/input-driftcheck_code.py --base-ref HEAD tmp-input-drift.2fromcheck_config_sync.py.