-
Notifications
You must be signed in to change notification settings - Fork 28
Github action to update FLS every 24 hours #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
plaindocs
wants to merge
8
commits into
rustfoundation:main
Choose a base branch
from
plaindocs:update-fls-cron
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+57
−1
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3bd0e1f
Cron action to open PR for FLS
plaindocs 791d4c3
Ignore unwanted files
plaindocs 1321f55
Merge branch 'main' into update-fls-cron
PLeVasseur b74e06d
Log output to preductable file
plaindocs 1b211fa
Check whether automatic update is possible
plaindocs bcef3ac
Add run condition
plaindocs 42b999e
Merge branch 'rustfoundation:main' into update-fls-cron
plaindocs ad73d97
Set the variable
plaindocs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the consequence if it happened on every build? @plaindocs
There was a problem hiding this comment.
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:
builder/build_cli.pyto expose the required parameterbuilder/build_cli.pywhere appropriateDid I get that right @plaindocs, @felix91gr?