A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Chore: Upgrade runners to Ubuntu 26.04 (#14347)
Trenton H3a3b3ef66a28
diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.ymlindex 9f08625db..1e0ba23b1 100644--- a/.github/workflows/ci-backend.yml+++ b/.github/workflows/ci-backend.yml@@ -80,7 +80,7 @@ jobs:needs: changesif: needs.changes.outputs.backend_changed == 'true'name: "Python ${{ matrix.python-version }}"- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:contents: readstrategy:@@ -114,7 +114,7 @@ jobs:packages: unpaper tesseract-ocr imagemagick ghostscript poppler-utils- name: Configure ImageMagickrun: |- sudo cp docker/rootfs/etc/ImageMagick-6/paperless-policy.xml /etc/ImageMagick-6/policy.xml+ sudo cp docker/rootfs/etc/ImageMagick-6/paperless-policy.xml /etc/ImageMagick-7/policy.xml- name: Install Python dependenciesenv:PYTHON_VERSION: ${{ steps.setup-python.outputs.python-version }}@@ -158,7 +158,7 @@ jobs:needs: changesif: needs.changes.outputs.backend_changed == 'true'name: Check project typing- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:contents: readenv:diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.ymlindex 8887ddeca..7b1c7f0ff 100644--- a/.github/workflows/ci-docker.yml+++ b/.github/workflows/ci-docker.yml@@ -24,10 +24,10 @@ jobs:fail-fast: falsematrix:include:- - runner: ubuntu-24.04+ - runner: ubuntu-26.04arch: amd64platform: linux/amd64- - runner: ubuntu-24.04-arm+ - runner: ubuntu-26.04-armarch: arm64platform: linux/arm64runs-on: ${{ matrix.runner }}@@ -163,7 +163,7 @@ jobs:archive: falsemerge-and-push:name: Merge and Push Manifest- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04needs: build-archif: needs.build-arch.outputs.should-push == 'true'environment: image-publishingdiff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.ymlindex 5d24e845a..8ec66b71f 100644--- a/.github/workflows/ci-docs.yml+++ b/.github/workflows/ci-docs.yml@@ -65,7 +65,7 @@ jobs:needs: changesif: needs.changes.outputs.docs_changed == 'true'name: Build Documentation- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04steps:- uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0- name: Checkout@@ -102,7 +102,7 @@ jobs:name: Deploy Documentationneeds: [changes, build]if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changes.outputs.docs_changed == 'true'- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:pages: writeid-token: writediff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.ymlindex 6af82ec05..c1394ccd3 100644--- a/.github/workflows/ci-frontend.yml+++ b/.github/workflows/ci-frontend.yml@@ -72,7 +72,7 @@ jobs:needs: changesif: needs.changes.outputs.frontend_changed == 'true'name: Install Dependencies- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:contents: readsteps:@@ -104,7 +104,7 @@ jobs:name: Lintneeds: [changes, install-dependencies]if: needs.changes.outputs.frontend_changed == 'true'- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:contents: readsteps:@@ -137,7 +137,7 @@ jobs:name: "Unit Tests (${{ matrix.shard-index }}/${{ matrix.shard-count }})"needs: [changes, install-dependencies]if: needs.changes.outputs.frontend_changed == 'true'- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:contents: readstrategy:@@ -188,10 +188,10 @@ jobs:name: E2E Testsneeds: [changes, install-dependencies]if: needs.changes.outputs.frontend_changed == 'true'- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:contents: read- container: mcr.microsoft.com/playwright:v1.62.1-noble+ container: mcr.microsoft.com/playwright:v1.62.1-resoluteenv:PLAYWRIGHT_BROWSERS_PATH: /ms-playwrightPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1@@ -246,7 +246,7 @@ jobs:name: Frontend Buildneeds: [changes, unit-tests, e2e-tests]if: needs.changes.outputs.frontend_changed == 'true'- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:contents: readsteps:diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.ymlindex 8ff2e6f74..9dfb74dc9 100644--- a/.github/workflows/ci-release.yml+++ b/.github/workflows/ci-release.yml@@ -14,7 +14,7 @@ permissions: {}jobs:wait-for-docker:name: Wait for Docker Build- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:checks: readstatuses: read@@ -30,7 +30,7 @@ jobs:build-release:name: Build Releaseneeds: wait-for-docker- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:contents: readsteps:@@ -73,7 +73,7 @@ jobs:timeout-minutes: 12uses: $/.github/actions/apt-installwith:- packages: gettext liblept5+ packages: gettext libleptonica6# ---- Build Documentation ----- name: Build documentationenv:@@ -145,7 +145,7 @@ jobs:publish-release:name: Publish Releaseneeds: build-release- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:contents: writepull-requests: write@@ -197,7 +197,7 @@ jobs:name: Append Changelogneeds: publish-releaseif: needs.publish-release.outputs.prerelease == 'false'- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:contents: writepull-requests: writediff --git a/.github/workflows/ci-static-analysis.yml b/.github/workflows/ci-static-analysis.ymlindex 6a0a142dd..d774194e0 100644--- a/.github/workflows/ci-static-analysis.yml+++ b/.github/workflows/ci-static-analysis.yml@@ -15,7 +15,7 @@ permissions:jobs:zizmor:name: Run zizmor- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:contents: readactions: read@@ -29,7 +29,7 @@ jobs:uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4semgrep:name: Semgrep CE- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04container:image: semgrep/semgrep:1.155.0@sha256:cc869c685dcc0fe497c86258da9f205397d8108e56d21a86082ea4886e52784dif: github.actor != 'dependabot[bot]'diff --git a/.github/workflows/cleanup-tags.yml b/.github/workflows/cleanup-tags.ymlindex 3e642af03..f09691504 100644--- a/.github/workflows/cleanup-tags.yml+++ b/.github/workflows/cleanup-tags.yml@@ -17,7 +17,7 @@ jobs:cleanup-images:name: Cleanup Image Tags for ${{ matrix.primary-name }}if: github.repository_owner == 'paperless-ngx'- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04environment: registry-maintenancestrategy:fail-fast: false@@ -42,7 +42,7 @@ jobs:cleanup-untagged-images:name: Cleanup Untagged Images Tags for ${{ matrix.primary-name }}if: github.repository_owner == 'paperless-ngx'- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04needs:- cleanup-imagesenvironment: registry-maintenancediff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.ymlindex d91dcd1c6..424e52164 100644--- a/.github/workflows/codeql-analysis.yml+++ b/.github/workflows/codeql-analysis.yml@@ -21,7 +21,7 @@ on:jobs:analyze:name: Analyze- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:actions: readcontents: readdiff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.ymlindex 14dd80f23..4f7b8a395 100644--- a/.github/workflows/crowdin.yml+++ b/.github/workflows/crowdin.yml@@ -13,7 +13,7 @@ jobs:synchronize-with-crowdin:name: Crowdin Syncif: github.repository_owner == 'paperless-ngx'- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04environment: translation-syncsteps:- name: Checkoutdiff --git a/.github/workflows/issue-bot.yml b/.github/workflows/issue-bot.ymlindex 1950f59b6..83ddba7b1 100644--- a/.github/workflows/issue-bot.yml+++ b/.github/workflows/issue-bot.yml@@ -7,7 +7,7 @@ jobs:# Note: peakoss/anti-slop does not support the `issues` event yet (all of its# issue inputs are still commented out upstream), so the checks that the PR Bot# workflow gets from the action are implemented manually here.- runs-on: ubuntu-latest+ runs-on: ubuntu-slimpermissions:issues: writesteps:diff --git a/.github/workflows/pr-bot.yml b/.github/workflows/pr-bot.ymlindex f7d69039d..d936cefcc 100644--- a/.github/workflows/pr-bot.yml+++ b/.github/workflows/pr-bot.yml@@ -4,7 +4,7 @@ on:types: [opened]jobs:Anti-slop:- runs-on: ubuntu-latest+ runs-on: ubuntu-slimpermissions:contents: readissues: read@@ -24,7 +24,7 @@ jobs:ASLOP-PR-VERIFYpr-bot:name: Automated PR Bot- runs-on: ubuntu-latest+ runs-on: ubuntu-slim# Runs after Anti-slop so the welcome comment can see whether the PR was closed# instead of racing it. Still runs if that job fails, so labeling is not lost.needs: Anti-slopdiff --git a/.github/workflows/project-actions.yml b/.github/workflows/project-actions.ymlindex cd4f65a89..e2941292b 100644--- a/.github/workflows/project-actions.yml+++ b/.github/workflows/project-actions.yml@@ -12,7 +12,7 @@ permissions:jobs:pr_opened_or_reopened:name: pr_opened_or_reopened- runs-on: ubuntu-24.04+ runs-on: ubuntu-slimpermissions:# write permission is required for autolabelerpull-requests: writediff --git a/.github/workflows/repo-maintenance.yml b/.github/workflows/repo-maintenance.ymlindex 0b40b17bc..0c5554946 100644--- a/.github/workflows/repo-maintenance.yml+++ b/.github/workflows/repo-maintenance.yml@@ -9,7 +9,7 @@ jobs:stale:name: 'Stale'if: github.repository_owner == 'paperless-ngx'- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:issues: writepull-requests: write@@ -34,7 +34,7 @@ jobs:lock-threads:name: 'Lock Old Threads'if: github.repository_owner == 'paperless-ngx'- runs-on: ubuntu-24.04+ runs-on: ubuntu-26.04permissions:issues: writepull-requests: write@@ -58,7 +58,7 @@ jobs:close-answered-discussions:name: 'Close Answered Discussions'if: github.repository_owner == 'paperless-ngx'- runs-on: ubuntu-24.04+ runs-on: ubuntu-slimpermissions:discussions: writesteps:@@ -117,7 +117,7 @@ jobs:close-outdated-discussions:name: 'Close Outdated Discussions'if: github.repository_owner == 'paperless-ngx'- runs-on: ubuntu-24.04+ runs-on: ubuntu-slimpermissions:discussions: writesteps:@@ -211,7 +211,7 @@ jobs:close-unsupported-feature-requests:name: 'Close Unsupported Feature Requests'if: github.repository_owner == 'paperless-ngx'- runs-on: ubuntu-24.04+ runs-on: ubuntu-slimpermissions:discussions: writesteps:diff --git a/.github/workflows/translate-strings.yml b/.github/workflows/translate-strings.ymlindex b3bea5765..13fe3c0f6 100644--- a/.github/workflows/translate-strings.yml+++ b/.github/workflows/translate-strings.yml@@ -8,7 +8,7 @@ env:jobs:generate-translate-strings:name: Generate Translation Strings- runs-on: ubuntu-latest+ runs-on: ubuntu-26.04environment: translation-syncpermissions:contents: writediff --git a/src/paperless/tests/parsers/test_mail_parser_live.py b/src/paperless/tests/parsers/test_mail_parser_live.pyindex 037c157e0..a91b25ec3 100644--- a/src/paperless/tests/parsers/test_mail_parser_live.py+++ b/src/paperless/tests/parsers/test_mail_parser_live.py@@ -137,9 +137,20 @@ class TestNginxService:reason="No Gotenberg/Tika servers to test with",)class TestParserLive:- @staticmethod- def imagehash(file: Path, hash_size: int = 18) -> str:- return f"{average_hash(Image.open(file), hash_size)}"+ # Rasterizer versions shift a few pixels, so compare perceptual hashes by+ # Hamming distance (out of 18 * 18 = 324 bits) rather than for equality+ MAX_HASH_DISTANCE = 8++ @classmethod+ def assert_thumbnails_similar(cls, generated: Path, expected: Path) -> None:+ distance = average_hash(Image.open(generated), 18) - average_hash(+ Image.open(expected),+ 18,+ )+ assert distance <= cls.MAX_HASH_DISTANCE, (+ f"Thumbnail {generated} differs from {expected} by {distance} bits "+ f"(max {cls.MAX_HASH_DISTANCE})"+ )def test_get_thumbnail(self,@@ -168,12 +179,7 @@ class TestParserLive:assert thumb.exists()assert thumb.is_file()- assert self.imagehash(thumb) == self.imagehash(- simple_txt_email_thumbnail_file,- ), (- f"Created thumbnail {thumb} differs from expected file "- f"{simple_txt_email_thumbnail_file}"- )+ self.assert_thumbnails_similar(thumb, simple_txt_email_thumbnail_file)def test_tika_parse_successful(self, mail_parser: MailDocumentParser) -> None:"""@@ -255,7 +261,7 @@ class TestParserLive:THEN:- Gotenberg shall be called to generate the PDF- The archive PDF shall contain the expected content- - The generated thumbnail shall match the expected image hash+ - The generated thumbnail shall be perceptually close to the expected image"""util_call_with_backoff(mail_parser.parse, [html_email_file, "message/rfc822"])@@ -272,14 +278,4 @@ class TestParserLive:html_email_file,"message/rfc822",)- generated_thumbnail_hash = self.imagehash(generated_thumbnail)-- # The created PDF is not reproducible, but the converted image- # should always look the same- expected_hash = self.imagehash(html_email_thumbnail_file)-- assert generated_thumbnail_hash == expected_hash, (- f"PDF thumbnail differs from expected. "- f"Generated: {generated_thumbnail}, "- f"Hash: {generated_thumbnail_hash} vs {expected_hash}"- )+ self.assert_thumbnails_similar(generated_thumbnail, html_email_thumbnail_file)