COMP1531

Continuous Integration

Presented by Atlassian

In this lecture

  • What is Continuous Integration?
  • Building Continuous Integration pipelines

What is it?

Continuous Integration is...

  • Tools (pipelines)?
  • Testing?
  • A process?
  • Or all of the above?

Continuous Integration

Continuous integration (CI) is the practice of automating the integration of code changes from multiple contributors into a single software project. It’s a primary DevOps best practice, allowing developers to frequently merge code changes into a central repository where builds and tests then run. Automated tools are used to assert the new code’s correctness before integration.

 

- Atlassian 

Let's build a Continuous Integration pipeline in GitLab.

image: comp1531/basic:latest
cache:
	paths:
		- node_modules

stages:
	- checks

sanity:
	stage: checks
	script:
		- echo 'Hello!'

Continuous Integration

DevOps

"Traditional" Software Development

DevOps & Continuous Integration

DevOps

  • DevOps: The consolidation of "development" and "operations"
  • Continuous Integration forms one part of the DevOps process

 

DevOps is a set of practices, tools, and a cultural philosophy that automate and integrate the processes between software development and IT teams. It emphasizes team empowerment, cross-team communication and collaboration, and technology automation.

 

- Atlassian

DevOps

Why Continuous Integration?

  • Answer: Risk
  • Automates layers of quality checks (testing, type checking, linting) on code
  • Ensures that master/main remains a "safe source of truth"
  • Provides quality assurance
  • "But miss, it works on my computer!" - CI is run in a standardised environment
  • Minimises risk by continuously integrating small changes, rather than making lots of changes at once

Minimising Risk with CI

  • Minimises risk by continuously integrating small changes, rather than making lots of changes at once
  • Generally, the more lines changed, the greater the risk
    • More accurately: The more areas of the code that your change impacts, the greater the risk (e.g. Crowdstrike)
  • Nick's advice for merge requests/pull requests:
    • ​Keep them as small as possible - if in doubt, split it up

Good Merge Request Example

Bad Merge Request Example

Continuous Integration at a larger scale

Continuous Integration at a larger scale

Continuous Integration at a larger scale