Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/osv-scanner-digest
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sha256:d54770fe0b09493894e76a02aaed9f51a0513fa57c5186452a755d257b0068a6
sha256:3fa25659351c9a5527b30d73b6f3c2ee0bcac106d6220948211d87379d08f243
106 changes: 106 additions & 0 deletions .github/scripts/site_gate.py
Original file line number Diff line number Diff line change
@@ -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()
6 changes: 3 additions & 3 deletions .github/workflows/osv-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |-
Expand All @@ -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: |-
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/osv-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |-
Expand All @@ -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
Expand Down
81 changes: 69 additions & 12 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -32,18 +36,71 @@ 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
# out, so the sums a visitor reads are the sums of the bytes they download.
# 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:
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down
14 changes: 10 additions & 4 deletions THIRD-PARTY-NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Source: <https://github.com/goccy/go-yaml>

## 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.

```
Expand Down Expand Up @@ -121,7 +121,7 @@ Source: <https://go.googlesource.com/text>

## 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.

Expand Down Expand Up @@ -163,7 +163,7 @@ Source: <https://github.com/gen2brain/gav1d>

## 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.

```
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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. |

Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
2 changes: 2 additions & 0 deletions internal/guard/mutationcoverage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Loading
Loading