From b8992331386100141008304352997dabf4ac48b6 Mon Sep 17 00:00:00 2001 From: Samah Keshiro Date: Sun, 18 Oct 2026 15:03:41 -0400 Subject: [PATCH 1/7] Add pricing module, tests and Jenkinsfile for CI (#11) --- .gitignore | 1 + Jenkinsfile | 40 ++++++++++++++++++++++++++++++++++++++++ pricing.py | 8 ++++++++ tests/test_pricing.py | 16 ++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 .gitignore create mode 100644 Jenkinsfile create mode 100644 pricing.py create mode 100644 tests/test_pricing.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c18dd8d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__/ diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..5a339af --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,40 @@ +// CI pipeline for Scrap-Web (SSW 590, Continuous Integration with Jenkins). +// Runs for every pull request through the Multibranch Pipeline job and reports +// its result to Gitea as a commit status. Uses only the Python 3 standard +// library, so no packages are downloaded during the build. +pipeline { + // Builds run on the Jenkins controller executor (see the IT manual for the + // documented risk). python3 must be installed in the Jenkins container. + agent any + + options { + skipDefaultCheckout() + timeout(time: 10, unit: 'MINUTES') + } + + stages { + stage('Checkout') { + steps { + checkout scm + // Record exactly which commit is being tested, for traceability. + sh 'git rev-parse HEAD' + sh 'python3 --version' + } + } + stage('Syntax check') { + steps { + sh 'python3 -m py_compile pricing.py tests/test_pricing.py' + } + } + stage('Test') { + steps { + sh 'python3 -m unittest discover -s tests -v' + } + } + } + + post { + success { echo 'All checks passed.' } + failure { echo 'A stage failed: see the stage view for which one.' } + } +} diff --git a/pricing.py b/pricing.py new file mode 100644 index 0000000..32ec2d1 --- /dev/null +++ b/pricing.py @@ -0,0 +1,8 @@ +"""Pricing helper for the Scrap-Web CI pipeline (SSW 590, Jenkins assignment).""" + + +def total_price(unit_price, quantity): + """Return the total price for `quantity` items at `unit_price` each.""" + if quantity < 1: + raise ValueError("Quantity must be positive") + return unit_price * quantity diff --git a/tests/test_pricing.py b/tests/test_pricing.py new file mode 100644 index 0000000..722298a --- /dev/null +++ b/tests/test_pricing.py @@ -0,0 +1,16 @@ +import unittest + +from pricing import total_price + + +class PricingTests(unittest.TestCase): + def test_total(self): + self.assertEqual(total_price(10, 3), 30) + + def test_invalid_quantity(self): + with self.assertRaises(ValueError): + total_price(10, 0) + + +if __name__ == "__main__": + unittest.main() -- 2.52.0 From ab0bcc25f30cd986b1eae7cd685ab3b8cf480ee0 Mon Sep 17 00:00:00 2001 From: Samah Keshiro Date: Fri, 23 Oct 2026 22:32:31 -0400 Subject: [PATCH 2/7] Demonstrate failing CI check: use addition in total_price (#11) --- pricing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pricing.py b/pricing.py index 32ec2d1..c6d18b6 100644 --- a/pricing.py +++ b/pricing.py @@ -5,4 +5,4 @@ def total_price(unit_price, quantity): """Return the total price for `quantity` items at `unit_price` each.""" if quantity < 1: raise ValueError("Quantity must be positive") - return unit_price * quantity + return unit_price + quantity -- 2.52.0 From 091a9a9695eae9c00224c1b86220210b80e06281 Mon Sep 17 00:00:00 2001 From: Samah Keshiro Date: Fri, 23 Oct 2026 22:36:04 -0400 Subject: [PATCH 3/7] Update repository with local changes --- git | 0 issue-5 | 0 manual/devopsAutomatedManualBuild.tex | 261 ++++++++++++++++++++++++++ 3 files changed, 261 insertions(+) create mode 100644 git create mode 100644 issue-5 create mode 100644 manual/devopsAutomatedManualBuild.tex diff --git a/git b/git new file mode 100644 index 0000000..e69de29 diff --git a/issue-5 b/issue-5 new file mode 100644 index 0000000..e69de29 diff --git a/manual/devopsAutomatedManualBuild.tex b/manual/devopsAutomatedManualBuild.tex new file mode 100644 index 0000000..9435e14 --- /dev/null +++ b/manual/devopsAutomatedManualBuild.tex @@ -0,0 +1,261 @@ +\chapter{Automated Manual Build} +\ChapterLabel{AutomatedManualBuild} +\index{Gitea Actions} +\index{automated manual build} + +% --------------------------------------------------------------------------- +% Bracketed italic text marks evidence that is added once the runner is online +% and a real workflow run exists. Replace each placeholder with the actual +% value or screenshot; do not fill them in before the run has happened. +% --------------------------------------------------------------------------- + +\section{Source and Trigger} + +\textbf{Repository and files:} +\begin{description} + \item[Repository:] \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web} + \item[Manual source folder:] + \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/manual} + \item[Main file:] + \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/manual/devopsAssignment.tex} + \item[Workflow:] + \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/.gitea/workflows/manual.yml} + \item[Tracking issue:] + \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/issues/8} + \item[Pull request:] \textit{[link to the merged pull request from + \texttt{issue-8} into \texttt{main}]} +\end{description} + +The manual is stored in the \texttt{manual/} folder of the team's existing +product repository, Scrap-Web, rather than in a separate repository. The +complete buildable project is version-controlled there: every chapter file, +the \texttt{cornell.cls} document class, the \texttt{IEEEtran.bst} +bibliography style, \texttt{devopsReferences.bib}, the glossary, and all +figures under \texttt{HW2 images/} and \texttt{HW4 images/}. Generated files +(PDF, \texttt{.aux}, \texttt{.log}, minted cache, and so on) are excluded by +\texttt{manual/.gitignore}, so the repository holds source only. The +repository is the source of truth; the PDF is never edited directly. + +\textbf{How the source was added:} the manual was committed on the branch +\texttt{issue-8} (tracked by issue \#8), pushed to Gitea, and merged into +\texttt{main} through a pull request. Work on the website itself happens on +other branches and is unaffected. + +\textbf{Selected branch and event:} the workflow runs on a \texttt{push} to +\texttt{main}. A path filter limits it to pushes that change +\texttt{manual/**} or the workflow file itself, so website-only commits do +not rebuild the manual. Merging a pull request into \texttt{main} counts as +such a push. The workflow can also be started by hand from the Actions tab +(\texttt{workflow\_dispatch}). + +\textit{[Figure: Actions tab showing a run triggered by the merge commit into +\texttt{main}, dated.]} + +\textbf{Git remote and network path:} team members push over HTTPS. The +remote is configured as: +\begin{verbatim} +$ git remote -v +origin https://git.ssw590-08.me/SSW-590-08/Scrap-Web.git (fetch) +origin https://git.ssw590-08.me/SSW-590-08/Scrap-Web.git (push) +\end{verbatim} + +\begin{center} +\begin{tabular}{lll} +\toprule +Hop & Port & Exposure \\ +\midrule +Laptop $\rightarrow$ Caddy (TLS proxy) & 443/TCP (HTTPS) & Public \\ +Caddy $\rightarrow$ Gitea web service & 3000/TCP (HTTP) & Private Docker network only \\ +\bottomrule +\end{tabular} +\end{center} + +A \texttt{git push} connects to \texttt{git.ssw590-08.me} on port 443, +exactly as a browser does. Caddy terminates TLS and forwards the request over +the internal Docker network to Gitea on port 3000, which is not published to +the internet. Gitea's public root URL is set to +\url{https://git.ssw590-08.me/}, so clone URLs and links point at the HTTPS +hostname. SSH pushes are not needed for this assignment. + +\textbf{Why the runner needs no public port:} the runner never receives +connections. It contacts Gitea outbound over HTTPS to register and to poll +for jobs; the job then checks out the source and uploads the PDF over the +same HTTPS URL. Because all traffic is initiated by the runner, no submission +or management port has to be opened for it. + +\section{Runner Setup} +\textit{[To be completed with the runner registration (Part 2): version, +location, scope, label \texttt{latex}, execution mode, capacity, network path, +and a screenshot of the runner online with a job assigned.]} + +\section{Reproducible Compilation} + +\begin{description} + \item[Main file:] \texttt{manual/devopsAssignment.tex} + \item[Build command:] \texttt{latexmk devopsAssignment.tex}, run in the + \texttt{manual/} folder + \item[Build configuration:] \texttt{manual/.latexmkrc} + \item[Expected PDF path:] \texttt{manual/devopsAssignment.pdf} + \item[Job image definition:] \texttt{manual/ci/Dockerfile} + \item[Base image:] \texttt{texlive/texlive:TL2025-historic} + \item[Resolved image ID/digest:] \textit{[from the runner host]} +\end{description} + +\textbf{Where TeX runs:} the compiler is not installed in the Gitea +container. The workflow targets the runner label \texttt{latex} +(\texttt{runs-on: latex}), which maps to a job image built from +\texttt{manual/ci/Dockerfile}. That image is the official TeX Live image, +which already contains \texttt{pdflatex}, \texttt{latexmk}, \texttt{bibtex}, +\texttt{makeindex}, \texttt{makeglossaries}, and Python with Pygments (needed +by the \texttt{minted} package). The Dockerfile adds only Node.js and Git from +the image's own Debian package repositories, which the checkout and upload +actions require; no external script is downloaded and executed. The base +image uses a fixed TeX Live release tag rather than \texttt{latest}, so every +build uses the same toolchain. + +\textbf{Build command and dependencies:} all compiler options are stored in +\texttt{manual/.latexmkrc}, so the same command works on a laptop and in the +workflow: +\begin{minted}[breaklines]{perl} +$pdf_mode = 1; +$pdflatex = 'pdflatex -shell-escape -interaction=nonstopmode -halt-on-error -file-line-error %O %S'; +add_cus_dep('glo', 'gls', 0, 'run_makeglossaries'); +add_cus_dep('acn', 'acr', 0, 'run_makeglossaries'); +sub run_makeglossaries { return system("makeglossaries \"$_[0]\""); } +\end{minted} +\texttt{latexmk} runs \texttt{pdflatex} as many times as needed and calls +\texttt{bibtex}, \texttt{makeindex}, and \texttt{makeglossaries} when their +inputs change. \texttt{-shell-escape} is required by \texttt{minted}. + +\textbf{Workflow:} the complete workflow file is shown below. +\begin{minted}[breaklines]{yaml} +name: Build IT manual + +on: + push: + branches: [main] + paths: + - 'manual/**' + - '.gitea/workflows/manual.yml' + workflow_dispatch: + +jobs: + build-manual: + runs-on: latex + defaults: + run: + shell: bash + steps: + - name: Check out the triggering commit + uses: actions/checkout@v4 + + - name: Record build identity and toolchain + run: | + SHORT_SHA="${GITHUB_SHA::7}" + echo "SHORT_SHA=${SHORT_SHA}" >> "$GITHUB_ENV" + echo "Commit: ${GITHUB_SHA} (${SHORT_SHA})" + echo "Run number: ${GITHUB_RUN_NUMBER}" + pdflatex --version | head -n 1 + latexmk -v | head -n 2 | tail -n 1 + python3 -c "import pygments; print('Pygments', pygments.__version__)" + + - name: Compile the manual + working-directory: manual + run: latexmk devopsAssignment.tex + + - name: Verify the PDF exists + working-directory: manual + run: | + if [ ! -s devopsAssignment.pdf ]; then + echo "ERROR: manual/devopsAssignment.pdf is missing or empty" + exit 1 + fi + ls -l devopsAssignment.pdf + + - name: Upload the PDF as an artifact + uses: actions/upload-artifact@v4 + with: + name: it-manual-build-${{ github.run_number }}-${{ env.SHORT_SHA }} + path: manual/devopsAssignment.pdf + if-no-files-found: error + retention-days: 30 +\end{minted} + +\textbf{Failure detection:} the build fails in three independent ways. +\begin{enumerate} + \item A LaTeX error stops \texttt{pdflatex} immediately + (\texttt{-halt-on-error}); \texttt{latexmk} then exits with a non-zero + code, which fails the \emph{Compile the manual} step. The log shows the + failing file and line (\texttt{-file-line-error}). + \item If compilation reports success but the PDF is missing or empty, the + \emph{Verify the PDF exists} step exits with code 1 and prints an error. + \item The upload step uses \texttt{if-no-files-found: error}, so it cannot + silently upload nothing. +\end{enumerate} +A failed step stops the job, so no artifact is produced from a broken build. + +\textbf{Checkout and upload without a shared filesystem:} the job container +shares no files with Gitea. The \texttt{actions/checkout} step clones the +exact triggering commit from Gitea over HTTPS, the compile happens inside the +temporary job container, and \texttt{actions/upload-artifact} sends the PDF +back to Gitea over HTTPS, where it is attached to the matching run. The +container is discarded when the job ends. + +\textit{[Link to a successful run log, and a dated screenshot of the +compile and verify steps passing.]} + +\section{PDF Version Traceability} +\textit{[To be completed (Part 4): human-maintained version, generated build +identifier such as \texttt{v1.4+build.N.abcdef0}, visible commit hash and run +number in the PDF, matching Gitea run, and how the metadata is injected +without committing back to the branch.]} + +\section{Downloadable Artifact} + +\begin{description} + \item[Artifact name:] \texttt{it-manual-build-\textit{N}-\textit{H}}, + where \textit{N} is the workflow run number and \textit{H} is the short + commit hash; for example, \texttt{it-manual-build-12-a1b2c3d} + \item[Contents:] \texttt{devopsAssignment.pdf} + \item[Retention:] 30 days, set in the workflow + (\texttt{retention-days: 30}). \textit{[Confirm the server's maximum + artifact retention; Gitea applies the lower of the two.]} + \item[Example artifact link:] \textit{[link to the artifact on a successful + run]} +\end{description} + +Because the run number and commit hash are part of the artifact name, each +downloaded file can be matched to the run and commit that produced it. + +\textbf{How a team member downloads the PDF:} +\begin{enumerate} + \item Open \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/actions}. + \item Select the \emph{Build IT manual} workflow and open the run for the + commit of interest (the run lists its commit hash and branch). + \item Confirm the run finished successfully. + \item In the run's \emph{Artifacts} section, click + \texttt{it-manual-build-\ldots} to download it, then extract and open + \texttt{devopsAssignment.pdf}. +\end{enumerate} + +Artifacts expire after the retention period and are not a backup. The +permanent record is the LaTeX source in Git, from which any version of the +manual can be rebuilt. + +\textit{[Figure: run page with the artifact listed, and the downloaded PDF +open, dated.]} + +\section{Change, Failure, and Repair Evidence} +\textit{[To be completed together (Part 6): two successive commits with +their runs and PDF identifiers, one deliberate LaTeX error with its failed +run, and the repaired passing run.]} + +\section{Runner and Secret Boundary} +\textit{[To be completed (Part 7): workflow edit rights, where the runner +registration token is stored (without its value), runner isolation, and +Docker socket risk.]} + +\section{Manual Quality and Controls} +\textit{[To be completed (Part 8): version and history update, whether the +Hosts and Passwords tables changed, and a short failed-build troubleshooting +procedure.]} -- 2.52.0 From 81c343ddb69321beac822d242c3a19f182f9a486 Mon Sep 17 00:00:00 2001 From: Samah Keshiro Date: Fri, 23 Oct 2026 22:41:45 -0400 Subject: [PATCH 4/7] Fix total_price: restore multiplication (#11) --- pricing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pricing.py b/pricing.py index c6d18b6..32ec2d1 100644 --- a/pricing.py +++ b/pricing.py @@ -5,4 +5,4 @@ def total_price(unit_price, quantity): """Return the total price for `quantity` items at `unit_price` each.""" if quantity < 1: raise ValueError("Quantity must be positive") - return unit_price + quantity + return unit_price * quantity -- 2.52.0 From 8ba340e32faa642ee5a759ff6ee973b1c1cf13a4 Mon Sep 17 00:00:00 2001 From: Samah Keshiro Date: Fri, 23 Oct 2026 23:01:57 -0400 Subject: [PATCH 5/7] Remove stray files from CI pull request; manual chapter moves to its own PR (#11) --- git | 0 issue-5 | 0 manual/devopsAutomatedManualBuild.tex | 261 -------------------------- 3 files changed, 261 deletions(-) delete mode 100644 git delete mode 100644 issue-5 delete mode 100644 manual/devopsAutomatedManualBuild.tex diff --git a/git b/git deleted file mode 100644 index e69de29..0000000 diff --git a/issue-5 b/issue-5 deleted file mode 100644 index e69de29..0000000 diff --git a/manual/devopsAutomatedManualBuild.tex b/manual/devopsAutomatedManualBuild.tex deleted file mode 100644 index 9435e14..0000000 --- a/manual/devopsAutomatedManualBuild.tex +++ /dev/null @@ -1,261 +0,0 @@ -\chapter{Automated Manual Build} -\ChapterLabel{AutomatedManualBuild} -\index{Gitea Actions} -\index{automated manual build} - -% --------------------------------------------------------------------------- -% Bracketed italic text marks evidence that is added once the runner is online -% and a real workflow run exists. Replace each placeholder with the actual -% value or screenshot; do not fill them in before the run has happened. -% --------------------------------------------------------------------------- - -\section{Source and Trigger} - -\textbf{Repository and files:} -\begin{description} - \item[Repository:] \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web} - \item[Manual source folder:] - \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/manual} - \item[Main file:] - \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/manual/devopsAssignment.tex} - \item[Workflow:] - \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/.gitea/workflows/manual.yml} - \item[Tracking issue:] - \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/issues/8} - \item[Pull request:] \textit{[link to the merged pull request from - \texttt{issue-8} into \texttt{main}]} -\end{description} - -The manual is stored in the \texttt{manual/} folder of the team's existing -product repository, Scrap-Web, rather than in a separate repository. The -complete buildable project is version-controlled there: every chapter file, -the \texttt{cornell.cls} document class, the \texttt{IEEEtran.bst} -bibliography style, \texttt{devopsReferences.bib}, the glossary, and all -figures under \texttt{HW2 images/} and \texttt{HW4 images/}. Generated files -(PDF, \texttt{.aux}, \texttt{.log}, minted cache, and so on) are excluded by -\texttt{manual/.gitignore}, so the repository holds source only. The -repository is the source of truth; the PDF is never edited directly. - -\textbf{How the source was added:} the manual was committed on the branch -\texttt{issue-8} (tracked by issue \#8), pushed to Gitea, and merged into -\texttt{main} through a pull request. Work on the website itself happens on -other branches and is unaffected. - -\textbf{Selected branch and event:} the workflow runs on a \texttt{push} to -\texttt{main}. A path filter limits it to pushes that change -\texttt{manual/**} or the workflow file itself, so website-only commits do -not rebuild the manual. Merging a pull request into \texttt{main} counts as -such a push. The workflow can also be started by hand from the Actions tab -(\texttt{workflow\_dispatch}). - -\textit{[Figure: Actions tab showing a run triggered by the merge commit into -\texttt{main}, dated.]} - -\textbf{Git remote and network path:} team members push over HTTPS. The -remote is configured as: -\begin{verbatim} -$ git remote -v -origin https://git.ssw590-08.me/SSW-590-08/Scrap-Web.git (fetch) -origin https://git.ssw590-08.me/SSW-590-08/Scrap-Web.git (push) -\end{verbatim} - -\begin{center} -\begin{tabular}{lll} -\toprule -Hop & Port & Exposure \\ -\midrule -Laptop $\rightarrow$ Caddy (TLS proxy) & 443/TCP (HTTPS) & Public \\ -Caddy $\rightarrow$ Gitea web service & 3000/TCP (HTTP) & Private Docker network only \\ -\bottomrule -\end{tabular} -\end{center} - -A \texttt{git push} connects to \texttt{git.ssw590-08.me} on port 443, -exactly as a browser does. Caddy terminates TLS and forwards the request over -the internal Docker network to Gitea on port 3000, which is not published to -the internet. Gitea's public root URL is set to -\url{https://git.ssw590-08.me/}, so clone URLs and links point at the HTTPS -hostname. SSH pushes are not needed for this assignment. - -\textbf{Why the runner needs no public port:} the runner never receives -connections. It contacts Gitea outbound over HTTPS to register and to poll -for jobs; the job then checks out the source and uploads the PDF over the -same HTTPS URL. Because all traffic is initiated by the runner, no submission -or management port has to be opened for it. - -\section{Runner Setup} -\textit{[To be completed with the runner registration (Part 2): version, -location, scope, label \texttt{latex}, execution mode, capacity, network path, -and a screenshot of the runner online with a job assigned.]} - -\section{Reproducible Compilation} - -\begin{description} - \item[Main file:] \texttt{manual/devopsAssignment.tex} - \item[Build command:] \texttt{latexmk devopsAssignment.tex}, run in the - \texttt{manual/} folder - \item[Build configuration:] \texttt{manual/.latexmkrc} - \item[Expected PDF path:] \texttt{manual/devopsAssignment.pdf} - \item[Job image definition:] \texttt{manual/ci/Dockerfile} - \item[Base image:] \texttt{texlive/texlive:TL2025-historic} - \item[Resolved image ID/digest:] \textit{[from the runner host]} -\end{description} - -\textbf{Where TeX runs:} the compiler is not installed in the Gitea -container. The workflow targets the runner label \texttt{latex} -(\texttt{runs-on: latex}), which maps to a job image built from -\texttt{manual/ci/Dockerfile}. That image is the official TeX Live image, -which already contains \texttt{pdflatex}, \texttt{latexmk}, \texttt{bibtex}, -\texttt{makeindex}, \texttt{makeglossaries}, and Python with Pygments (needed -by the \texttt{minted} package). The Dockerfile adds only Node.js and Git from -the image's own Debian package repositories, which the checkout and upload -actions require; no external script is downloaded and executed. The base -image uses a fixed TeX Live release tag rather than \texttt{latest}, so every -build uses the same toolchain. - -\textbf{Build command and dependencies:} all compiler options are stored in -\texttt{manual/.latexmkrc}, so the same command works on a laptop and in the -workflow: -\begin{minted}[breaklines]{perl} -$pdf_mode = 1; -$pdflatex = 'pdflatex -shell-escape -interaction=nonstopmode -halt-on-error -file-line-error %O %S'; -add_cus_dep('glo', 'gls', 0, 'run_makeglossaries'); -add_cus_dep('acn', 'acr', 0, 'run_makeglossaries'); -sub run_makeglossaries { return system("makeglossaries \"$_[0]\""); } -\end{minted} -\texttt{latexmk} runs \texttt{pdflatex} as many times as needed and calls -\texttt{bibtex}, \texttt{makeindex}, and \texttt{makeglossaries} when their -inputs change. \texttt{-shell-escape} is required by \texttt{minted}. - -\textbf{Workflow:} the complete workflow file is shown below. -\begin{minted}[breaklines]{yaml} -name: Build IT manual - -on: - push: - branches: [main] - paths: - - 'manual/**' - - '.gitea/workflows/manual.yml' - workflow_dispatch: - -jobs: - build-manual: - runs-on: latex - defaults: - run: - shell: bash - steps: - - name: Check out the triggering commit - uses: actions/checkout@v4 - - - name: Record build identity and toolchain - run: | - SHORT_SHA="${GITHUB_SHA::7}" - echo "SHORT_SHA=${SHORT_SHA}" >> "$GITHUB_ENV" - echo "Commit: ${GITHUB_SHA} (${SHORT_SHA})" - echo "Run number: ${GITHUB_RUN_NUMBER}" - pdflatex --version | head -n 1 - latexmk -v | head -n 2 | tail -n 1 - python3 -c "import pygments; print('Pygments', pygments.__version__)" - - - name: Compile the manual - working-directory: manual - run: latexmk devopsAssignment.tex - - - name: Verify the PDF exists - working-directory: manual - run: | - if [ ! -s devopsAssignment.pdf ]; then - echo "ERROR: manual/devopsAssignment.pdf is missing or empty" - exit 1 - fi - ls -l devopsAssignment.pdf - - - name: Upload the PDF as an artifact - uses: actions/upload-artifact@v4 - with: - name: it-manual-build-${{ github.run_number }}-${{ env.SHORT_SHA }} - path: manual/devopsAssignment.pdf - if-no-files-found: error - retention-days: 30 -\end{minted} - -\textbf{Failure detection:} the build fails in three independent ways. -\begin{enumerate} - \item A LaTeX error stops \texttt{pdflatex} immediately - (\texttt{-halt-on-error}); \texttt{latexmk} then exits with a non-zero - code, which fails the \emph{Compile the manual} step. The log shows the - failing file and line (\texttt{-file-line-error}). - \item If compilation reports success but the PDF is missing or empty, the - \emph{Verify the PDF exists} step exits with code 1 and prints an error. - \item The upload step uses \texttt{if-no-files-found: error}, so it cannot - silently upload nothing. -\end{enumerate} -A failed step stops the job, so no artifact is produced from a broken build. - -\textbf{Checkout and upload without a shared filesystem:} the job container -shares no files with Gitea. The \texttt{actions/checkout} step clones the -exact triggering commit from Gitea over HTTPS, the compile happens inside the -temporary job container, and \texttt{actions/upload-artifact} sends the PDF -back to Gitea over HTTPS, where it is attached to the matching run. The -container is discarded when the job ends. - -\textit{[Link to a successful run log, and a dated screenshot of the -compile and verify steps passing.]} - -\section{PDF Version Traceability} -\textit{[To be completed (Part 4): human-maintained version, generated build -identifier such as \texttt{v1.4+build.N.abcdef0}, visible commit hash and run -number in the PDF, matching Gitea run, and how the metadata is injected -without committing back to the branch.]} - -\section{Downloadable Artifact} - -\begin{description} - \item[Artifact name:] \texttt{it-manual-build-\textit{N}-\textit{H}}, - where \textit{N} is the workflow run number and \textit{H} is the short - commit hash; for example, \texttt{it-manual-build-12-a1b2c3d} - \item[Contents:] \texttt{devopsAssignment.pdf} - \item[Retention:] 30 days, set in the workflow - (\texttt{retention-days: 30}). \textit{[Confirm the server's maximum - artifact retention; Gitea applies the lower of the two.]} - \item[Example artifact link:] \textit{[link to the artifact on a successful - run]} -\end{description} - -Because the run number and commit hash are part of the artifact name, each -downloaded file can be matched to the run and commit that produced it. - -\textbf{How a team member downloads the PDF:} -\begin{enumerate} - \item Open \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/actions}. - \item Select the \emph{Build IT manual} workflow and open the run for the - commit of interest (the run lists its commit hash and branch). - \item Confirm the run finished successfully. - \item In the run's \emph{Artifacts} section, click - \texttt{it-manual-build-\ldots} to download it, then extract and open - \texttt{devopsAssignment.pdf}. -\end{enumerate} - -Artifacts expire after the retention period and are not a backup. The -permanent record is the LaTeX source in Git, from which any version of the -manual can be rebuilt. - -\textit{[Figure: run page with the artifact listed, and the downloaded PDF -open, dated.]} - -\section{Change, Failure, and Repair Evidence} -\textit{[To be completed together (Part 6): two successive commits with -their runs and PDF identifiers, one deliberate LaTeX error with its failed -run, and the repaired passing run.]} - -\section{Runner and Secret Boundary} -\textit{[To be completed (Part 7): workflow edit rights, where the runner -registration token is stored (without its value), runner isolation, and -Docker socket risk.]} - -\section{Manual Quality and Controls} -\textit{[To be completed (Part 8): version and history update, whether the -Hosts and Passwords tables changed, and a short failed-build troubleshooting -procedure.]} -- 2.52.0 From a5180ad78136800991ef7fda2f958efca73d840b Mon Sep 17 00:00:00 2001 From: Samah Keshiro Date: Fri, 23 Oct 2026 23:04:14 -0400 Subject: [PATCH 6/7] Demonstrate failing CI check: use addition in total_price (#N) --- pricing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pricing.py b/pricing.py index 32ec2d1..c6d18b6 100644 --- a/pricing.py +++ b/pricing.py @@ -5,4 +5,4 @@ def total_price(unit_price, quantity): """Return the total price for `quantity` items at `unit_price` each.""" if quantity < 1: raise ValueError("Quantity must be positive") - return unit_price * quantity + return unit_price + quantity -- 2.52.0 From 84a44f0477dac51b540d038bf3a94b8f49bec275 Mon Sep 17 00:00:00 2001 From: Samah Keshiro Date: Fri, 23 Oct 2026 23:06:39 -0400 Subject: [PATCH 7/7] Fix total_price: restore multiplication (#11) --- pricing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pricing.py b/pricing.py index c6d18b6..32ec2d1 100644 --- a/pricing.py +++ b/pricing.py @@ -5,4 +5,4 @@ def total_price(unit_price, quantity): """Return the total price for `quantity` items at `unit_price` each.""" if quantity < 1: raise ValueError("Quantity must be positive") - return unit_price + quantity + return unit_price * quantity -- 2.52.0