From b636f720e9f2b31800d82e085d1178aeccfb3808 Mon Sep 17 00:00:00 2001 From: Hasko7 Date: Tue, 24 Nov 2026 22:10:58 +0300 Subject: [PATCH] Document verified CI and release protection --- CHANGELOG.md | 2 ++ PROJECT.md | 26 ++++++++++++++++-------- TODO.md | 48 +++++++++++++++++++++++++++------------------ docs/README.md | 1 + docs/development.md | 13 ++++++------ docs/releases.md | 42 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 99 insertions(+), 33 deletions(-) create mode 100644 docs/releases.md diff --git a/CHANGELOG.md b/CHANGELOG.md index dfd010d..5352b01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ development work, not a claim that a public release has been published. ### Added +- Repository safeguards requiring CI before merging into `main`, protecting + version tags from updates/deletion, and enabling immutable future releases. - Windows-native PDF OCR through PDFium and `Windows.Media.Ocr`, with a Direct-RAM pipeline and a fast path for embedded scan images. - Dynamic OCR language discovery, short language-code resolution, saved default diff --git a/PROJECT.md b/PROJECT.md index c25f012..3cad6de 100644 --- a/PROJECT.md +++ b/PROJECT.md @@ -734,8 +734,8 @@ matnocr = "matnocr.cli:app" The console entry point launches `matnocr`; `python -m matnocr` is also available. Local wheel/sdist builds, archive checks, fresh wheel installation, -and CLI smoke checks have passed on Python 3.13. Validation on the GitHub runner -and across the full Python matrix remains part of the CI and packaging roadmap. +and CLI smoke checks have passed locally on Python 3.13 and on GitHub's +`windows-2025` runner across Python 3.11–3.14. Publishing remains planned work. ## 16. Installation for Users @@ -830,14 +830,16 @@ with: GitHub Actions CI is configured in `.github/workflows/ci.yml`. It runs on pushes to `main`, pull requests targeting `main`, and manual dispatch. The application jobs use `windows-2025` with Python 3.11, 3.12, 3.13, and 3.14. -The first hosted run must still confirm compatibility and actual OCR capability -availability; Windows Server language packs must not be assumed to match a -Windows desktop. +The hosted matrix has passed on all four Python versions. The verified runner +provides `en-US`: 142 tests pass per version, and German and Arabic OCR tests +skip their missing language packs. Locally, all 144 tests pass on Python 3.13 +with those packs installed. Hosted results do not establish real German or +Arabic OCR compatibility on every Python version. The workflow pins uv 0.12.19 and action commit SHAs, uses read-only repository permissions, and does not publish packages. A final `CI` job combines the Windows -matrix results and can become the required branch-protection check after the -first successful hosted run. This gate uses Ubuntu only to combine results. +matrix results and is required by the active `main` ruleset, with branches +required to be up to date. This gate uses Ubuntu only to combine results. Configured workflow: @@ -857,7 +859,7 @@ Checkout ### Python Matrix -Configured CI versions, pending their first successful hosted evaluation: +Successfully tested CI versions: ```text 3.11 @@ -937,6 +939,14 @@ GitHub Release All artifacts for a version should come from exactly the same Git tag. +The active `Protect version tags` ruleset blocks updates and deletion of `v*` +tags without bypass exceptions; new tags can still be created. Release +immutability is enabled for future GitHub releases. Prepare a draft with all +assets and checksums before publishing it, since published assets and the +associated tag become immutable. Corrections require a new version. See +[the release protection guide](docs/releases.md). Publishing automation remains +planned work. + ## 22. PyPI The project is intended to be published on PyPI later. diff --git a/TODO.md b/TODO.md index c90743f..dfa4617 100644 --- a/TODO.md +++ b/TODO.md @@ -401,7 +401,7 @@ actual OCR - [x] lokalen Git-Remote setzen - [x] ersten Commit pushen - [x] Issue-Formulare auf GitHub prüfen -- [ ] PR-Vorlage beim ersten echten Pull Request auf GitHub prüfen +- [x] PR-Vorlage beim ersten echten Pull Request auf GitHub prüfen (PR #1) - [x] privates Vulnerability Reporting aktivieren und den Meldeweg in `SECURITY.md` prüfen - [x] Moderationsmeldeweg in `CODE_OF_CONDUCT.md` festlegen: GitHub-Meldetools, bewusst keine öffentliche E-Mail-Adresse und kein direkter privater Projektkontakt @@ -419,12 +419,19 @@ pdf-ocr offline-ocr ``` -### 27. Branch Protection später aktivieren +### 27. Branch- und Release-Schutz aktivieren - [x] Pull Requests vor Merge -- [ ] CI muss erfolgreich sein (Check `CI` nach erstem erfolgreichen GitHub-Lauf verpflichtend machen) +- [x] CI muss erfolgreich sein (Check `CI` von GitHub Actions verpflichtend; Branch muss aktuell sein) - [x] versehentliches Force Push verhindern -- [ ] Tags / Releases schützen +- [x] Tags / Releases schützen +- [x] aktives Tag-Ruleset `Protect version tags` für `v*`: Änderungen und Löschungen gesperrt, keine Bypass-Ausnahmen +- [x] Release Immutability für zukünftige GitHub Releases aktivieren + +Neue Versions-Tags können weiterhin erstellt werden. Für Releases zuerst einen +Entwurf mit allen Assets vorbereiten und erst anschließend veröffentlichen. +Veröffentlichte Assets sind dann unveränderlich; Korrekturen erhalten eine neue +Version. Einrichtung und Ablauf stehen in `docs/releases.md`. ## Phase 6 – GitHub CI @@ -451,33 +458,35 @@ Schritte: - [x] gebauten Wheel installieren - [x] CLI Smoke Test -Der Workflow ist implementiert und lokal unter Python 3.13 geprüft. -Der erste ausgeführte Hosted-Testlauf zeigte CLI-Tests mit einer Abhängigkeit -von der nicht versionierten `prototype.py` sowie von Typer erzwungene ANSI-Codes. -Die Tests erzeugen nun eigene Eingabepfade; der Workflow deaktiviert erzwungene -Terminalformatierung. Lokal bestehen damit alle 144 Tests auch mit den -CI-Umgebungsvariablen. Der erfolgreiche Hosted-Wiederholungslauf steht noch aus. +Der Workflow ist implementiert und auf GitHub für Python 3.11–3.14 erfolgreich +geprüft. Der [erfolgreiche Lauf auf main](https://github.com/Hasko7/matnocr/actions/runs/45465791622) +prüft alle vier Versionen einschließlich Build, frischer Wheel-Installation und +CLI-Smoke-Tests. CLI-Tests erzeugen eigene Eingabepfade; erzwungene +Terminalformatierung ist im Workflow deaktiviert. -- [ ] ersten GitHub-Lauf auf dem PR prüfen (Matrix und echte Runner-Capabilities) +- [x] ersten erfolgreichen GitHub-Lauf auf dem PR und auf main prüfen (Matrix und echte Runner-Capabilities) ### 29. Windows Runner -- [x] Windows GitHub Runner konfigurieren (`windows-2025`; erster Hosted-Lauf noch offen) +- [x] Windows GitHub Runner konfigurieren (`windows-2025`; Hosted-Lauf erfolgreich) - [x] Runner-Image-Familie festlegen (`windows-2025`; konkrete Image-Version im Actions-Log) -- [ ] verfügbare Windows-OCR-Sprachen im ersten GitHub-Lauf untersuchen (Diagnose-Schritt konfiguriert) +- [x] verfügbare Windows-OCR-Sprachen im ersten GitHub-Lauf untersuchen: `en-US`; Deutsch und Arabisch fehlen - [x] kleine Integrationstests im Workflow aktivieren - [x] OCR-Sprachabhängige Tests bei fehlender Runtime oder Sprache sauber skippen ### 30. Python CI Matrix -Matrix 3.11–3.14 ist konfiguriert; erfolgreiche Hosted-Läufe noch prüfen: +Matrix 3.11–3.14 ist auf GitHub erfolgreich geprüft: -- [ ] Python 3.11 -- [ ] Python 3.12 -- [ ] Python 3.13 -- [ ] Python 3.14 +- [x] Python 3.11 +- [x] Python 3.12 +- [x] Python 3.13 +- [x] Python 3.14 -Nur nach erfolgreichem Test offiziell unterstützen. +Im Hosted-Lauf bestehen pro Version 142 Tests; zwei OCR-Integrationstests werden +wegen fehlender deutscher und arabischer Sprachpakete übersprungen. Lokal unter +Python 3.13 bestehen mit diesen Sprachpaketen alle 144 Tests. Die Hosted-Matrix +belegt damit keine reale deutsche oder arabische OCR auf allen Python-Versionen. ### 31. Security Automation @@ -593,6 +602,7 @@ test - [ ] Versionen müssen überall identisch sein - [ ] Release nur aus getaggtem Commit - [ ] fehlerhafte Builds dürfen nicht veröffentlicht werden +- [ ] alle Release-Assets einschließlich Checksums zuerst an einen Entwurf anhängen und erst danach unveränderlich veröffentlichen ## Phase 9 – v0.1.0 Release diff --git a/docs/README.md b/docs/README.md index 1b43803..c270b32 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,6 +2,7 @@ - [Usage guide](usage.md): pages, quality, languages, output formats, and scripting. - [Development guide](development.md): local setup, checks, and integration tests. +- [Release protection](releases.md): active tag/release safeguards and publishing order. - [Benchmarks](benchmarks.md): historical results and measurement limitations. - [Screenshot guide](images/README.md): filenames and capture instructions for the README images. - [Contributing](../CONTRIBUTING.md): issue reports, pull requests, and contribution expectations. diff --git a/docs/development.md b/docs/development.md index e4d761a..b32a408 100644 --- a/docs/development.md +++ b/docs/development.md @@ -98,10 +98,11 @@ languages without installing system capabilities or opening an administrative PowerShell. CLI unit tests use synthetic language discovery. The final `CI` job runs even if a matrix job fails or is skipped, and succeeds -only when the Windows matrix succeeds. After the first successful GitHub run, -require this check in the `main` ruleset. Do not require all possible OCR -languages or assume that a configured Python matrix is already validated: -inspect the first run and its skipped tests before marking compatibility tasks -complete. The final gate uses Ubuntu only to combine results; all application -checks run on Windows. +only when the Windows matrix succeeds. It is required by the active `main` +ruleset, which also requires branches to be up to date. The verified hosted +matrix passes on Python 3.11–3.14 with 142 tests passing per version; German and +Arabic OCR tests skip because the runner only provides `en-US`. Locally, all +144 tests pass on Python 3.13 with those language packs installed. Inspect skips +when evaluating future compatibility. The final gate uses Ubuntu only to combine +results; all application checks run on Windows. diff --git a/docs/releases.md b/docs/releases.md new file mode 100644 index 0000000..f1fa7bf --- /dev/null +++ b/docs/releases.md @@ -0,0 +1,42 @@ +# Release Protection + +[Back to the documentation index](README.md) + +## Active Repository Settings + +Verified on 2026-11-24: + +- The `Protect main` ruleset requires a pull request, an up-to-date branch, and + the successful `CI` check from GitHub Actions. It blocks branch deletion and + force pushes, with no bypass exceptions. +- The `Protect version tags` ruleset targets `v*` (`refs/tags/v*` in the API). + It blocks tag updates and deletions, with no bypass exceptions. New version + tags can still be created by users with the necessary repository permissions. +- GitHub release immutability is enabled for future releases. Once published, + release assets and the associated tag are locked. Release titles and notes + can still be edited. + +These are GitHub repository settings; cloning the repository does not configure +them. Inspect them under **Settings → Rules → Rulesets** and +**Settings → General → Releases → Enable release immutability**. + +## Publishing Order for the Future Release Workflow + +Package metadata, TestPyPI/PyPI publication, Windows builds, and release +automation still have open roadmap tasks. When implementing that workflow: + +1. Select a reviewed commit with successful checks, and verify that the package + version matches its new version tag, such as `v0.1.0`. +2. Run release validation and build every artifact from that same tagged commit. +3. Create a **draft release** and upload all intended assets, checksums, and + required third-party license files. +4. Verify the complete draft, then publish it. All assets must be uploaded + before publication because release immutability locks them afterward. +5. Ship corrections under a new version, such as `v0.1.1`. + +Protecting tags prevents later changes; it does not by itself run tests or +guarantee that a newly created tag points to a reviewed commit. The release +workflow must enforce validation before publishing. + +GitHub documents [ruleset protections](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets) +and the [draft-first workflow for immutable releases](https://docs.github.com/en/code-security/concepts/supply-chain-security/immutable-releases).