Continuous Integration
Project workbook · Path 84

Create a local CI-style pipeline that runs checks, produces an artifact only after success and records the exact source revision.

The case

A fictional calculator project has three gates: syntax, unit checks and package creation. The artifact must not be produced if a required check fails. The exercise runs locally and provides an optional workflow sketch; it does not configure a remote repository.

GateRequired outcome
Syntaxvalid Python
Behaviorall assertions pass
Packagecreated only after success
Revisionrecorded in report
STAGE 1

Define the integration contract

Continuous integration makes frequent changes subject to repeatable checks. Choose checks that catch meaningful errors and define what blocks the pipeline. A green signal only covers the checks that actually ran. This case focuses on a local repeatable build, not a claim that a hosted service has been installed.

Your task

Write the three gates and their failure behavior.

Required output

Pipeline contract

Record your result and evidence here or in a separate file.

Review gate

Required gates cannot be skipped while reporting success.

If the gate is not met

Name the actual checks instead of a generic quality passed label.

STAGE 2

Create a meaningful behavior check

A useful test compares behavior against a requirement. The sample function calculates a nonnegative seat total and rejects invalid counts. Include a boundary and an invalid case so the check can detect a real defect. Avoid testing only that a file exists or that the program prints a success message.

Your task

Run the sample tests and introduce a defect that one catches.

Required output

Behavior check evidence

Record your result and evidence here or in a separate file.

Review gate

The intentional defect makes the process exit nonzero.

If the gate is not met

Choose a requirement the defect violates.

STAGE 3

Chain the gates safely

Use explicit failure handling so a failed command stops the pipeline. Build outputs in a separate directory and record the source revision when available. A run outside Git should say revision unavailable rather than invent a commit hash. Do not let stale artifacts make a failed run appear successful.

Your task

Implement the local runner and a manifest for a successful artifact.

Required output

Pipeline runner

Record your result and evidence here or in a separate file.

Review gate

A fresh failed run produces no success artifact.

If the gate is not met

Clear only the task-owned output path or use a new run directory.

STAGE 4

Distinguish delivery from deployment

An artifact ready for review is different from a change running in production. A later deployment needs its own environment, permissions and verification. The exercise stops at packaging. Explain what would need approval and what can remain automatic in a real workflow without embedding credentials in the project.

Your task

Write a handoff note describing the boundary after packaging.

Required output

Delivery boundary note

Record your result and evidence here or in a separate file.

Review gate

No cloud deployment or remote workflow run is claimed.

If the gate is not met

Label the optional workflow as a template until it actually runs.

STAGE 5

Reproduce the result

Run from a clean copy and compare the report with the source and artifact. Save the actual command exit status and outputs. Reproducibility also needs dependency information; this case uses Python’s standard library to keep that burden small. A reviewer should be able to make the same deliberate failure occur.

Your task

Perform one passing and one intentionally failing run.

Required output

Two-run verification record

Record your result and evidence here or in a separate file.

Review gate

The success and failure reports are distinguishable and correctly linked to their inputs.

If the gate is not met

Do not overwrite a failed report with a later success.

Final project

Deliver the project, local runner, successful artifact manifest and intentional-failure evidence. Explain which checks a future hosted pipeline should run unchanged.

Critical condition

No successful artifact is reported after a required check fails, and remote execution is not invented.

CriterionPointsEvidence
Evidence and correctness30Calculations, source use and results match the supplied case; limitations are honest.
Required artifacts30All five stage outputs and the capstone handoff are present and inspectable.
Reasoning and decisions20Choices, assumptions, alternatives and the case-specific critical condition are explained.
Reproducibility10A reviewer can follow the stated steps and distinguish expected from observed results.
Clear communication10Labels, units, structure and evidence references make the work easy to review.

Score at least 80/100, supply every required artifact, and satisfy the path-specific critical condition. Rework missing evidence before marking complete.

Worked reference

The contract is syntax → behavior → package. If behavior fails, package is not reached. The reference runner records commands and statuses; it demonstrates local CI mechanics without claiming a GitHub Actions, Jenkins or other hosted run.

Boundaries

This is a local integration workflow, not a configured hosted runner or production deployment.