Continuous Integration

Continuous integration (CI) is the practice of frequently integrating changes into a shared codebase and running automated checks on them. It provides early feedback about defects and integration problems, but a passing pipeline does not guarantee correctness.

Continuous integration (CI) is a development practice in which team members integrate changes into a shared codebase frequently. Automated checks run on those changes so defects and integration problems can be found early.

A CI pipeline typically checks out the code, installs dependencies, and runs steps such as linting, tests, or a build. The pipeline can run for a proposed change, after it is merged, or at both points, depending on the team's workflow.

For a Python backend, useful checks might include formatting or linting, unit tests, and integration tests that exercise database or service interactions. A passing pipeline is evidence that the configured checks succeeded; it does not prove the software is free of defects.

CI works best when checks are repeatable, reasonably fast, and provide clear failure output. Teams should also make failures visible and decide how to respond, such as fixing the change or reverting it, rather than allowing a broken shared branch to persist.

Key points

Interview questions

How does CI differ from continuous delivery and continuous deployment?

CI is the practice of integrating changes frequently and validating them with automated checks. Continuous delivery builds on CI by keeping changes in a state that can be released, usually with a controlled release decision. Continuous deployment automates the release to production when its criteria are met. These terms describe different levels of automation, not interchangeable names for the same activity.

What is continuous integration, and what problem does it address?

Continuous integration is the practice of integrating code changes into a shared codebase frequently. Automated checks, such as tests and builds, run to find regressions and integration issues promptly. Teams typically make the results visible to contributors and respond to failures. CI reduces the time between introducing a problem and discovering it, but it cannot guarantee correctness.

Which checks would you put in CI for a Python backend?

I would begin with checks that provide useful feedback quickly: dependency installation, linting or formatting checks, and unit tests. I would add integration tests for important boundaries, such as database access or API behavior, where they provide meaningful coverage. The pipeline should use a reproducible environment and report failures clearly. I would avoid adding slow or unreliable checks without understanding their value and maintenance cost.

A CI pipeline is failing on the shared branch. How would you respond?

I would first determine whether the failure is caused by the change, the test, or the environment, using the logs and a reproducible run. If the change introduced a real defect, I would fix it or revert it promptly and add a regression test when appropriate. If the check is flaky or infrastructure-related, I would make that visible and address its cause rather than treating repeated reruns as a fix. Keeping the shared branch usable is more important than ignoring a red pipeline.