From 3bd0e1f75fc1750a7b5eb9c8506660717626207e Mon Sep 17 00:00:00 2001 From: Samuel Wright Date: Tue, 26 Aug 2025 11:36:54 +0200 Subject: [PATCH 1/4] Cron action to open PR for FLS --- .github/workflows/update-fls.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/update-fls.yaml diff --git a/.github/workflows/update-fls.yaml b/.github/workflows/update-fls.yaml new file mode 100644 index 0000000..ba00913 --- /dev/null +++ b/.github/workflows/update-fls.yaml @@ -0,0 +1,25 @@ +name: Update FLS +on: + schedule: + - cron: "05 0 * * *" + workflow_dispatch: +jobs: + update-fls: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v6 + - name: Update FLS + run: "./make.py --update-spec-lock-file" + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + commit-message: Update FLS (automated PR) + title: Update FLS (automated PR) + body: Update FLS (automated PR) + base: main + labels: automated-pr + branch: update-fls + delete-branch: true From 791d4c39f1de0b0db18696c879ba0ccef3a950d1 Mon Sep 17 00:00:00 2001 From: Samuel Wright Date: Tue, 26 Aug 2025 11:37:14 +0200 Subject: [PATCH 2/4] Ignore unwanted files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b2b6d48..0f2edda 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ __pycache__/ build/ +builder/builder.egg-info From b74e06d011895297932ce37d3a8000cabea1435b Mon Sep 17 00:00:00 2001 From: Samuel Wright Date: Fri, 17 Oct 2025 12:55:18 +0300 Subject: [PATCH 3/4] Log output to preductable file --- builder/build_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/build_cli.py b/builder/build_cli.py index a3201e0..d935c02 100644 --- a/builder/build_cli.py +++ b/builder/build_cli.py @@ -49,7 +49,7 @@ def build_docs( dest = root / "build" - args = ["-b", builder, "-d", dest / "doctrees"] + args = ["-b", builder, "-d", dest / "doctrees", "-wtest.txt"] if debug: # Disable parallel builds and show exceptions in debug mode. From 1b211fab61004867a59cf42b11c929dbf06e2945 Mon Sep 17 00:00:00 2001 From: Samuel Wright Date: Fri, 17 Oct 2025 12:55:51 +0300 Subject: [PATCH 4/4] Check whether automatic update is possible --- .github/workflows/update-fls.yaml | 3 ++- test_update_fls.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 test_update_fls.sh diff --git a/.github/workflows/update-fls.yaml b/.github/workflows/update-fls.yaml index ba00913..55aa3f9 100644 --- a/.github/workflows/update-fls.yaml +++ b/.github/workflows/update-fls.yaml @@ -12,7 +12,8 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 - name: Update FLS - run: "./make.py --update-spec-lock-file" + run: | + ./test_update_fls.sh - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: diff --git a/test_update_fls.sh b/test_update_fls.sh new file mode 100755 index 0000000..06c9cff --- /dev/null +++ b/test_update_fls.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +./make.py +if [ $? -eq "0" ];then + echo "FLS is up to date" + exit 0 # No error, no update required +else + grep -q "ERROR: The FLS specification has changed since the lock file was created:" test.txt + OUTOFDATE=$? + grep -q "Found differences between live FLS data and lock file affecting 0 guidelines" test.txt + ZEROAFFECTED=$? + + if [ $OUTOFDATE -eq "0" ]; then + if [ $ZEROAFFECTED -eq "0" ]; then + ./make.py --update-spec-lock-file + rm test.txt + exit 1 # Can be updated automatically + else + ./make.py --update-spec-lock-file + rm test.txt + exit 2 # Guidelines need human review + fi + fi +fi + +rm test.txt +exit 3 # Other build error not related to FLS