Author SHA1 Message Date
Sbhayana c83174f2c2 Point v1 records at surviving v1 digest, add v2 records, refuse to overwrite published tags (refs #16)
continuous-integration/jenkins Jenkins: all gates passed
2026-11-12 15:46:04 -05:00
Sbhayana 0465bde401 Merge pull request 'Pricing service v2 and v1 release records (refs #16)' (#18) from feature/pricing-v2 into main
continuous-integration/jenkins Jenkins: a gate failed or approval was not given
Reviewed-on: #18
2026-11-12 19:29:37 +00:00
Sbhayana c815e53fc2 Release v2: unit price USD 12, starter v2 source and tests (refs #16)
continuous-integration/jenkins Jenkins: all gates passed
2026-11-12 14:16:51 -05:00
Sbhayana 615fcb396a Record v1 release (Jenkins #7, digest 3c0d12eb) for staging and production (refs #16) 2026-11-12 14:16:51 -05:00
Sbhayana d4c012560d Merge pull request 'Pricing service v1 with secure delivery pipeline (refs #16)' (#17) from feature/pricing-delivery into main
continuous-integration/jenkins Jenkins: a gate failed or approval was not given
Reviewed-on: #17
2026-11-12 18:35:15 +00:00
7 changed files with 60 additions and 5 deletions
+5
View File
@@ -160,6 +160,11 @@ pipeline {
set -o pipefail
export DOCKER_CONFIG="$WORKSPACE/.docker-publish"
printf '%s' "$REG_TOKEN" | docker login "$REGISTRY" -u "$REG_USER" --password-stdin
# Releases are immutable: never overwrite an existing tag (see Chapter 6, rollback incident).
if docker manifest inspect "$IMAGE:$COMMIT" >/dev/null 2>&1; then
echo "ERROR: $IMAGE:$COMMIT is already published; releases are immutable. Use MODE=redeploy with the committed record." >&2
docker logout "$REGISTRY"; exit 1
fi
docker push "$IMAGE:$COMMIT" 2>&1 | tee reports/docker-push.log
docker rmi "$IMAGE:$COMMIT"
docker pull "$IMAGE:$COMMIT" 2>&1 | tee reports/docker-pull.log
+2 -2
View File
@@ -2,8 +2,8 @@ import os
from flask import Flask, jsonify, request
app = Flask(__name__)
VERSION = "v1"
UNIT_PRICE = 10
VERSION = "v2"
UNIT_PRICE = 12
COMMIT = os.environ.get("APP_COMMIT", "development")
+3 -3
View File
@@ -7,17 +7,17 @@ class PricingTests(unittest.TestCase):
self.client = app.test_client()
def test_price(self):
self.assertEqual(total_price(3), 30)
self.assertEqual(total_price(3), 36)
response = self.client.get("/price?quantity=3")
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json["total"], 30)
self.assertEqual(response.json["total"], 36)
def test_invalid_quantity(self):
for value in ["0", "-1", "1001", "abc", "1.5"]:
self.assertEqual(self.client.get("/price?quantity=" + value).status_code, 400)
def test_release_identity(self):
self.assertEqual(self.client.get("/").json["version"], "v1")
self.assertEqual(self.client.get("/").json["version"], "v2")
self.assertEqual(self.client.get("/health").json["status"], "ok")
+14
View File
@@ -0,0 +1,14 @@
# Release record: v1 production. Metadata only; no credentials.
# Corrected 2026-11-12: the original v1 image (sha256:3c0d12eb..., Jenkins #7) was overwritten in
# the registry when Jenkins #10 rebuilt the same commit and re-pushed the same tag. This digest is
# that rebuild of the same reviewed source commit; it passed every gate and the staging smoke test in #10.
target_env: production
release_image: git.ssw590.abrdns.com/startupteam/pricing@sha256:d4d894df4634b088e6d52cbae2128510a05d0e4e1d972f4d64ba959423c07c97
expected_version: v1
expected_commit: d4c012560d5096f399224d5b5f6516a5cb2158a4
expected_total: 30
public_url: https://app.ssw590.abrdns.com
proxy_network: startup_private
config_commit: d4c012560d5096f399224d5b5f6516a5cb2158a4
jenkins_build: https://ci.ssw590.abrdns.com/job/pricing-delivery/10/
recorded_at: 2026-11-12, see Jenkins #10
+14
View File
@@ -0,0 +1,14 @@
# Release record: v1 staging. Metadata only; no credentials.
# Corrected 2026-11-12: the original v1 image (sha256:3c0d12eb..., Jenkins #7) was overwritten in
# the registry when Jenkins #10 rebuilt the same commit and re-pushed the same tag. This digest is
# that rebuild of the same reviewed source commit; it passed every gate and the staging smoke test in #10.
target_env: staging
release_image: git.ssw590.abrdns.com/startupteam/pricing@sha256:d4d894df4634b088e6d52cbae2128510a05d0e4e1d972f4d64ba959423c07c97
expected_version: v1
expected_commit: d4c012560d5096f399224d5b5f6516a5cb2158a4
expected_total: 30
public_url: https://staging.ssw590.abrdns.com
proxy_network: startup_private
config_commit: d4c012560d5096f399224d5b5f6516a5cb2158a4
jenkins_build: https://ci.ssw590.abrdns.com/job/pricing-delivery/10/
recorded_at: 2026-11-12, see Jenkins #10
+11
View File
@@ -0,0 +1,11 @@
# Release record: v2 production. Metadata only; no credentials.
target_env: production
release_image: git.ssw590.abrdns.com/startupteam/pricing@sha256:adf58a4abcb03be98cce394d5fde1794ae77525d2e1882a8be3c59c8c3556d92
expected_version: v2
expected_commit: 0465bde4017a3d1f9e3b523dcdc065154789cad7
expected_total: 36
public_url: https://app.ssw590.abrdns.com
proxy_network: startup_private
config_commit: 0465bde4017a3d1f9e3b523dcdc065154789cad7
jenkins_build: https://ci.ssw590.abrdns.com/job/pricing-delivery/11/
recorded_at: 2026-11-12, see Jenkins #11
+11
View File
@@ -0,0 +1,11 @@
# Release record: v2 staging. Metadata only; no credentials.
target_env: staging
release_image: git.ssw590.abrdns.com/startupteam/pricing@sha256:adf58a4abcb03be98cce394d5fde1794ae77525d2e1882a8be3c59c8c3556d92
expected_version: v2
expected_commit: 0465bde4017a3d1f9e3b523dcdc065154789cad7
expected_total: 36
public_url: https://staging.ssw590.abrdns.com
proxy_network: startup_private
config_commit: 0465bde4017a3d1f9e3b523dcdc065154789cad7
jenkins_build: https://ci.ssw590.abrdns.com/job/pricing-delivery/11/
recorded_at: 2026-11-12, see Jenkins #11