Skip to content

Promote Phase 1 script extraction refactor to main#24

Merged
michaeldeongreen merged 2 commits into
mainfrom
test
May 9, 2026
Merged

Promote Phase 1 script extraction refactor to main#24
michaeldeongreen merged 2 commits into
mainfrom
test

Conversation

@michaeldeongreen

Copy link
Copy Markdown
Owner

Promotes the Phase 1 refactor from test to main.

What's in this promotion

Extracted inline Python from 3 reusable workflows into scripts/*.py files, plus 38 new unit tests:

  • scripts/deploy_fabric_cicd.py (extracted from reusable-deploy-supported.yml) — 6 tests
  • scripts/run_fabric_etl.py (extracted from reusable-fabric-etl.yml) — 13 tests
  • scripts/deploy_bulk.py (extracted from reusable-deploy-bulk.yml) — 19 tests

Total: 107 tests passing locally and in CI.

Risk

Low. Pure code-structure change, behavior-preserving. Already validated end-to-end in test via the fabric-cicd deploy path (DEPLOY_METHOD=fabric-cicd).

Already merged via

…t tests (#22)

Refactor only — no behavior change. Moves the Python embedded in three reusable
workflows into proper .py files for syntax highlighting, linting, local
debuggability, and unit testability.

New scripts (mechanical extraction from inline YAML):
  - scripts/deploy_fabric_cicd.py — fabric-cicd two-phase deploy
  - scripts/run_fabric_etl.py — Fabric Job runner with name resolution and LRO polling
  - scripts/deploy_bulk.py — Bulk Import API deploy with payload build, POST, LRO polling

Workflows updated to invoke 'python scripts/<name>.py' instead of 'python -c "..."'.

Small helper functions extracted from each script's main() to enable testing
of the pure logic that won't change in the upcoming bulk gap-bridging work:
  - deploy_fabric_cicd.py: remaining_types_for_phase2()
  - run_fabric_etl.py: find_item_id_by_name(), interpret_poll_response()
  - deploy_bulk.py: interpret_post_response()

Unit tests covering the helpers and the existing pure functions:
  - tests/test_deploy_bulk.py — 19 tests
  - tests/test_deploy_fabric_cicd.py — 6 tests
  - tests/test_run_fabric_etl.py — 13 tests

requirements-dev.txt: added requests, azure-identity, fabric-cicd so local
imports resolve and the test runner can import the scripts. CI installs the
same packages per workflow.
Promote refactor: extract inline Python + add unit tests
@michaeldeongreen michaeldeongreen merged commit 28305ca into main May 9, 2026
4 checks passed
michaeldeongreen added a commit that referenced this pull request May 9, 2026
Phase 1 extracted inline Python from this workflow into scripts/run_fabric_etl.py
but the corresponding actions/checkout step was never added. The other two
refactored reusables (reusable-deploy-supported.yml, reusable-deploy-bulk.yml)
both have it; only this one was missed.

Without checkout, the runner has no scripts/ directory and the python invocation
fails with 'No such file or directory'. The Phase 1 refactor's test-environment
ETL run looked successful because workflow_run-triggered workflows execute the
workflow file from the default branch — at that moment main still held the
pre-refactor inline-Python version. The bug surfaced as soon as PR #24 promoted
the refactored workflow to main, breaking the next prod ETL run.
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.

1 participant