Author SHA1 Message Date
sespinal b39613b2d2 Document Chapter 5 monitoring handoff and automatic trigger check
startup-product-ci/pipeline/head This commit looks good
2026-10-30 21:12:56 +00:00
sespinal 6cfac4ec1e Merge PR #9: Chapter 4 Jenkins failure and repair
startup-product-ci/pipeline/head This commit looks good
Peer review was not completed before the deadline. Sergio authorized this merge with the missing review explicitly disclosed. The required Jenkins check passed for the exact repaired head. No reviewer approval is claimed; the one-approval policy is restored after this merge.
2026-10-24 00:05:25 +00:00
sespinal ed8684a289 Fix pricing multiplication and document clean CI run for issue #8
startup-product-ci/pipeline/pr-main This commit looks good
startup-product-ci/pipeline/head This commit looks good
2026-10-21 23:11:38 +00:00
sespinal 35605c33b9 Add pricing checks and controlled defect for issue #8
startup-product-ci/pipeline/pr-main There was a failure building this commit
2026-10-21 23:07:42 +00:00
Sergio b0eee02470 add-jenkins-ci-pipeline
startup-product-ci/pipeline/head This commit looks good
2026-10-07 05:27:05 +00:00
5 changed files with 74 additions and 1 deletions
+2
View File
@@ -0,0 +1,2 @@
__pycache__/
*.py[cod]
Vendored
+27
View File
@@ -0,0 +1,27 @@
pipeline {
agent { label 'controller-small-trusted' }
options {
skipDefaultCheckout()
disableConcurrentBuilds()
timeout(time: 5, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr: '20'))
}
stages {
stage('Checkout') {
steps {
checkout scm
sh 'git rev-parse HEAD && python3 --version'
}
}
stage('Syntax check') {
steps {
sh 'python3 -m py_compile pricing.py tests/test_pricing.py'
}
}
stage('Unit tests') {
steps {
sh 'python3 -m unittest discover -s tests -v'
}
}
}
}
+24 -1
View File
@@ -6,7 +6,7 @@ This repository supports the Chapter 2 Gitea foundation assignment. It is used t
- Gitea is running from a pinned official container image. - Gitea is running from a pinned official container image.
- SQLite data and repositories are stored in persistent host-mounted storage. - SQLite data and repositories are stored in persistent host-mounted storage.
- The current HTTP URL is temporary until DNS and HTTPS are configured. - Gitea uses https://git.sespinal590.dev/ through the Caddy TLS proxy.
## Product Vision ## Product Vision
@@ -19,3 +19,26 @@ Target users are SSW 590 team members who need a shared place to plan, review, a
1. Issue tracking workflow: maintain product and operations issues with clear acceptance criteria. 1. Issue tracking workflow: maintain product and operations issues with clear acceptance criteria.
2. Pull request review workflow: require changes to be proposed on branches and reviewed before merge. 2. Pull request review workflow: require changes to be proposed on branches and reviewed before merge.
3. Operations evidence workflow: record restart, persistence, DNS, HTTPS, and firewall verification evidence in the IT manual. 3. Operations evidence workflow: record restart, persistence, DNS, HTTPS, and firewall verification evidence in the IT manual.
## Chapter 4 tested application
This repository uses the assignment manual's permitted minimal Python pricing application. `total_price` multiplies a unit price by a positive quantity and rejects zero/negative quantities. It is a course CI example, not a claim of a production pricing system.
Requirements: Python 3 (the Jenkins executor records its exact version), Git, and the Python standard library. No pip packages, Docker daemon, or Docker socket are needed for these checks.
From a clean clone, reproduce the Jenkins checks with:
```sh
python3 -m py_compile pricing.py tests/test_pricing.py
python3 -m unittest discover -s tests -v
```
Expected: syntax check exits 0; three unit tests pass. The controlled demonstration changes multiplication to addition, causing the total and single-item tests to fail. The repair restores multiplication on the same PR.
Jenkins polls Gitea for PR updates. Its multibranch source tests PR heads (not synthetic merge commits) and publishes `startup-product-ci/pipeline/pr-main` for this PR to main. Branch protection requires that check and one real peer approval, dismisses stale approvals, and disallows direct pushes and admin merge bypass. Only trusted team members may change pipeline code. Builds execute on the controller in this resource-constrained course deployment; untrusted fork PR discovery is disabled.
## Chapter 5 monitoring handoff
The monitoring deployment, recovery runbook, and measured exercise evidence live in the [team IT manual Chapter 5 branch](https://git.sespinal590.dev/group10-startup/devops-it-manual/src/branch/chapter5-sre-monitoring). Jenkins uses automatic repository polling to discover this application branch and run its unchanged syntax and three-test pricing pipeline. This documentation change provides a traceable post-recovery trigger check; it does not change application or pipeline behavior. Main remains protected and unmerged during the exercise.
+4
View File
@@ -0,0 +1,4 @@
def total_price(unit_price, quantity):
if quantity < 1:
raise ValueError("Quantity must be positive")
return unit_price * quantity
+17
View File
@@ -0,0 +1,17 @@
import unittest
from pricing import total_price
class PricingTests(unittest.TestCase):
def test_total(self):
self.assertEqual(total_price(10, 3), 30)
def test_single_item(self):
self.assertEqual(total_price(12.5, 1), 12.5)
def test_invalid_quantity(self):
for quantity in (0, -1):
with self.subTest(quantity=quantity):
with self.assertRaises(ValueError):
total_price(10, quantity)