Verify immutable release gates and document fixture handoff
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
Member 2 handoff — 2026-11-25
|
||||
|
||||
Owner: Gowri (Member 2), implementation assisted by Codex.
|
||||
Branch: feature/final-ci-demo
|
||||
Base: 5373351a7e7ac2bc0f34bae19c25383de3843ca7 (current merged Homework 9 main).
|
||||
Workspace: /home/codex/ssw590-member2
|
||||
Get current revision: git rev-parse HEAD
|
||||
|
||||
Implemented:
|
||||
- Independent fixture reviewer; no edits to Member 1's reviewer/demo/tests.
|
||||
- Exact-SHA/run/attempt/mode artifact contract and strict bounded ZIP parsing.
|
||||
- Gitea Actions fixture workflow using existing pins and manual-latex runner.
|
||||
- Separate Jenkins pipeline/job definition, existing assignment8-trusted agent
|
||||
and gitea-jenkins-ci credential binding (value never read).
|
||||
- Isolated pinned TeX container, final-project report mode and required chapter.
|
||||
- Durable locked versions; immutable release reuse; no conflicting overwrite.
|
||||
- ZIP manifest/hash and reviewed-file behavior gates.
|
||||
- Live-only metric emitter and dashboard proposal (not deployed).
|
||||
- 18 pipeline/publication tests passed in the pinned image; 2 existing
|
||||
pricing tests passed. Host lacks pypdf, so 4 publication tests require
|
||||
the image rather than host-only Python.
|
||||
|
||||
Observed evidence:
|
||||
- Gitea Actions run 35 succeeded on bed90200d2e309a63b644a5f138624e6710be3bf.
|
||||
- Its exact artifact was downloaded through the actual authenticated route.
|
||||
- Full final-project report compiled in the pinned container on the Droplet.
|
||||
- Fixture version 1.0.1 ZIP passed all payload hashes and fresh extraction/
|
||||
runtime smoke verification. ci/evidence/fixture-run35.json records its hash.
|
||||
- These downstream stages were executed directly in the isolated toolchain,
|
||||
NOT by a Jenkins job. Subsequent fixes/tests must retain their own run IDs.
|
||||
|
||||
Pending before calling Member 2 remotely complete:
|
||||
- User creates the prepared Jenkins job from the signed-in browser; browser
|
||||
click/type automation is unavailable in this chat. No API login was assumed.
|
||||
- Run the latest successful Actions SHA/run/attempt through the Jenkins job;
|
||||
verify credential access, stage execution and downloadable archive.
|
||||
- Rehearse downstream failure/no-publication and retry in Jenkins itself.
|
||||
- Agree source baseline and final version line with Member 1 (1.0 provisional).
|
||||
- Integrate actual model/runtime, measured token/memory results, AI/human SWOT
|
||||
text and reviewable metrics collector configuration. No fake/live substitution.
|
||||
- Record final issue/comment, cloud-load screenshots, peer review and demo.
|
||||
|
||||
Next operator action:
|
||||
Read ci/OPERATIONS.txt and ci/jenkins-job.xml. Use the provided browser setup
|
||||
snippet to create only final-project-fixture; keep existing jobs untouched.
|
||||
|
||||
Persistence/cleanup:
|
||||
Volume ssw590-final-project-state contains fixture reservations/releases.
|
||||
Temporary container names begin ssw590-final-. Remove only the known current
|
||||
container, never the state volume or unrelated application/monitoring services.
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"source_sha": "bed90200d2e309a63b644a5f138624e6710be3bf",
|
||||
"actions_run": "35",
|
||||
"mode": "fixture",
|
||||
"version": "1.0.1",
|
||||
"payload_hashes": "passed",
|
||||
"smoke": "passed",
|
||||
"zip_sha256": "ecfecf00849828e22ad8be3e9f5dd3f330993fffa30224f3ab1eff13df94f4c6",
|
||||
"execution": "isolated toolchain on Droplet; not a Jenkins job"
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
"""Publication gate tests run in the pinned compiler image (which provides pypdf)."""
|
||||
import importlib.util
|
||||
import io
|
||||
import json
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
import zipfile
|
||||
sys.path.insert(0,str(Path(__file__).resolve().parents[2]))
|
||||
from ci.final_project import identity,create_bundle,publish,digest
|
||||
|
||||
|
||||
@unittest.skipUnless(importlib.util.find_spec('pypdf'), 'pypdf is supplied by the pinned TeX image')
|
||||
class ReleaseTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
from pypdf import PdfWriter
|
||||
from pypdf.generic import DictionaryObject,NameObject,DecodedStreamObject
|
||||
self.temp=tempfile.TemporaryDirectory();self.addCleanup(self.temp.cleanup)
|
||||
self.root=Path(self.temp.name);self.meta=identity('a'*40,'1','1','fixture')
|
||||
self.review=self.root/'review';self.review.mkdir()
|
||||
(self.review/'reviewed.py').write_text('print("hello")\n')
|
||||
(self.review/'review.json').write_text(json.dumps(dict(source_commit='a'*40,model_id='fixture-model',
|
||||
mode='fixture',status='corrected',summary='fixture',diff='fixture',input_tokens=24,output_tokens=8)))
|
||||
self.bundle=self.root/'review.zip';create_bundle(self.review,self.bundle,self.meta)
|
||||
self.pdf=self.root/'main.pdf'
|
||||
writer=PdfWriter();page=writer.add_blank_page(width=1200,height=800)
|
||||
font=DictionaryObject({NameObject('/Type'):NameObject('/Font'),NameObject('/Subtype'):NameObject('/Type1'),NameObject('/BaseFont'):NameObject('/Helvetica')})
|
||||
page[NameObject('/Resources')]=DictionaryObject({NameObject('/Font'):DictionaryObject({NameObject('/F1'):font})})
|
||||
stream=DecodedStreamObject();stream.set_data(('BT /F1 10 Tf 40 700 Td (1.0.1 '+ 'a'*40+' Configuring and Running the DevOps Pipeline) Tj ET').encode())
|
||||
page[NameObject('/Contents')]=writer._add_object(stream)
|
||||
with self.pdf.open('wb') as f:writer.write(f)
|
||||
self.manifest=dict(release_version='1.0.1',commit='a'*40,review_sha256=digest((self.review/'review.json').read_bytes()),
|
||||
reviewed_sha256=digest((self.review/'reviewed.py').read_bytes()),pdf_sha256=digest(self.pdf.read_bytes()),run_id='1',attempt='1',mode='fixture')
|
||||
self.write_manifest()
|
||||
|
||||
def write_manifest(self):
|
||||
self.pdf.with_name('build-manifest.json').write_text(json.dumps(self.manifest))
|
||||
|
||||
def run_publish(self,build='1'):
|
||||
return publish(self.bundle,self.meta,self.pdf,self.root/'state',self.root/'out','1.0',build)
|
||||
|
||||
def test_publish_and_retry_preserve_bytes(self):
|
||||
name=self.run_publish();before=(self.root/'out'/name).read_bytes()
|
||||
with zipfile.ZipFile(io.BytesIO(before)) as z:
|
||||
manifest=json.loads(z.read('manifest.json'))
|
||||
for path,sha in manifest['payload_sha256'].items():self.assertEqual(digest(z.read(path)),sha)
|
||||
self.run_publish('2')
|
||||
self.assertEqual((self.root/'out'/name).read_bytes(),before)
|
||||
self.assertEqual(json.loads((self.root/'out/release.json').read_text())['jenkins_build'],'1')
|
||||
|
||||
def test_report_mismatch_prevents_release(self):
|
||||
self.manifest['reviewed_sha256']='b'*64;self.write_manifest()
|
||||
with self.assertRaisesRegex(ValueError,'manifest'):self.run_publish()
|
||||
self.assertFalse((self.root/'out').exists())
|
||||
self.assertFalse((self.root/'state/releases').exists())
|
||||
|
||||
def test_runtime_failure_prevents_release(self):
|
||||
(self.review/'reviewed.py').write_text('raise RuntimeError("fixture")\n')
|
||||
self.bundle.unlink();create_bundle(self.review,self.bundle,self.meta)
|
||||
self.manifest['reviewed_sha256']=digest((self.review/'reviewed.py').read_bytes());self.write_manifest()
|
||||
with self.assertRaisesRegex(ValueError,'smoke'):self.run_publish()
|
||||
self.assertFalse((self.root/'state/releases').exists())
|
||||
|
||||
def test_existing_version_refuses_changed_review(self):
|
||||
self.run_publish()
|
||||
data=json.loads((self.review/'review.json').read_text());data['summary']='different'
|
||||
(self.review/'review.json').write_text(json.dumps(data))
|
||||
self.bundle.unlink();create_bundle(self.review,self.bundle,self.meta)
|
||||
self.manifest['review_sha256']=digest((self.review/'review.json').read_bytes());self.write_manifest()
|
||||
with self.assertRaisesRegex(ValueError,'different reviewed payload'):self.run_publish('2')
|
||||
Reference in New Issue
Block a user