A teammate wants to put business logic in a 400-line GitHub Actions YAML with inline Bash. You suggest Python. How do you justify it?
BeginnerScenarioTesting, CI/CD, packaging & services
Answer
Situation read → Logic in YAML is untestable and hard to debug.
What I'd do →
- Move logic into a Python module in the repo with a CLI, tested with pytest.
- The workflow just calls
python -m tools.release --version ${{ github.ref_name }}. - Same tool runs locally for debugging.
Why → Testable, reviewable, runnable locally, portable across CI systems.
Interview tip → "Keep pipelines thin, put logic in versioned code."
More on Testing, CI/CD, packaging & services
You join a team whose Python automation repo has no tests. Where do you start?BeginnerYour pytest suite takes 12 minutes. How do you speed it up?IntermediateA test passes locally but fails in CI only when run with the rest of the suite. What do you suspect?IntermediateYou want a reusable CI pipeline for 15 Python tool repos. What goes in it?IntermediateYour Python Docker image is 1.1 GB. How do you shrink it?IntermediateYou want to distribute an internal CLI to 200 engineers. What are your options?Intermediate