Skip to content
Open
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
28 changes: 28 additions & 0 deletions .github/workflows/update-fls.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Update FLS
on:
schedule:
- cron: "05 0 * * *"
workflow_dispatch:
env:
CAN_AUTOMATICALLY_UPDATE: false
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: Automatically update FLS if possible to do so
run: ./scripts/test_update_fls.sh
- name: Create Pull Request
if: env.CAN_AUTOMATICALLY_UPDATE == true
uses: peter-evans/create-pull-request@v7
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
2 changes: 1 addition & 1 deletion builder/build_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def build_docs(

dest = root / "build"

args = ["-b", builder, "-d", dest / "doctrees"]
args = ["-b", builder, "-d", dest / "doctrees", "-wtest.txt"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs moving out into a flagged parameter so it doesn't happen with every build.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what circumstances does it need to be included?

Copy link
Collaborator Author

@plaindocs plaindocs Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using that text file to parse out whether we can open the PR to update the build or not, so it's only really needed for this job.

But there isn't a trivially built in way to pass something into that custom build script. I could probably do something with the job name 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs moving out into a flagged parameter so it doesn't happen with every build.

What would be the consequence if it happened on every build? @plaindocs

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To summarize what we discussed earlier:

  • @plaindocs will update builder/build_cli.py to expose the required parameter
  • Use the exposed parameter and run builder/build_cli.py where appropriate

Did I get that right @plaindocs, @felix91gr?


if debug:
# Disable parallel builds and show exceptions in debug mode.
Expand Down
28 changes: 28 additions & 0 deletions scripts/test_update_fls.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/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
echo 'true' >> "$CAN_AUTOMATICALLY_UPDATE"
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