From 2d0c0312563bbae38252fdc1d16b67e1ff85ccb9 Mon Sep 17 00:00:00 2001 From: DonislawDev Date: Tue, 24 Nov 2026 20:12:45 +0100 Subject: [PATCH 1/3] Say on the sample files page why a download can look smaller GitHub Pages sends text files and some pictures with gzip, so the Content-Length a browser sees while one of them downloads is the compressed size (sample.txt 272 468 bytes, sample.xml 126 805). The saved files are 1 048 576 bytes and match SHA256SUMS. The page now says so in every language, beside the sentence that promises the size. Co-Authored-By: Claude Opus 5.5 --- web/content/ar/samples.html | 2 ++ web/content/cs/samples.html | 2 ++ web/content/de/samples.html | 3 +++ web/content/en/samples.html | 3 +++ web/content/es/samples.html | 3 +++ web/content/fr/samples.html | 3 +++ web/content/hi/samples.html | 3 +++ web/content/id/samples.html | 3 +++ web/content/it/samples.html | 3 +++ web/content/ja/samples.html | 2 +- web/content/ko/samples.html | 1 + web/content/nl/samples.html | 3 +++ web/content/pl/samples.html | 3 +++ web/content/pt-BR/samples.html | 3 +++ web/content/ro/samples.html | 3 +++ web/content/ru/samples.html | 3 +++ web/content/th/samples.html | 1 + web/content/tr/samples.html | 3 +++ web/content/uk/samples.html | 3 +++ web/content/vi/samples.html | 3 +++ web/content/zh-Hans/samples.html | 2 +- web/content/zh-Hant/samples.html | 2 +- web/public/ar/sample-files/index.html | 2 ++ web/public/cs/ukazkove-soubory/index.html | 2 ++ web/public/de/beispieldateien/index.html | 3 +++ web/public/es/archivos-de-ejemplo/index.html | 3 +++ web/public/fr/fichiers-d-exemple/index.html | 3 +++ web/public/hi/sample-files/index.html | 3 +++ web/public/id/contoh-file/index.html | 3 +++ web/public/it/file-di-esempio/index.html | 3 +++ web/public/ja/sample-files/index.html | 2 +- web/public/ko/sample-files/index.html | 1 + web/public/nl/voorbeeldbestanden/index.html | 3 +++ web/public/pl/przykladowe-pliki/index.html | 3 +++ web/public/pt-br/arquivos-de-exemplo/index.html | 3 +++ web/public/ro/fisiere-de-exemplu/index.html | 3 +++ web/public/ru/sample-files/index.html | 3 +++ web/public/sample-files/index.html | 3 +++ web/public/th/sample-files/index.html | 1 + web/public/tr/ornek-dosyalar/index.html | 3 +++ web/public/uk/sample-files/index.html | 3 +++ web/public/vi/tep-mau/index.html | 3 +++ web/public/zh-hans/sample-files/index.html | 2 +- web/public/zh-hant/sample-files/index.html | 2 +- 44 files changed, 108 insertions(+), 6 deletions(-) diff --git a/web/content/ar/samples.html b/web/content/ar/samples.html index f87484d3..f13ff80a 100644 --- a/web/content/ar/samples.html +++ b/web/content/ar/samples.html @@ -34,6 +34,8 @@

ملف واحد من كل صيغة، بحجم 1 MB لكل منها

مستندات وصور ونصوص وبيانات وأرشيفات وبريد وقياسات عن بُعد وصوت وفيديو، كل منها 1048576 بايتًا بالضبط، وكل منها ملف حقيقي من صيغته. يُفتح ملف PDF في قارئ PDF، وDOCX في Word، وXLSX في Excel، ويُفك ضغط ZIP. + يرسل الخادم الملفات النصية وبعض الصور مضغوطة، لذلك قد يعرض المتصفح أثناء التنزيل حجمًا أصغر من + الجدول. أما الملف المحفوظ فحجمه هو الحجم الوارد في الجدول ويطابق قيمة SHA-256 الخاصة به.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/cs/samples.html b/web/content/cs/samples.html index b961d7c1..74ee3ef8 100644 --- a/web/content/cs/samples.html +++ b/web/content/cs/samples.html @@ -37,6 +37,8 @@

Jeden soubor od každého formátu, každý 1 MB

Dokumenty, obrázky, text, data, archivy, pošta, telemetrie, zvuk a video, každý soubor má přesně 1 048 576 bajtů a každý je skutečným souborem svého formátu. PDF se otevře v prohlížeči PDF, DOCX ve Wordu, XLSX v Excelu a ZIP se rozbalí. + Server posílá textové soubory a některé obrázky komprimované, proto může prohlížeč během stahování + ukázat menší velikost než tabulka. Uložený soubor má velikost z tabulky a odpovídá svému SHA-256.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/de/samples.html b/web/content/de/samples.html index b170a038..d801b7a8 100644 --- a/web/content/de/samples.html +++ b/web/content/de/samples.html @@ -37,6 +37,9 @@

Eine Datei von jedem Format, jede 1 MB groß

Dokumente, Bilder, Text, Daten, Archive, E-Mail, Telemetrie, Audio und Video, jede Datei genau 1 048 576 Bytes groß und jede eine echte Datei ihres Formats. Das PDF öffnet sich in einem PDF-Reader, die DOCX in Word, die XLSX in Excel, und das ZIP lässt sich entpacken. + Der Server schickt Textdateien und einige Bilder komprimiert, deshalb kann dein Browser beim + Herunterladen eine kleinere Größe anzeigen als die Tabelle. Die gespeicherte Datei hat die Größe aus + der Tabelle und stimmt mit ihrem SHA-256 überein.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/en/samples.html b/web/content/en/samples.html index 3b975d5e..448d59bb 100644 --- a/web/content/en/samples.html +++ b/web/content/en/samples.html @@ -36,6 +36,9 @@

One file of every format, 1 MB each

Documents, pictures, text, data, archives, mail, telemetry, sound and video, each exactly 1 048 576 bytes and each a real file of its format. The PDF opens in a PDF reader, the DOCX in Word, the XLSX in Excel and the ZIP extracts. + The server sends text files and some pictures compressed, so while one of them downloads, your + browser can show a smaller size than the table. The file it saves has the size in the table and + matches its SHA-256.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/es/samples.html b/web/content/es/samples.html index 6f1ab4fb..de799be8 100644 --- a/web/content/es/samples.html +++ b/web/content/es/samples.html @@ -36,6 +36,9 @@

Un archivo de cada formato, de 1 MB cada uno

Documentos, imágenes, texto, datos, archivos comprimidos, correo, telemetría, sonido y vídeo, cada uno de exactamente 1 048 576 bytes y cada uno un archivo real de su formato. El PDF se abre en un lector de PDF, el DOCX en Word, el XLSX en Excel y el ZIP se descomprime. + El servidor envía comprimidos los archivos de texto y algunas imágenes, así que durante la descarga + tu navegador puede mostrar un tamaño menor que el de la tabla. El archivo guardado tiene el tamaño + de la tabla y coincide con su SHA-256.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/fr/samples.html b/web/content/fr/samples.html index 993ab162..dcb38fd9 100644 --- a/web/content/fr/samples.html +++ b/web/content/fr/samples.html @@ -37,6 +37,9 @@

Un fichier de chaque format, de 1 Mo chacun

Documents, images, texte, données, archives, courrier, télémétrie, son et vidéo, chacun d'exactement 1 048 576 octets et chacun un vrai fichier de son format. Le PDF s'ouvre dans un lecteur PDF, le DOCX dans Word, le XLSX dans Excel, et le ZIP se décompresse. + Le serveur envoie les fichiers texte et certaines images compressés, donc pendant le téléchargement + votre navigateur peut afficher une taille plus petite que celle du tableau. Le fichier enregistré a + la taille du tableau et correspond à son SHA-256.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/hi/samples.html b/web/content/hi/samples.html index 4c44915d..48a61e33 100644 --- a/web/content/hi/samples.html +++ b/web/content/hi/samples.html @@ -36,6 +36,9 @@

हर फ़ॉर्मैट की एक फ़ाइल, हर एक दस्तावेज़, तस्वीरें, टेक्स्ट, डेटा, आर्काइव, मेल, टेलीमेट्री, ध्वनि और वीडियो, हर फ़ाइल ठीक 1 048 576 बाइट की और हर एक अपने फ़ॉर्मैट की असली फ़ाइल। PDF किसी PDF रीडर में खुलती है, DOCX Word में, XLSX Excel में, और ZIP एक्सट्रैक्ट हो जाता है। + सर्वर टेक्स्ट फ़ाइलें और कुछ तस्वीरें कंप्रेस करके भेजता है, इसलिए डाउनलोड के दौरान ब्राउज़र तालिका + से छोटा आकार दिखा सकता है। सेव हुई फ़ाइल का आकार तालिका जितना ही होता है और वह अपने SHA-256 से मेल + खाती है।

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/id/samples.html b/web/content/id/samples.html index 54a181bf..119194ee 100644 --- a/web/content/id/samples.html +++ b/web/content/id/samples.html @@ -36,6 +36,9 @@

Satu file dari setiap format, masing-masing 1 MB

Dokumen, gambar, teks, data, arsip, e-mail, telemetri, audio, dan video, masing-masing tepat 1 048 576 byte dan masing-masing file asli dari formatnya. PDF terbuka di pembaca PDF, DOCX di Word, XLSX di Excel, dan ZIP bisa diekstrak. + Server mengirim file teks dan beberapa gambar dalam bentuk terkompresi, jadi selama pengunduhan + browser Anda bisa menampilkan ukuran yang lebih kecil daripada tabel. File yang tersimpan berukuran + sesuai tabel dan cocok dengan SHA-256-nya.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/it/samples.html b/web/content/it/samples.html index 6baf5c07..0cd7d381 100644 --- a/web/content/it/samples.html +++ b/web/content/it/samples.html @@ -36,6 +36,9 @@

Un file per ogni formato, da 1 MB ciascuno

Documenti, immagini, testo, dati, archivi, posta, telemetria, audio e video, ognuno di esattamente 1 048 576 byte e ognuno un file reale del suo formato. Il PDF si apre in un lettore PDF, il DOCX in Word, l'XLSX in Excel e lo ZIP si decomprime. + Il server invia compressi i file di testo e alcune immagini, quindi durante il download il tuo + browser può mostrare una dimensione più piccola di quella della tabella. Il file salvato ha la + dimensione della tabella e corrisponde al suo SHA-256.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/ja/samples.html b/web/content/ja/samples.html index 58ad8d0c..ce4113e1 100644 --- a/web/content/ja/samples.html +++ b/web/content/ja/samples.html @@ -23,7 +23,7 @@

テスト用サンプルファイル

すべての形式

全形式のファイルを1つずつ、各1MB

- 文書、画像、テキスト、データ、アーカイブ、メール、テレメトリ、音声、動画。どれもちょうど1048576バイトで、それぞれの形式の本物のファイルです。PDFはPDFリーダーで、DOCXはWordで、XLSXはExcelで開け、ZIPは展開できます。 + 文書、画像、テキスト、データ、アーカイブ、メール、テレメトリ、音声、動画。どれもちょうど1048576バイトで、それぞれの形式の本物のファイルです。PDFはPDFリーダーで、DOCXはWordで、XLSXはExcelで開け、ZIPは展開できます。サーバーはテキストファイルと一部の画像を圧縮して送るため、ダウンロード中のブラウザーには表より小さいサイズが表示されることがあります。保存されたファイルは表のサイズどおりで、SHA-256とも一致します。

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/ko/samples.html b/web/content/ko/samples.html index 429943e6..be18ebdf 100644 --- a/web/content/ko/samples.html +++ b/web/content/ko/samples.html @@ -24,6 +24,7 @@

테스트용 샘플 파일

모든 형식의 파일 하나씩, 각 1MB

문서, 이미지, 텍스트, 데이터, 아카이브, 메일, 텔레메트리, 소리, 동영상까지 모두 정확히 1048576바이트이고, 각각 해당 형식의 실제 파일입니다. PDF는 PDF 리더에서, DOCX는 Word에서, XLSX는 Excel에서 열리고, ZIP은 압축이 풀립니다. + 서버는 텍스트 파일과 일부 이미지를 압축해서 보내므로, 다운로드하는 동안 브라우저에 표보다 작은 크기가 표시될 수 있습니다. 저장된 파일은 표에 적힌 크기이며 SHA-256 값과도 일치합니다.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/nl/samples.html b/web/content/nl/samples.html index ed822ef9..35fdd097 100644 --- a/web/content/nl/samples.html +++ b/web/content/nl/samples.html @@ -37,6 +37,9 @@

Eén bestand van elk formaat, elk 1 MB

Documenten, afbeeldingen, tekst, data, archieven, e-mail, telemetrie, geluid en video, elk precies 1 048 576 bytes en elk een echt bestand van zijn formaat. De PDF opent in een PDF-lezer, de DOCX in Word, de XLSX in Excel en de ZIP pakt uit. + De server stuurt tekstbestanden en sommige afbeeldingen gecomprimeerd, dus tijdens het downloaden + kan je browser een kleinere grootte tonen dan de tabel. Het opgeslagen bestand heeft de grootte uit + de tabel en klopt met zijn SHA-256.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/pl/samples.html b/web/content/pl/samples.html index 832ba562..60d0c9d5 100644 --- a/web/content/pl/samples.html +++ b/web/content/pl/samples.html @@ -35,6 +35,9 @@

Po jednym pliku każdego formatu, każdy 1 MB

Dokumenty, obrazki, tekst, dane, archiwa, poczta, telemetria, dźwięk i wideo, każdy plik ma dokładnie 1 048 576 bajtów i każdy jest prawdziwym plikiem swojego formatu. PDF otwiera się w czytniku PDF, DOCX w Wordzie, XLSX w Excelu, a ZIP się rozpakowuje. + Serwer wysyła pliki tekstowe i niektóre obrazki skompresowane, więc w trakcie pobierania + przeglądarka może pokazać mniejszy rozmiar niż tabela. Zapisany plik ma rozmiar z tabeli i zgadza + się ze swoim SHA-256.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/pt-BR/samples.html b/web/content/pt-BR/samples.html index bb702c08..9a666f94 100644 --- a/web/content/pt-BR/samples.html +++ b/web/content/pt-BR/samples.html @@ -36,6 +36,9 @@

Um arquivo de cada formato, com 1 MB cada

Documentos, imagens, texto, dados, arquivos compactados, e-mail, telemetria, som e vídeo, cada um com exatamente 1 048 576 bytes e cada um um arquivo real do seu formato. O PDF abre num leitor de PDF, o DOCX no Word, o XLSX no Excel e o ZIP se descompacta. + O servidor envia arquivos de texto e algumas imagens compactados, então durante o download o seu + navegador pode mostrar um tamanho menor que o da tabela. O arquivo salvo tem o tamanho da tabela e + confere com o seu SHA-256.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/ro/samples.html b/web/content/ro/samples.html index dd005b64..6b06830b 100644 --- a/web/content/ro/samples.html +++ b/web/content/ro/samples.html @@ -36,6 +36,9 @@

Câte un fișier din fiecare format, fiecare de 1 MB

Documente, imagini, text, date, arhive, e-mail, telemetrie, sunet și video, fiecare de exact 1 048 576 de octeți și fiecare un fișier real al formatului său. PDF-ul se deschide într-un cititor de PDF, DOCX-ul în Word, XLSX-ul în Excel, iar ZIP-ul se dezarhivează. + Serverul trimite fișierele text și unele imagini comprimate, așa că în timpul descărcării browserul + tău poate arăta o dimensiune mai mică decât tabelul. Fișierul salvat are dimensiunea din tabel și se + potrivește cu SHA-256-ul său.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/ru/samples.html b/web/content/ru/samples.html index e8d33e2c..38d83d94 100644 --- a/web/content/ru/samples.html +++ b/web/content/ru/samples.html @@ -37,6 +37,9 @@

По одному файлу каждого формата, по 1 МБ

Документы, изображения, текст, данные, архивы, почта, телеметрия, звук и видео, каждый файл размером ровно 1 048 576 байт, и каждый - настоящий файл своего формата. PDF открывается в программе просмотра PDF, DOCX в Word, XLSX в Excel, а ZIP распаковывается. + Сервер передаёт текстовые файлы и некоторые изображения в сжатом виде, поэтому во время загрузки + браузер может показать размер меньше, чем в таблице. Сохранённый файл имеет размер из таблицы и + совпадает со своим SHA-256.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/th/samples.html b/web/content/th/samples.html index a56f5fa9..27d91c34 100644 --- a/web/content/th/samples.html +++ b/web/content/th/samples.html @@ -35,6 +35,7 @@

ทุกรูปแบบ รูปแบบละหนึ่งไฟล เอกสาร รูปภาพ ข้อความ ข้อมูล ไฟล์บีบอัด อีเมล เทเลเมทรี เสียง และวิดีโอ แต่ละไฟล์มีขนาด 1 048 576 ไบต์พอดี และแต่ละไฟล์เป็นไฟล์จริงของรูปแบบนั้น ไฟล์ PDF เปิดได้ในโปรแกรมอ่าน PDF ไฟล์ DOCX เปิดใน Word ไฟล์ XLSX เปิดใน Excel และไฟล์ ZIP แตกไฟล์ได้ + เซิร์ฟเวอร์ส่งไฟล์ข้อความและรูปภาพบางไฟล์แบบบีบอัด ระหว่างดาวน์โหลดเบราว์เซอร์จึงอาจแสดงขนาดที่เล็กกว่าในตาราง ไฟล์ที่บันทึกแล้วมีขนาดตามตารางและตรงกับค่า SHA-256 ของไฟล์นั้น

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/tr/samples.html b/web/content/tr/samples.html index 1d7b76a0..b2ab5a65 100644 --- a/web/content/tr/samples.html +++ b/web/content/tr/samples.html @@ -35,6 +35,9 @@

Her biçimden bir dosya, her biri 1 MB

Belgeler, resimler, metin, veri, arşivler, e-posta, telemetri, ses ve video, her biri tam 1 048 576 bayt ve her biri kendi biçiminde gerçek bir dosya. PDF bir PDF okuyucuda, DOCX Word'de, XLSX Excel'de açılır, ZIP'in içeriği de çıkarılabilir. + Sunucu metin dosyalarını ve bazı resimleri sıkıştırılmış olarak gönderir, bu yüzden indirme + sırasında tarayıcınız tablodakinden daha küçük bir boyut gösterebilir. Kaydedilen dosya tablodaki + boyuttadır ve SHA-256 değeriyle eşleşir.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/uk/samples.html b/web/content/uk/samples.html index 12703115..3814ebbe 100644 --- a/web/content/uk/samples.html +++ b/web/content/uk/samples.html @@ -37,6 +37,9 @@

По одному файлу кожного формату, по 1 МБ

Документи, зображення, текст, дані, архіви, пошта, телеметрія, звук і відео, кожен файл розміром рівно 1 048 576 байтів, і кожен - справжній файл свого формату. PDF відкривається в переглядачі PDF, DOCX у Word, XLSX в Excel, а ZIP розпаковується. + Сервер передає текстові файли й деякі зображення в стиснутому вигляді, тому під час завантаження + браузер може показати менший розмір, ніж у таблиці. Збережений файл має розмір із таблиці й + збігається зі своїм SHA-256.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/vi/samples.html b/web/content/vi/samples.html index ac143361..b59b8701 100644 --- a/web/content/vi/samples.html +++ b/web/content/vi/samples.html @@ -35,6 +35,9 @@

Mỗi định dạng một tệp, mỗi tệp 1 MB

Tài liệu, hình ảnh, văn bản, dữ liệu, tệp nén, thư, telemetry, âm thanh và video, mỗi tệp đúng 1 048 576 byte và mỗi tệp là một tệp thật của định dạng của nó. Tệp PDF mở được trong trình đọc PDF, DOCX trong Word, XLSX trong Excel, còn ZIP giải nén được. + Máy chủ gửi tệp văn bản và một số hình ảnh ở dạng nén, nên trong lúc tải xuống, trình duyệt của bạn + có thể hiển thị kích thước nhỏ hơn so với bảng. Tệp đã lưu có đúng kích thước trong bảng và khớp với + SHA-256 của nó.

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/zh-Hans/samples.html b/web/content/zh-Hans/samples.html index 20e2ca00..f757d216 100644 --- a/web/content/zh-Hans/samples.html +++ b/web/content/zh-Hans/samples.html @@ -23,7 +23,7 @@

测试用示例文件

每种格式

每种格式一个文件,每个 1 MB

- 文档、图片、文本、数据、压缩包、邮件、遥测、音频和视频,每个都恰好 1048576 字节,并且都是该格式的真实文件。PDF 能在 PDF 阅读器中打开,DOCX 能在 Word 中打开,XLSX 能在 Excel 中打开,ZIP 能解压。 + 文档、图片、文本、数据、压缩包、邮件、遥测、音频和视频,每个都恰好 1048576 字节,并且都是该格式的真实文件。PDF 能在 PDF 阅读器中打开,DOCX 能在 Word 中打开,XLSX 能在 Excel 中打开,ZIP 能解压。服务器以压缩形式发送文本文件和部分图片,所以下载过程中浏览器显示的大小可能比表中的小。保存下来的文件大小与表中一致,SHA-256 也相符。

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/content/zh-Hant/samples.html b/web/content/zh-Hant/samples.html index 97a0538e..2f2878cf 100644 --- a/web/content/zh-Hant/samples.html +++ b/web/content/zh-Hant/samples.html @@ -23,7 +23,7 @@

測試用範例檔案

每種格式

每種格式一個檔案,每個 1 MB

- 文件、圖片、文字、資料、壓縮檔、郵件、遙測、音訊和影片,每個都恰好 1048576 位元組,而且都是該格式的真實檔案。PDF 能在 PDF 閱讀器中開啟,DOCX 能在 Word 中開啟,XLSX 能在 Excel 中開啟,ZIP 能解壓縮。 + 文件、圖片、文字、資料、壓縮檔、郵件、遙測、音訊和影片,每個都恰好 1048576 位元組,而且都是該格式的真實檔案。PDF 能在 PDF 閱讀器中開啟,DOCX 能在 Word 中開啟,XLSX 能在 Excel 中開啟,ZIP 能解壓縮。伺服器會以壓縮形式傳送文字檔和部分圖片,所以下載時瀏覽器顯示的大小可能比表中的小。儲存下來的檔案大小與表中一致,SHA-256 也相符。

{{ with .SampleTable "formats" }}{{ template "samplesTable" . }}{{ end }}

diff --git a/web/public/ar/sample-files/index.html b/web/public/ar/sample-files/index.html index 5698c7de..c3446783 100644 --- a/web/public/ar/sample-files/index.html +++ b/web/public/ar/sample-files/index.html @@ -181,6 +181,8 @@

ملف واحد من كل صيغة، بحجم 1 MB لكل منها

مستندات وصور ونصوص وبيانات وأرشيفات وبريد وقياسات عن بُعد وصوت وفيديو، كل منها 1048576 بايتًا بالضبط، وكل منها ملف حقيقي من صيغته. يُفتح ملف PDF في قارئ PDF، وDOCX في Word، وXLSX في Excel، ويُفك ضغط ZIP. + يرسل الخادم الملفات النصية وبعض الصور مضغوطة، لذلك قد يعرض المتصفح أثناء التنزيل حجمًا أصغر من + الجدول. أما الملف المحفوظ فحجمه هو الحجم الوارد في الجدول ويطابق قيمة SHA-256 الخاصة به.

diff --git a/web/public/cs/ukazkove-soubory/index.html b/web/public/cs/ukazkove-soubory/index.html index cca4f138..151ce986 100644 --- a/web/public/cs/ukazkove-soubory/index.html +++ b/web/public/cs/ukazkove-soubory/index.html @@ -184,6 +184,8 @@

Jeden soubor od každého formátu, každý 1 MB

Dokumenty, obrázky, text, data, archivy, pošta, telemetrie, zvuk a video, každý soubor má přesně 1 048 576 bajtů a každý je skutečným souborem svého formátu. PDF se otevře v prohlížeči PDF, DOCX ve Wordu, XLSX v Excelu a ZIP se rozbalí. + Server posílá textové soubory a některé obrázky komprimované, proto může prohlížeč během stahování + ukázat menší velikost než tabulka. Uložený soubor má velikost z tabulky a odpovídá svému SHA-256.

diff --git a/web/public/de/beispieldateien/index.html b/web/public/de/beispieldateien/index.html index 34540ba5..733cf0e9 100644 --- a/web/public/de/beispieldateien/index.html +++ b/web/public/de/beispieldateien/index.html @@ -184,6 +184,9 @@

Eine Datei von jedem Format, jede 1 MB groß

Dokumente, Bilder, Text, Daten, Archive, E-Mail, Telemetrie, Audio und Video, jede Datei genau 1 048 576 Bytes groß und jede eine echte Datei ihres Formats. Das PDF öffnet sich in einem PDF-Reader, die DOCX in Word, die XLSX in Excel, und das ZIP lässt sich entpacken. + Der Server schickt Textdateien und einige Bilder komprimiert, deshalb kann dein Browser beim + Herunterladen eine kleinere Größe anzeigen als die Tabelle. Die gespeicherte Datei hat die Größe aus + der Tabelle und stimmt mit ihrem SHA-256 überein.

diff --git a/web/public/es/archivos-de-ejemplo/index.html b/web/public/es/archivos-de-ejemplo/index.html index d2c869a2..59b931a8 100644 --- a/web/public/es/archivos-de-ejemplo/index.html +++ b/web/public/es/archivos-de-ejemplo/index.html @@ -183,6 +183,9 @@

Un archivo de cada formato, de 1 MB cada uno

Documentos, imágenes, texto, datos, archivos comprimidos, correo, telemetría, sonido y vídeo, cada uno de exactamente 1 048 576 bytes y cada uno un archivo real de su formato. El PDF se abre en un lector de PDF, el DOCX en Word, el XLSX en Excel y el ZIP se descomprime. + El servidor envía comprimidos los archivos de texto y algunas imágenes, así que durante la descarga + tu navegador puede mostrar un tamaño menor que el de la tabla. El archivo guardado tiene el tamaño + de la tabla y coincide con su SHA-256.

diff --git a/web/public/fr/fichiers-d-exemple/index.html b/web/public/fr/fichiers-d-exemple/index.html index 8d79d173..294725a5 100644 --- a/web/public/fr/fichiers-d-exemple/index.html +++ b/web/public/fr/fichiers-d-exemple/index.html @@ -184,6 +184,9 @@

Un fichier de chaque format, de 1 Mo chacun

Documents, images, texte, données, archives, courrier, télémétrie, son et vidéo, chacun d'exactement 1 048 576 octets et chacun un vrai fichier de son format. Le PDF s'ouvre dans un lecteur PDF, le DOCX dans Word, le XLSX dans Excel, et le ZIP se décompresse. + Le serveur envoie les fichiers texte et certaines images compressés, donc pendant le téléchargement + votre navigateur peut afficher une taille plus petite que celle du tableau. Le fichier enregistré a + la taille du tableau et correspond à son SHA-256.

diff --git a/web/public/hi/sample-files/index.html b/web/public/hi/sample-files/index.html index 8ea1b436..cb059a64 100644 --- a/web/public/hi/sample-files/index.html +++ b/web/public/hi/sample-files/index.html @@ -183,6 +183,9 @@

हर फ़ॉर्मैट की एक फ़ाइल, हर एक दस्तावेज़, तस्वीरें, टेक्स्ट, डेटा, आर्काइव, मेल, टेलीमेट्री, ध्वनि और वीडियो, हर फ़ाइल ठीक 1 048 576 बाइट की और हर एक अपने फ़ॉर्मैट की असली फ़ाइल। PDF किसी PDF रीडर में खुलती है, DOCX Word में, XLSX Excel में, और ZIP एक्सट्रैक्ट हो जाता है। + सर्वर टेक्स्ट फ़ाइलें और कुछ तस्वीरें कंप्रेस करके भेजता है, इसलिए डाउनलोड के दौरान ब्राउज़र तालिका + से छोटा आकार दिखा सकता है। सेव हुई फ़ाइल का आकार तालिका जितना ही होता है और वह अपने SHA-256 से मेल + खाती है।

diff --git a/web/public/id/contoh-file/index.html b/web/public/id/contoh-file/index.html index bbce9de7..2bdc718e 100644 --- a/web/public/id/contoh-file/index.html +++ b/web/public/id/contoh-file/index.html @@ -183,6 +183,9 @@

Satu file dari setiap format, masing-masing 1 MB

Dokumen, gambar, teks, data, arsip, e-mail, telemetri, audio, dan video, masing-masing tepat 1 048 576 byte dan masing-masing file asli dari formatnya. PDF terbuka di pembaca PDF, DOCX di Word, XLSX di Excel, dan ZIP bisa diekstrak. + Server mengirim file teks dan beberapa gambar dalam bentuk terkompresi, jadi selama pengunduhan + browser Anda bisa menampilkan ukuran yang lebih kecil daripada tabel. File yang tersimpan berukuran + sesuai tabel dan cocok dengan SHA-256-nya.

diff --git a/web/public/it/file-di-esempio/index.html b/web/public/it/file-di-esempio/index.html index d15851ef..e7788631 100644 --- a/web/public/it/file-di-esempio/index.html +++ b/web/public/it/file-di-esempio/index.html @@ -183,6 +183,9 @@

Un file per ogni formato, da 1 MB ciascuno

Documenti, immagini, testo, dati, archivi, posta, telemetria, audio e video, ognuno di esattamente 1 048 576 byte e ognuno un file reale del suo formato. Il PDF si apre in un lettore PDF, il DOCX in Word, l'XLSX in Excel e lo ZIP si decomprime. + Il server invia compressi i file di testo e alcune immagini, quindi durante il download il tuo + browser può mostrare una dimensione più piccola di quella della tabella. Il file salvato ha la + dimensione della tabella e corrisponde al suo SHA-256.

diff --git a/web/public/ja/sample-files/index.html b/web/public/ja/sample-files/index.html index a55c420b..09db85c2 100644 --- a/web/public/ja/sample-files/index.html +++ b/web/public/ja/sample-files/index.html @@ -170,7 +170,7 @@

テスト用サンプルファイル

すべての形式

全形式のファイルを1つずつ、各1MB

- 文書、画像、テキスト、データ、アーカイブ、メール、テレメトリ、音声、動画。どれもちょうど1048576バイトで、それぞれの形式の本物のファイルです。PDFはPDFリーダーで、DOCXはWordで、XLSXはExcelで開け、ZIPは展開できます。 + 文書、画像、テキスト、データ、アーカイブ、メール、テレメトリ、音声、動画。どれもちょうど1048576バイトで、それぞれの形式の本物のファイルです。PDFはPDFリーダーで、DOCXはWordで、XLSXはExcelで開け、ZIPは展開できます。サーバーはテキストファイルと一部の画像を圧縮して送るため、ダウンロード中のブラウザーには表より小さいサイズが表示されることがあります。保存されたファイルは表のサイズどおりで、SHA-256とも一致します。

diff --git a/web/public/ko/sample-files/index.html b/web/public/ko/sample-files/index.html index e63519bd..76db2165 100644 --- a/web/public/ko/sample-files/index.html +++ b/web/public/ko/sample-files/index.html @@ -171,6 +171,7 @@

테스트용 샘플 파일

모든 형식의 파일 하나씩, 각 1MB

문서, 이미지, 텍스트, 데이터, 아카이브, 메일, 텔레메트리, 소리, 동영상까지 모두 정확히 1048576바이트이고, 각각 해당 형식의 실제 파일입니다. PDF는 PDF 리더에서, DOCX는 Word에서, XLSX는 Excel에서 열리고, ZIP은 압축이 풀립니다. + 서버는 텍스트 파일과 일부 이미지를 압축해서 보내므로, 다운로드하는 동안 브라우저에 표보다 작은 크기가 표시될 수 있습니다. 저장된 파일은 표에 적힌 크기이며 SHA-256 값과도 일치합니다.

diff --git a/web/public/nl/voorbeeldbestanden/index.html b/web/public/nl/voorbeeldbestanden/index.html index c2bda8d7..9bee508a 100644 --- a/web/public/nl/voorbeeldbestanden/index.html +++ b/web/public/nl/voorbeeldbestanden/index.html @@ -184,6 +184,9 @@

Eén bestand van elk formaat, elk 1 MB

Documenten, afbeeldingen, tekst, data, archieven, e-mail, telemetrie, geluid en video, elk precies 1 048 576 bytes en elk een echt bestand van zijn formaat. De PDF opent in een PDF-lezer, de DOCX in Word, de XLSX in Excel en de ZIP pakt uit. + De server stuurt tekstbestanden en sommige afbeeldingen gecomprimeerd, dus tijdens het downloaden + kan je browser een kleinere grootte tonen dan de tabel. Het opgeslagen bestand heeft de grootte uit + de tabel en klopt met zijn SHA-256.

diff --git a/web/public/pl/przykladowe-pliki/index.html b/web/public/pl/przykladowe-pliki/index.html index 2d542415..6ee4d22a 100644 --- a/web/public/pl/przykladowe-pliki/index.html +++ b/web/public/pl/przykladowe-pliki/index.html @@ -182,6 +182,9 @@

Po jednym pliku każdego formatu, każdy 1 MB

Dokumenty, obrazki, tekst, dane, archiwa, poczta, telemetria, dźwięk i wideo, każdy plik ma dokładnie 1 048 576 bajtów i każdy jest prawdziwym plikiem swojego formatu. PDF otwiera się w czytniku PDF, DOCX w Wordzie, XLSX w Excelu, a ZIP się rozpakowuje. + Serwer wysyła pliki tekstowe i niektóre obrazki skompresowane, więc w trakcie pobierania + przeglądarka może pokazać mniejszy rozmiar niż tabela. Zapisany plik ma rozmiar z tabeli i zgadza + się ze swoim SHA-256.

diff --git a/web/public/pt-br/arquivos-de-exemplo/index.html b/web/public/pt-br/arquivos-de-exemplo/index.html index 52b1f302..be5a58cc 100644 --- a/web/public/pt-br/arquivos-de-exemplo/index.html +++ b/web/public/pt-br/arquivos-de-exemplo/index.html @@ -183,6 +183,9 @@

Um arquivo de cada formato, com 1 MB cada

Documentos, imagens, texto, dados, arquivos compactados, e-mail, telemetria, som e vídeo, cada um com exatamente 1 048 576 bytes e cada um um arquivo real do seu formato. O PDF abre num leitor de PDF, o DOCX no Word, o XLSX no Excel e o ZIP se descompacta. + O servidor envia arquivos de texto e algumas imagens compactados, então durante o download o seu + navegador pode mostrar um tamanho menor que o da tabela. O arquivo salvo tem o tamanho da tabela e + confere com o seu SHA-256.

diff --git a/web/public/ro/fisiere-de-exemplu/index.html b/web/public/ro/fisiere-de-exemplu/index.html index 0919f1ac..633e0f7e 100644 --- a/web/public/ro/fisiere-de-exemplu/index.html +++ b/web/public/ro/fisiere-de-exemplu/index.html @@ -183,6 +183,9 @@

Câte un fișier din fiecare format, fiecare de 1 MB

Documente, imagini, text, date, arhive, e-mail, telemetrie, sunet și video, fiecare de exact 1 048 576 de octeți și fiecare un fișier real al formatului său. PDF-ul se deschide într-un cititor de PDF, DOCX-ul în Word, XLSX-ul în Excel, iar ZIP-ul se dezarhivează. + Serverul trimite fișierele text și unele imagini comprimate, așa că în timpul descărcării browserul + tău poate arăta o dimensiune mai mică decât tabelul. Fișierul salvat are dimensiunea din tabel și se + potrivește cu SHA-256-ul său.

diff --git a/web/public/ru/sample-files/index.html b/web/public/ru/sample-files/index.html index 549f0254..cf0f8b55 100644 --- a/web/public/ru/sample-files/index.html +++ b/web/public/ru/sample-files/index.html @@ -184,6 +184,9 @@

По одному файлу каждого формата, по 1 МБ

Документы, изображения, текст, данные, архивы, почта, телеметрия, звук и видео, каждый файл размером ровно 1 048 576 байт, и каждый - настоящий файл своего формата. PDF открывается в программе просмотра PDF, DOCX в Word, XLSX в Excel, а ZIP распаковывается. + Сервер передаёт текстовые файлы и некоторые изображения в сжатом виде, поэтому во время загрузки + браузер может показать размер меньше, чем в таблице. Сохранённый файл имеет размер из таблицы и + совпадает со своим SHA-256.

diff --git a/web/public/sample-files/index.html b/web/public/sample-files/index.html index 2b723593..43954636 100644 --- a/web/public/sample-files/index.html +++ b/web/public/sample-files/index.html @@ -183,6 +183,9 @@

One file of every format, 1 MB each

Documents, pictures, text, data, archives, mail, telemetry, sound and video, each exactly 1 048 576 bytes and each a real file of its format. The PDF opens in a PDF reader, the DOCX in Word, the XLSX in Excel and the ZIP extracts. + The server sends text files and some pictures compressed, so while one of them downloads, your + browser can show a smaller size than the table. The file it saves has the size in the table and + matches its SHA-256.

diff --git a/web/public/th/sample-files/index.html b/web/public/th/sample-files/index.html index a505a241..a1ada5ac 100644 --- a/web/public/th/sample-files/index.html +++ b/web/public/th/sample-files/index.html @@ -182,6 +182,7 @@

ทุกรูปแบบ รูปแบบละหนึ่งไฟล เอกสาร รูปภาพ ข้อความ ข้อมูล ไฟล์บีบอัด อีเมล เทเลเมทรี เสียง และวิดีโอ แต่ละไฟล์มีขนาด 1 048 576 ไบต์พอดี และแต่ละไฟล์เป็นไฟล์จริงของรูปแบบนั้น ไฟล์ PDF เปิดได้ในโปรแกรมอ่าน PDF ไฟล์ DOCX เปิดใน Word ไฟล์ XLSX เปิดใน Excel และไฟล์ ZIP แตกไฟล์ได้ + เซิร์ฟเวอร์ส่งไฟล์ข้อความและรูปภาพบางไฟล์แบบบีบอัด ระหว่างดาวน์โหลดเบราว์เซอร์จึงอาจแสดงขนาดที่เล็กกว่าในตาราง ไฟล์ที่บันทึกแล้วมีขนาดตามตารางและตรงกับค่า SHA-256 ของไฟล์นั้น

diff --git a/web/public/tr/ornek-dosyalar/index.html b/web/public/tr/ornek-dosyalar/index.html index 89a47b67..ac1a6ca3 100644 --- a/web/public/tr/ornek-dosyalar/index.html +++ b/web/public/tr/ornek-dosyalar/index.html @@ -182,6 +182,9 @@

Her biçimden bir dosya, her biri 1 MB

Belgeler, resimler, metin, veri, arşivler, e-posta, telemetri, ses ve video, her biri tam 1 048 576 bayt ve her biri kendi biçiminde gerçek bir dosya. PDF bir PDF okuyucuda, DOCX Word'de, XLSX Excel'de açılır, ZIP'in içeriği de çıkarılabilir. + Sunucu metin dosyalarını ve bazı resimleri sıkıştırılmış olarak gönderir, bu yüzden indirme + sırasında tarayıcınız tablodakinden daha küçük bir boyut gösterebilir. Kaydedilen dosya tablodaki + boyuttadır ve SHA-256 değeriyle eşleşir.

diff --git a/web/public/uk/sample-files/index.html b/web/public/uk/sample-files/index.html index e39882a9..2a0dd906 100644 --- a/web/public/uk/sample-files/index.html +++ b/web/public/uk/sample-files/index.html @@ -184,6 +184,9 @@

По одному файлу кожного формату, по 1 МБ

Документи, зображення, текст, дані, архіви, пошта, телеметрія, звук і відео, кожен файл розміром рівно 1 048 576 байтів, і кожен - справжній файл свого формату. PDF відкривається в переглядачі PDF, DOCX у Word, XLSX в Excel, а ZIP розпаковується. + Сервер передає текстові файли й деякі зображення в стиснутому вигляді, тому під час завантаження + браузер може показати менший розмір, ніж у таблиці. Збережений файл має розмір із таблиці й + збігається зі своїм SHA-256.

diff --git a/web/public/vi/tep-mau/index.html b/web/public/vi/tep-mau/index.html index 3a867267..2dbc997d 100644 --- a/web/public/vi/tep-mau/index.html +++ b/web/public/vi/tep-mau/index.html @@ -182,6 +182,9 @@

Mỗi định dạng một tệp, mỗi tệp 1 MB

Tài liệu, hình ảnh, văn bản, dữ liệu, tệp nén, thư, telemetry, âm thanh và video, mỗi tệp đúng 1 048 576 byte và mỗi tệp là một tệp thật của định dạng của nó. Tệp PDF mở được trong trình đọc PDF, DOCX trong Word, XLSX trong Excel, còn ZIP giải nén được. + Máy chủ gửi tệp văn bản và một số hình ảnh ở dạng nén, nên trong lúc tải xuống, trình duyệt của bạn + có thể hiển thị kích thước nhỏ hơn so với bảng. Tệp đã lưu có đúng kích thước trong bảng và khớp với + SHA-256 của nó.

diff --git a/web/public/zh-hans/sample-files/index.html b/web/public/zh-hans/sample-files/index.html index 11f02dfc..3338212f 100644 --- a/web/public/zh-hans/sample-files/index.html +++ b/web/public/zh-hans/sample-files/index.html @@ -170,7 +170,7 @@

测试用示例文件

每种格式

每种格式一个文件,每个 1 MB

- 文档、图片、文本、数据、压缩包、邮件、遥测、音频和视频,每个都恰好 1048576 字节,并且都是该格式的真实文件。PDF 能在 PDF 阅读器中打开,DOCX 能在 Word 中打开,XLSX 能在 Excel 中打开,ZIP 能解压。 + 文档、图片、文本、数据、压缩包、邮件、遥测、音频和视频,每个都恰好 1048576 字节,并且都是该格式的真实文件。PDF 能在 PDF 阅读器中打开,DOCX 能在 Word 中打开,XLSX 能在 Excel 中打开,ZIP 能解压。服务器以压缩形式发送文本文件和部分图片,所以下载过程中浏览器显示的大小可能比表中的小。保存下来的文件大小与表中一致,SHA-256 也相符。

diff --git a/web/public/zh-hant/sample-files/index.html b/web/public/zh-hant/sample-files/index.html index 9a13611a..e9e934e7 100644 --- a/web/public/zh-hant/sample-files/index.html +++ b/web/public/zh-hant/sample-files/index.html @@ -170,7 +170,7 @@

測試用範例檔案

每種格式

每種格式一個檔案,每個 1 MB

- 文件、圖片、文字、資料、壓縮檔、郵件、遙測、音訊和影片,每個都恰好 1048576 位元組,而且都是該格式的真實檔案。PDF 能在 PDF 閱讀器中開啟,DOCX 能在 Word 中開啟,XLSX 能在 Excel 中開啟,ZIP 能解壓縮。 + 文件、圖片、文字、資料、壓縮檔、郵件、遙測、音訊和影片,每個都恰好 1048576 位元組,而且都是該格式的真實檔案。PDF 能在 PDF 閱讀器中開啟,DOCX 能在 Word 中開啟,XLSX 能在 Excel 中開啟,ZIP 能解壓縮。伺服器會以壓縮形式傳送文字檔和部分圖片,所以下載時瀏覽器顯示的大小可能比表中的小。儲存下來的檔案大小與表中一致,SHA-256 也相符。

From e0e5f5519ed7a3b90495ae6da8140667e276e63e Mon Sep 17 00:00:00 2001 From: DonislawDev Date: Tue, 24 Nov 2026 20:16:04 +0100 Subject: [PATCH 2/3] Update x/text, x/image, jxl, gav1d and the OSV scanner action The four Go modules take the versions of the Dependabot pull requests #254 to #257: golang.org/x/text 0.44.0, golang.org/x/image 0.48.0, github.com/gen2brain/jxl 0.2.1 and github.com/gen2brain/gav1d 0.2.7. THIRD-PARTY-NOTICES.md names the new versions, which is what kept each of those pull requests red. Their licence and patent files are the same as before, no module entered or left the graph, and the encoders of jxl and gav1d did not change. The golden values hold, and the 62 sample files made by the new build match the sums on the site. google/osv-scanner-action moves to v2.7.1 (#259), which only changed the tag of its image. .github/osv-scanner-digest holds the digest of that image, read from the pull in the run and from the registry. Co-Authored-By: Claude Opus 5.5 --- .github/osv-scanner-digest | 2 +- .github/workflows/osv-pull-request.yml | 6 +++--- .github/workflows/osv-weekly.yml | 4 ++-- THIRD-PARTY-NOTICES.md | 14 ++++++++++---- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 6 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/osv-scanner-digest b/.github/osv-scanner-digest index 98d1e65b..c59a1b96 100644 --- a/.github/osv-scanner-digest +++ b/.github/osv-scanner-digest @@ -1 +1 @@ -sha256:d54770fe0b09493894e76a02aaed9f51a0513fa57c5186452a755d257b0068a6 +sha256:3fa25659351c9a5527b30d73b6f3c2ee0bcac106d6220948211d87379d08f243 diff --git a/.github/workflows/osv-pull-request.yml b/.github/workflows/osv-pull-request.yml index 3a21fba4..62a3ca53 100644 --- a/.github/workflows/osv-pull-request.yml +++ b/.github/workflows/osv-pull-request.yml @@ -82,7 +82,7 @@ jobs: # function is reachable is what the govulncheck job answers. - name: scan the branch this merges into id: old - uses: google/osv-scanner-action/osv-scanner-action@b1d267aea5211fa648d9d442fa64b90dbdcbdd36 # v2.7.0 + uses: google/osv-scanner-action/osv-scanner-action@32d3cd482bdadfb38b186c0ad1b031902d55d932 # v2.7.1 continue-on-error: true with: scan-args: |- @@ -99,7 +99,7 @@ jobs: - name: scan the merge of this pull request id: new - uses: google/osv-scanner-action/osv-scanner-action@b1d267aea5211fa648d9d442fa64b90dbdcbdd36 # v2.7.0 + uses: google/osv-scanner-action/osv-scanner-action@32d3cd482bdadfb38b186c0ad1b031902d55d932 # v2.7.1 continue-on-error: true with: scan-args: |- @@ -138,7 +138,7 @@ jobs: # table come out byte for byte as they did under the deprecated # --output and --gh-annotations (docs/OSV-2-2026-10-15.md). - name: what this pull request adds - uses: google/osv-scanner-action/osv-reporter-action@b1d267aea5211fa648d9d442fa64b90dbdcbdd36 # v2.7.0 + uses: google/osv-scanner-action/osv-reporter-action@32d3cd482bdadfb38b186c0ad1b031902d55d932 # v2.7.1 with: scan-args: |- --old=osv-old.json diff --git a/.github/workflows/osv-weekly.yml b/.github/workflows/osv-weekly.yml index 33d48fa3..5cfaa510 100644 --- a/.github/workflows/osv-weekly.yml +++ b/.github/workflows/osv-weekly.yml @@ -67,7 +67,7 @@ jobs: - name: scan id: scan - uses: google/osv-scanner-action/osv-scanner-action@b1d267aea5211fa648d9d442fa64b90dbdcbdd36 # v2.7.0 + uses: google/osv-scanner-action/osv-scanner-action@32d3cd482bdadfb38b186c0ad1b031902d55d932 # v2.7.1 continue-on-error: true with: scan-args: |- @@ -93,7 +93,7 @@ jobs: # way the deprecated --output printed it, measured byte for byte # 2026-10-15 (docs/OSV-2-2026-10-15.md). - name: results for the Security tab - uses: google/osv-scanner-action/osv-reporter-action@b1d267aea5211fa648d9d442fa64b90dbdcbdd36 # v2.7.0 + uses: google/osv-scanner-action/osv-reporter-action@32d3cd482bdadfb38b186c0ad1b031902d55d932 # v2.7.1 with: scan-args: |- --new=osv-results.json diff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.md index aa35ef2a..53be79a1 100644 --- a/THIRD-PARTY-NOTICES.md +++ b/THIRD-PARTY-NOTICES.md @@ -78,7 +78,7 @@ Source: ## golang.org/x/text -Version 0.43.0. Supplies Unicode normalisation, used to decide whether two file +Version 0.44.0. Supplies Unicode normalisation, used to decide whether two file names are one name spelled two ways. ``` @@ -121,7 +121,7 @@ Source: ## github.com/gen2brain/gav1d -Version 0.2.6. Codes and reads AV1, which is what the picture inside an +Version 0.2.7. Codes and reads AV1, which is what the picture inside an AVIF is. It is written in Go and assembly with no C in it and no module of its own behind it, so it brings nothing else along. @@ -163,7 +163,7 @@ Source: ## github.com/gen2brain/jxl -Version 0.2.0. Codes JPEG XL. It is written in Go and assembly with no C in +Version 0.2.1. Codes JPEG XL. It is written in Go and assembly with no C in it and no module of its own behind it, so it brings nothing else along. ``` @@ -237,6 +237,12 @@ move. published advisories name v0.60.0. Its licence file is byte for byte the one at v0.60.0, and no module entered or left the graph. +`golang.org/x/image` went to v0.48.0 on 2026-11-24, on the same day as +`golang.org/x/text` v0.44.0, `github.com/gen2brain/jxl` v0.2.1 and +`github.com/gen2brain/gav1d` v0.2.7, whose sections are above. The licence and +patent files of all four are byte for byte the ones at the versions before, +and no module entered or left the graph. + Two arrived later than the rest. `github.com/FyshOS/fancyfs` came in on the same day with the folder picker, because the toolkit's dialog package imports it to decorate folder icons. Its licence was read before it was @@ -288,7 +294,7 @@ is the module's own MIT, carried unchanged. | `github.com/srwiley/oksvg` | v0.0.0-20221011165216-be6e8873101c | BSD-3-Clause | (c) 2018, Steven R Wiley | | `github.com/srwiley/rasterx` | v0.0.0-20220730225603-2ab79fcdd4ef | BSD-3-Clause | (c) 2018, Steven R Wiley | | `github.com/yuin/goldmark` | v1.8.2 | MIT | (c) 2019 Yusuke Inuzuka | -| `golang.org/x/image` | v0.46.0 | BSD-3-Clause | 2009 The Go Authors. | +| `golang.org/x/image` | v0.48.0 | BSD-3-Clause | 2009 The Go Authors. | | `golang.org/x/net` | v0.62.0 | BSD-3-Clause | 2009 The Go Authors. | | `golang.org/x/sys` | v0.50.0 | BSD-3-Clause | 2009 The Go Authors. | diff --git a/go.mod b/go.mod index c26f5962..1d69ddbb 100644 --- a/go.mod +++ b/go.mod @@ -90,13 +90,13 @@ go 1.27.4 require ( fyne.io/fyne/v2 v2.8.2 - github.com/gen2brain/gav1d v0.2.6 - github.com/gen2brain/jxl v0.2.0 + github.com/gen2brain/gav1d v0.2.7 + github.com/gen2brain/jxl v0.2.1 github.com/goccy/go-yaml v1.19.2 github.com/nicksnyder/go-i18n/v2 v2.7.0 - golang.org/x/image v0.46.0 + golang.org/x/image v0.48.0 golang.org/x/sys v0.50.0 - golang.org/x/text v0.43.0 + golang.org/x/text v0.44.0 ) require ( diff --git a/go.sum b/go.sum index 16531a00..76b22428 100644 --- a/go.sum +++ b/go.sum @@ -22,10 +22,10 @@ github.com/fyne-io/image v0.1.1 h1:WH0z4H7qfvNUw5l4p3bC1q70sa5+YWVt6HCj7y4VNyA= github.com/fyne-io/image v0.1.1/go.mod h1:xrfYBh6yspc+KjkgdZU/ifUC9sPA5Iv7WYUBzQKK7JM= github.com/fyne-io/oksvg v0.2.1-0.20260918172519-a9af55fa95d9 h1:owsdpq6a2KhaAA/hoHGQmFM7kOgKo3srXZVGnbEUzr0= github.com/fyne-io/oksvg v0.2.1-0.20260918172519-a9af55fa95d9/go.mod h1:dJ9oEkPiWhnTFNCmRgEze+YNprJF7YRbpjgpWS4kzoI= -github.com/gen2brain/gav1d v0.2.6 h1:7TSkrWTdE22k5Ul7vYZML7Nu80gNW6OovV7FSCITSE0= -github.com/gen2brain/gav1d v0.2.6/go.mod h1:ReFKjHq7pvRhEk+pgRPAo9gOlcrf51sdzVcAbbX7e0E= -github.com/gen2brain/jxl v0.2.0 h1:cXSQnfbcC0JGFzaI344VzPMbe7mh6rYc0tjPcBUsE4U= -github.com/gen2brain/jxl v0.2.0/go.mod h1:VjJHRai/8I8Es01mULqyiOihRBOjJr1Zo+NoN/MyIwo= +github.com/gen2brain/gav1d v0.2.7 h1:ehu3jWt+0/46Is5llW/ZyX2OA3hTBJNukKnebzuk8KU= +github.com/gen2brain/gav1d v0.2.7/go.mod h1:ReFKjHq7pvRhEk+pgRPAo9gOlcrf51sdzVcAbbX7e0E= +github.com/gen2brain/jxl v0.2.1 h1:74+8uw2RxUHGDVrDp+727PZ2hvAd5/psyV/mpsOQea0= +github.com/gen2brain/jxl v0.2.1/go.mod h1:d7VMurg9ek62xfuyZyVAumFcuaQf9U8NlW57j/k5MQI= github.com/go-gl/glfw/v3.4/glfw v0.1.0-pre.2 h1:ez76TQInhkDIMobWbOFcPJw6FeB7coXRAVZpKwF8NBg= github.com/go-gl/glfw/v3.4/glfw v0.1.0-pre.2/go.mod h1:T5Dn0JwIJOX1euPZ/iT4tq6nFYtmukjcYa7937HuYK8= github.com/go-text/render v0.2.1 h1:qwHhxqGUjjg4L0XyJWj7M7bpY75NZM+kBpv2Yfw5mcg= @@ -70,14 +70,14 @@ github.com/yuin/goldmark v1.8.2 h1:kEGpgqJXdgbkhcOgBxkC0X0PmoPG1ZyoZ117rDVp4zE= github.com/yuin/goldmark v1.8.2/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= -golang.org/x/image v0.46.0 h1:b1+oYj0Jbp6K5MDT4i4/eZpYlk3V8SJhhDKh6LBHAyQ= -golang.org/x/image v0.46.0/go.mod h1:3B3W05VGVQyuXucLINLjXKrqISASfi4Xj+iCVkLMwew= +golang.org/x/image v0.48.0 h1:1AvuPcuoOTJpA7s4VZ5umrb90T3So0rkB/bSGmxkxik= +golang.org/x/image v0.48.0/go.mod h1:mmtg64iqJKGqEgy+r13dfybl85tmxUd2lMnmaiSdWYY= golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY= golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs= golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= -golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc= -golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s= +golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= +golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From ba6115ce2cd3f74492c7c25656816cfb022c061c Mon Sep 17 00:00:00 2001 From: DonislawDev Date: Tue, 24 Nov 2026 20:59:45 +0100 Subject: [PATCH 3/3] Publish the site without waiting for the jobs on macOS GitHub has cancelled the macOS jobs of CI again and again for want of a runner, and each time the site waited hours for a rerun although nothing it shows comes from macOS. A new first job of pages.yml reads the jobs of the CI run that triggered it and asks site_gate.py: every job outside macOS succeeded or was skipped, a "test on" verdict among them succeeded, and the commit is still the tip of main, so a later try of an older run cannot put its site back over a newer one. A verdict of no leaves the job green and the jobs after it skipped, and a script that cannot judge turns it red. The publish condition guard now reads each job's condition on its own. Each condition is written in three jobs, and a search of the whole file found the copy that was left when one job lost its own. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/site_gate.py | 106 ++++++++++++ .github/workflows/pages.yml | 81 +++++++-- internal/guard/mutationcoverage_test.go | 2 + internal/guard/pagesdeploy_test.go | 50 +++--- internal/guard/publishcondition_test.go | 217 ++++++++++++++++++++---- internal/guard/sitegate_test.go | 83 +++++++++ 6 files changed, 472 insertions(+), 67 deletions(-) create mode 100644 .github/scripts/site_gate.py create mode 100644 internal/guard/sitegate_test.go diff --git a/.github/scripts/site_gate.py b/.github/scripts/site_gate.py new file mode 100644 index 00000000..ce3acf37 --- /dev/null +++ b/.github/scripts/site_gate.py @@ -0,0 +1,106 @@ +"""Whether the site may go out for the CI run that triggered it. + + site_gate.py JOBS HEAD TIP + +JOBS is the jobs of the CI run, a name, a conclusion and the runner labels to +a line with a tab between each, as the ci job of pages.yml asks the API for +them. filter=latest answers with the newest try of every job, so a job that +was run again is judged by the try that counts. HEAD is the commit CI ran on +and TIP the commit main is at now. + +Exit 0: the site goes out. Exit 3: it does not, and the lines above say why. +Anything else: the script could not judge, and the job goes red rather than +holding the site back without anyone seeing it. + +Jobs on macOS are left out. GitHub has had no macOS arm64 runner free long +enough, again and again, that it cancelled those jobs before their first step +(O371), and nothing the site shows depends on macOS: the pages are compared +with the program by the guards on every system, and the sample files are made +on Linux. A job is on macOS when its runner labels name macOS, or when its name +does - the verdict "test on macos-latest" runs on Linux and judges the macOS +parts. Every other job has to have succeeded or been skipped, and at least one +verdict "test on ..." has to have succeeded, so a list that lost the guards +does not pass for a green one. + +A commit that is no longer the tip of main does not go out. Every try of CI +ends in a run of this workflow, so an older commit whose macOS jobs were run +again later would otherwise put its site back over a newer one. +""" + +import sys + +PUBLISH, HOLD, CANNOT = 0, 3, 2 + +# What a job that is neither red nor still running concludes. +PASSED = ("success", "skipped") + +# The name the verdicts of ci.yml carry, one for each system. +VERDICT = "test on " + + +def cannot(message): + print("site_gate: " + message, file=sys.stderr) + sys.exit(CANNOT) + + +def on_macos(name, labels): + """A job about macOS: its runner, or its name, says so.""" + if "macos" in name.lower(): + return True + return any(label.strip().lower().startswith("macos") for label in labels.split(",")) + + +def read_jobs(path): + try: + with open(path, encoding="utf-8") as f: + lines = [line.rstrip("\r\n") for line in f] + except OSError as e: + cannot("could not read the list of jobs %s: %s" % (path, e)) + jobs = [] + for number, line in enumerate(lines, 1): + if not line.strip(): + continue + fields = line.split("\t") + if len(fields) < 2 or not fields[0].strip() or not fields[1].strip(): + cannot("line %d of %s is not a name and a conclusion with a tab between: %r" % (number, path, line)) + jobs.append((fields[0].strip(), fields[1].strip(), fields[2] if len(fields) > 2 else "")) + if not jobs: + cannot("%s lists no job, so nothing says CI ran at all" % path) + return jobs + + +def judge(jobs, head, tip): + """The reasons the site does not go out, none when it does.""" + reasons, verdicts = [], 0 + for name, conclusion, labels in jobs: + if on_macos(name, labels): + print("left out, on macOS: %s (%s)" % (name, conclusion)) + continue + if conclusion not in PASSED: + reasons.append("%s concluded %s" % (name, conclusion)) + if name.startswith(VERDICT) and conclusion == "success": + verdicts += 1 + if verdicts == 0: + reasons.append("no verdict \"%s...\" outside macOS succeeded, so nothing says the guards passed" % VERDICT) + if head != tip: + reasons.append("CI ran on %s and main is at %s now, so this site would replace a newer one" % (head, tip)) + return reasons + + +def main(): + if len(sys.argv) != 4: + cannot("usage: site_gate.py JOBS HEAD TIP") + _, path, head, tip = sys.argv + if not head.strip() or not tip.strip(): + cannot("the commit CI ran on or the tip of main is empty") + reasons = judge(read_jobs(path), head.strip(), tip.strip()) + for reason in reasons: + print("the site does not go out: " + reason) + if reasons: + sys.exit(HOLD) + print("the site goes out: every job outside macOS passed, on the tip of main") + sys.exit(PUBLISH) + + +if __name__ == "__main__": + main() diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index fcc90545..c06fb430 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -10,7 +10,11 @@ name: Site # could put a stale page up while CI was still going red about it. # # So the site goes out only after CI has passed on main, for the exact commit -# CI passed on. A red suite means the site does not move. +# CI passed on, and only while that commit is still the tip of main. A red +# suite means the site does not move. The jobs on macOS are left out of that +# question (O371): GitHub cancelled them again and again for want of a runner, +# each time holding the site back for hours, and nothing the site shows comes +# from macOS. The ci job below asks, .github/scripts/site_gate.py answers. on: workflow_run: workflows: ["CI"] @@ -32,6 +36,58 @@ concurrency: cancel-in-progress: false jobs: + # Whether CI passed on this commit, macOS aside, and whether the commit is + # still the tip of main. It reads the jobs of the run that triggered this one + # and holds nothing but read access. A verdict of no is an answer, not a + # failure, so it leaves this job green and the jobs after it skipped. A script + # that cannot judge turns it red, so a broken gate is seen. + ci: + name: CI passed, macOS aside + if: >- + github.event_name == 'workflow_dispatch' || + (github.event.workflow_run.event == 'push' && + github.event.workflow_run.head_repository.full_name == github.repository) + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: read + actions: read + outputs: + publish: ${{ steps.verdict.outputs.publish }} + steps: + # The script comes from main as it is now, never from the commit being + # judged, so nothing a branch carries runs here. + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + sparse-checkout: .github/scripts + + - name: read the jobs of the CI run and judge them + id: verdict + env: + GH_TOKEN: ${{ github.token }} + EVENT: ${{ github.event_name }} + RUN_ID: ${{ github.event.workflow_run.id }} + HEAD_SHA: ${{ github.event.workflow_run.head_sha }} + run: | + set -euo pipefail + # A dispatch is a person asking on purpose, with no CI run to read. + if [ "$EVENT" = workflow_dispatch ]; then + echo "publish=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + gh api "repos/$GITHUB_REPOSITORY/actions/runs/$RUN_ID/jobs?filter=latest&per_page=100" --paginate \ + --jq '.jobs[] | [.name, (.conclusion // "none"), (.labels | join(","))] | @tsv' > "$RUNNER_TEMP/jobs.tsv" + tip=$(gh api "repos/$GITHUB_REPOSITORY/commits/main" --jq .sha) + code=0 + python3 .github/scripts/site_gate.py "$RUNNER_TEMP/jobs.tsv" "$HEAD_SHA" "$tip" || code=$? + case "$code" in + 0) echo "publish=true" >> "$GITHUB_OUTPUT" ;; + 3) echo "publish=false" >> "$GITHUB_OUTPUT" + echo "::notice::The site does not move for $HEAD_SHA. The lines above say why." ;; + *) exit "$code" ;; + esac + # The files of the sample files page are not in the repository. The recipe # beside the page makes them with the tfg of this commit, and every one is # checked against the SHA256SUMS the page was rendered with before it may go @@ -39,11 +95,12 @@ jobs: # A job of its own, with nothing but read access, because it builds and runs # repository code and the job that deploys holds pages: write. samples: + needs: ci if: >- - github.event_name == 'workflow_dispatch' || - (github.event.workflow_run.conclusion == 'success' && - github.event.workflow_run.event == 'push' && - github.event.workflow_run.head_repository.full_name == github.repository) + needs.ci.outputs.publish == 'true' && + (github.event_name == 'workflow_dispatch' || + (github.event.workflow_run.event == 'push' && + github.event.workflow_run.head_repository.full_name == github.repository)) runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -83,14 +140,14 @@ jobs: retention-days: 1 publish: - needs: samples + needs: [ci, samples] # Read access only. It uploads the site, and the deploy job after it is the # one that publishes. configure-pages only reads the Pages settings here. permissions: contents: read pages: read - # A dispatch is a person asking on purpose. Everything else has to be CI - # saying the tree is good, ON THIS REPOSITORY, for a push. + # A dispatch is a person asking on purpose. Everything else has to be the + # ci job saying the tree is good, ON THIS REPOSITORY, for a push. # # The last two conditions were added on 2026-08-27, the day this project # started taking pull requests, and they close a hole that opened with it. @@ -107,10 +164,10 @@ jobs: # rather than anything reaching a secret. That is still not a thing to leave # open once anyone can open a pull request. if: >- - github.event_name == 'workflow_dispatch' || - (github.event.workflow_run.conclusion == 'success' && - github.event.workflow_run.event == 'push' && - github.event.workflow_run.head_repository.full_name == github.repository) + needs.ci.outputs.publish == 'true' && + (github.event_name == 'workflow_dispatch' || + (github.event.workflow_run.event == 'push' && + github.event.workflow_run.head_repository.full_name == github.repository)) runs-on: ubuntu-latest timeout-minutes: 10 steps: diff --git a/internal/guard/mutationcoverage_test.go b/internal/guard/mutationcoverage_test.go index cc46876f..c83cfb91 100644 --- a/internal/guard/mutationcoverage_test.go +++ b/internal/guard/mutationcoverage_test.go @@ -251,6 +251,8 @@ var provenByProbe = map[string]string{ "directory, as every part of the first run of the parts did: red, mine.txt cannot be read.", "TestAVerdictPassesOnlyWhenEveryPartRanAndPassed": "a table of runs, the first of which has to pass, so the refusals " + "are not the script refusing everything.", + "TestTheSiteWaitsForEveryJobOfCIButTheOnesOnMacOS": "a table of runs, the first two of which have to pass. Broken " + + "by hand on 2026-11-24 by reading every job as one on macOS: red on both.", "TestTheLogOfAPartIsAFileGitIgnores": "a canary of its own - a name no rule ignores has to be found not ignored - " + "and it asks that it reached the log of the test, race and coverage jobs. Broken by hand on 2026-11-18 by taking " + "/part.log out of .gitignore: red in all three jobs.", diff --git a/internal/guard/pagesdeploy_test.go b/internal/guard/pagesdeploy_test.go index 9b418de7..aa716a18 100644 --- a/internal/guard/pagesdeploy_test.go +++ b/internal/guard/pagesdeploy_test.go @@ -9,17 +9,39 @@ import ( // pagesStep is the part of a workflow step this guard reads. type pagesStep struct { - ID string `yaml:"id"` - If string `yaml:"if"` - Uses string `yaml:"uses"` - ContinueOnError bool `yaml:"continue-on-error"` + ID string `yaml:"id"` + If string `yaml:"if"` + Uses string `yaml:"uses"` + Run string `yaml:"run"` + With map[string]any `yaml:"with"` + Env map[string]string `yaml:"env"` + ContinueOnError bool `yaml:"continue-on-error"` } -// pagesJob is the part of a workflow job this guard reads. +// pagesJob is the part of a workflow job this guard and the publish +// condition guard read. type pagesJob struct { - Needs any `yaml:"needs"` - Permissions any `yaml:"permissions"` - Steps []pagesStep `yaml:"steps"` + If string `yaml:"if"` + Needs any `yaml:"needs"` + Permissions any `yaml:"permissions"` + Outputs map[string]string `yaml:"outputs"` + Steps []pagesStep `yaml:"steps"` +} + +// needsOf is the jobs a job waits for, whether it names one or a list. +func needsOf(job pagesJob) map[string]bool { + needs := map[string]bool{} + switch n := job.Needs.(type) { + case string: + needs[n] = true + case []any: + for _, v := range n { + if s, ok := v.(string); ok { + needs[s] = true + } + } + } + return needs } // pagesDeployProblems is what is wrong with how a workflow uploads and deploys @@ -66,17 +88,7 @@ func pagesDeployProblems(body []byte) []string { problems = append(problems, "the job "+name+" uploads the site and deploys it, and in one job the "+ "lookup by name misses the artifact uploaded a moment before") } - needs := map[string]bool{} - switch n := workflow.Jobs[name].Needs.(type) { - case string: - needs[n] = true - case []any: - for _, v := range n { - if s, ok := v.(string); ok { - needs[s] = true - } - } - } + needs := needsOf(workflow.Jobs[name]) for up := range uploads { if !needs[up] { problems = append(problems, "the job "+name+" does not wait for "+up+", which uploads what it deploys") diff --git a/internal/guard/publishcondition_test.go b/internal/guard/publishcondition_test.go index b0cc87a5..494cd7c5 100644 --- a/internal/guard/publishcondition_test.go +++ b/internal/guard/publishcondition_test.go @@ -1,66 +1,211 @@ package guard import ( + "fmt" "os" "path/filepath" "strings" "testing" + + "github.com/goccy/go-yaml" ) -// Publishing the website happens for a push to this repository, and nothing else. +// Publishing the website happens for a push to this repository after CI passed +// on it, and for nothing else. // -// The job that uploads web/public triggers on workflow_run, and the deploy job -// that publishes it runs only after that one. The event fires in the BASE -// repository, with the base repository's permissions, and the deploy job holds -// pages: write. CI runs on pull_request, and the branches filter on -// workflow_run matches the branch NAME of the run that triggered it - which for -// a pull request from a fork is a name the fork chose. A fork whose branch was -// called main, opening a pull request that passed CI, would otherwise satisfy -// every condition the upload job had before 2026-08-27. +// The jobs of pages.yml trigger on workflow_run, and the deploy job that +// publishes runs only after them. The event fires in the BASE repository, with +// the base repository's permissions, and the deploy job holds pages: write. CI +// runs on pull_request, and the branches filter on workflow_run matches the +// branch NAME of the run that triggered it - which for a pull request from a +// fork is a name the fork chose. A fork whose branch was called main, opening a +// pull request that passed CI, would otherwise satisfy every condition the +// upload job had before 2026-08-27. // -// Nothing in the job executes repository code. It checks three files exist and -// uploads a directory, so what was reachable was the content of the published -// site rather than a secret. That is defacement of the project website, which is -// worth a condition. +// Whether CI passed is the ci job's question, answered by site_gate.py with +// the jobs on macOS left out (O371). Every job that checks out the commit CI +// ran on - the one that makes the sample files and the one that uploads the +// pages - waits for that answer and asks the two questions about the push in +// its own condition. // -// Read as text rather than by parsing the expression, because what matters is -// that both questions are asked at all. A YAML parser would hand back one -// string and this would still have to look inside it. +// Read job by job rather than over the whole file. Each condition is written +// in more than one job, so a search of the file finds the copy that is left +// when one job loses its own. func TestTheSiteIsPublishedOnlyForAPushToThisRepository(t *testing.T) { path := filepath.Join(repoRoot(t), ".github", "workflows", "pages.yml") body, err := os.ReadFile(path) if err != nil { t.Skipf("the publishing workflow is not here: %v", err) } - text := withoutYamlComments(string(body)) // The trigger this is all about. If it ever stops being workflow_run the // conditions below are answering a question nobody asked any more, and this // guard should be revisited rather than quietly kept passing. - if !strings.Contains(text, "workflow_run:") { + if !strings.Contains(withoutYamlComments(string(body)), "workflow_run:") { t.Fatalf("pages.yml no longer triggers on workflow_run, so this guard is " + "defending a shape that is gone. Read it again before deleting it.") } + for _, p := range publishConditionProblems(body) { + t.Errorf("pages.yml: %s.\nThe jobs run with the base repository's permissions, and the deploy job after them holds pages: write.", p) + } - for _, want := range []struct{ needle, why string }{ - { - "head_repository.full_name == github.repository", - "without it a fork's pull request run can reach a job that publishes the website", - }, - { - "workflow_run.event == 'push'", - "a run triggered by a pull request must never publish, whoever opened it", - }, - { - "workflow_run.conclusion == 'success'", - "a red suite means the site does not move, which is why this job waits for CI at all", - }, + // The canaries. The first is sound and has to pass, so the rest are not + // the check refusing every workflow. + sound := publishCanary(pushHere, "needs.ci.outputs.publish == 'true' && "+pushHere, "ci") + if p := publishConditionProblems(sound); len(p) != 0 { + t.Errorf("the canary of a sound workflow was refused: %v", p) + } + for _, c := range []struct{ name, gateIf, buildIf, needs string }{ + {"a job that builds the site does not ask whose repository it is", pushHere, + "needs.ci.outputs.publish == 'true' && github.event.workflow_run.event == 'push'", "ci"}, + {"a job that builds the site does not wait for the verdict", pushHere, pushHere, "ci"}, + {"a job that builds the site does not need the ci job", pushHere, + "needs.ci.outputs.publish == 'true' && " + pushHere, "other"}, + {"a job that builds the site runs whatever the verdict was", pushHere, + "always() && needs.ci.outputs.publish == 'true' && " + pushHere, "ci"}, + {"the ci job does not ask whether the run was a push", + "github.event.workflow_run.head_repository.full_name == github.repository", + "needs.ci.outputs.publish == 'true' && " + pushHere, "ci"}, } { - if !strings.Contains(text, want.needle) { - t.Errorf("the publish job does not ask for %q.\n"+ - "That condition is there because %s.\n"+ - "It runs with the base repository's permissions, and the deploy job after it holds pages: write.", - want.needle, want.why) + if len(publishConditionProblems(publishCanary(c.gateIf, c.buildIf, c.needs))) == 0 { + t.Errorf("the canary %q passed, so the check cannot see that", c.name) + } + } +} + +// pushHere is the condition that the run which triggered the site was a push, +// to this repository rather than a fork. +const pushHere = "github.event.workflow_run.event == 'push' && " + + "github.event.workflow_run.head_repository.full_name == github.repository" + +// pushQuestions is what each job asks of the run that triggered it, and why. +var pushQuestions = []struct{ needle, why string }{ + {"github.event.workflow_run.head_repository.full_name == github.repository", + "without it a fork's pull request run can reach a job that publishes the website"}, + {"github.event.workflow_run.event == 'push'", + "a run triggered by a pull request must never publish, whoever opened it"}, +} + +// checksOutTheRunsCommit tells whether a job checks out the commit CI ran on. +func checksOutTheRunsCommit(job pagesJob) bool { + for _, s := range job.Steps { + if ref, _ := s.With["ref"].(string); strings.HasPrefix(s.Uses, "actions/checkout@") && + strings.Contains(ref, "workflow_run.head_sha") { + return true + } + } + return false +} + +// gateProblems is what is wrong with the ci job: it has to ask about the push, +// give its verdict as an output, hand site_gate.py the run and its commit, and +// judge with the script of main rather than of the commit it judges. +func gateProblems(name string, job pagesJob) []string { + var problems []string + for _, q := range pushQuestions { + if !strings.Contains(job.If, q.needle) { + problems = append(problems, fmt.Sprintf("the job %s does not ask for %q, and %s", name, q.needle, q.why)) } } + if job.Outputs["publish"] == "" { + problems = append(problems, "the job "+name+" gives no publish output, so no job can wait for its verdict") + } + if checksOutTheRunsCommit(job) { + problems = append(problems, "the job "+name+" checks out the commit it judges, so a branch's own script would judge it") + } + for _, s := range job.Steps { + if !strings.Contains(s.Run, "site_gate.py") { + continue + } + env := "" + for _, v := range s.Env { + env += v + "\n" + } + for _, want := range []string{"github.event.workflow_run.id", "github.event.workflow_run.head_sha"} { + if !strings.Contains(env, want) { + problems = append(problems, "the step of "+name+" that asks site_gate.py is not given "+want) + } + } + } + return problems +} + +// publishConditionProblems is what is wrong with how a workflow decides to +// publish the site: nothing when one job asks site_gate.py, and every job +// that checks out the commit CI ran on waits for its verdict and asks about +// the push itself. +func publishConditionProblems(body []byte) []string { + var workflow struct { + Jobs map[string]pagesJob `yaml:"jobs"` + } + if err := yaml.Unmarshal(body, &workflow); err != nil { + return []string{"the workflow does not parse: " + err.Error()} + } + var gates []string + for name, job := range workflow.Jobs { + for _, s := range job.Steps { + if strings.Contains(s.Run, "site_gate.py") { + gates = append(gates, name) + break + } + } + } + if len(gates) != 1 { + return []string{fmt.Sprintf("%d jobs ask site_gate.py whether the site may go out, and one has to", len(gates))} + } + gate := gates[0] + problems := gateProblems(gate, workflow.Jobs[gate]) + built := 0 + for name, job := range workflow.Jobs { + if name == gate || !checksOutTheRunsCommit(job) { + continue + } + built++ + for _, q := range pushQuestions { + if !strings.Contains(job.If, q.needle) { + problems = append(problems, fmt.Sprintf("the job %s does not ask for %q, and %s", name, q.needle, q.why)) + } + } + if !needsOf(job)[gate] || !strings.Contains(job.If, "needs."+gate+".outputs.publish == 'true'") { + problems = append(problems, "the job "+name+" does not wait for the verdict of "+gate+ + ", and a red suite outside macOS means the site does not move") + } + for _, f := range []string{"always()", "failure()", "cancelled()"} { + if strings.Contains(job.If, f) { + problems = append(problems, "the job "+name+" asks "+f+", so it runs whatever "+gate+" decided") + } + } + } + if built == 0 { + problems = append(problems, "no job checks out the commit CI ran on, so nothing here builds the site and this check reads nothing") + } + return problems +} + +// publishCanary is a workflow with a ci job and one job that builds the site +// from the commit CI ran on, under the conditions given. +func publishCanary(gateIf, buildIf, buildNeeds string) []byte { + return []byte(`on: + workflow_run: + workflows: ["CI"] +jobs: + ci: + if: "` + gateIf + `" + outputs: + publish: ${{ steps.verdict.outputs.publish }} + steps: + - uses: actions/checkout@0000000000000000000000000000000000000000 + - id: verdict + env: + RUN_ID: ${{ github.event.workflow_run.id }} + HEAD_SHA: ${{ github.event.workflow_run.head_sha }} + run: python3 .github/scripts/site_gate.py jobs.tsv "$HEAD_SHA" tip + build: + needs: ` + buildNeeds + ` + if: "` + buildIf + `" + steps: + - uses: actions/checkout@0000000000000000000000000000000000000000 + with: + ref: ${{ github.event.workflow_run.head_sha }} +`) } diff --git a/internal/guard/sitegate_test.go b/internal/guard/sitegate_test.go new file mode 100644 index 00000000..67bf1e39 --- /dev/null +++ b/internal/guard/sitegate_test.go @@ -0,0 +1,83 @@ +package guard + +import ( + "errors" + "os/exec" + "path/filepath" + "testing" +) + +// The site goes out after CI with the jobs on macOS left out (O371): the ci +// job of pages.yml reads the jobs of the run that triggered it and asks +// .github/scripts/site_gate.py whether the site may go out. + +// siteGateRun asks the gate about a list of jobs and returns its exit code +// and what it printed. +func siteGateRun(t *testing.T, python string, jobs []string, head, tip string) (int, string) { + t.Helper() + script := filepath.Join(repoRoot(t), ".github", "scripts", "site_gate.py") + out, err := exec.Command(python, script, writeLines(t, "jobs.tsv", jobs...), head, tip).CombinedOutput() + var exit *exec.ExitError + switch { + case err == nil: + return 0, string(out) + case errors.As(err, &exit): + return exit.ExitCode(), string(out) + } + t.Fatalf("running %s: %v", script, err) + return 0, "" +} + +// TestTheSiteWaitsForEveryJobOfCIButTheOnesOnMacOS hands the gate the jobs of +// a run the way the API lists them, a name, a conclusion and the runner labels. +// +// The first two cases have to pass, so the refusals are not the script +// refusing everything: one is a green run, the other the run of 2026-11-24 +// whose macOS jobs GitHub cancelled for want of a runner, with the verdict +// "test on macos-latest" red on a Linux runner. Every refusal after them is +// one way the site could go out while the tree it shows was not good: a Linux +// or Windows job red, cancelled or still running, a list with no verdict, a +// commit main has moved past. A list it cannot read is neither yes nor no, so +// the ci job goes red instead of holding the site back unseen. +func TestTheSiteWaitsForEveryJobOfCIButTheOnesOnMacOS(t *testing.T) { + python := pythonForGate(t) + const head, publish, hold = "1111111", 0, 3 + green := []string{ + "guards on ubuntu-latest (part 0 of 2)\tsuccess\tubuntu-latest", + "guards on windows-latest (part 0 of 2)\tsuccess\twindows-latest", + "guards on macos-latest (part 0 of 2)\tsuccess\tmacos-latest", + "test on ubuntu-latest\tsuccess\tubuntu-latest", + "test on windows-latest\tsuccess\tubuntu-latest", + "test on macos-latest\tsuccess\tubuntu-latest", + "fuzzing with a time budget\tskipped\tubuntu-latest", + } + with := func(extra ...string) []string { return append(append([]string{}, green...), extra...) } + cases := []struct { + name string + jobs []string + tip string + code int + }{ + {"every job passed", green, head, publish}, + {"the macOS jobs were cancelled and their verdict is red", with( + "npm package on macos-latest\tcancelled\tmacos-latest", + "guards on macos-latest (part 1 of 2)\tcancelled\tmacos-latest", + "test on macos-latest\tfailure\tubuntu-latest", + "Python package with Python 3.10\tcancelled\tmacos-14"), head, publish}, + {"a Linux part failed", with("guards on ubuntu-latest (part 1 of 2)\tfailure\tubuntu-latest"), head, hold}, + {"a Windows job was cancelled", with("the installer installs and leaves\tcancelled\twindows-latest"), head, hold}, + {"a job outside macOS is still running", with("linters\tnone\tubuntu-latest"), head, hold}, + {"no verdict outside macOS", []string{ + "guards on ubuntu-latest (part 0 of 2)\tsuccess\tubuntu-latest", + "test on macos-latest\tsuccess\tubuntu-latest"}, head, hold}, + {"main has moved past the commit", green, "2222222", hold}, + {"no job at all", nil, head, 2}, + {"a line without a conclusion", []string{"linters"}, head, 2}, + } + for _, c := range cases { + code, out := siteGateRun(t, python, c.jobs, head, c.tip) + if code != c.code { + t.Errorf("%s: the gate exited %d and should exit %d:\n%s", c.name, code, c.code, out) + } + } +}