Skip to content

Commit 308297c

Browse files
committed
Merge branch 'master' into tb_fin28
2 parents b983c29 + efe888f commit 308297c

4,744 files changed

Lines changed: 68324 additions & 28082 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/get-mathlib-ci/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ inputs:
1010
# Default pinned commit used by workflows unless they explicitly override.
1111
# Update this ref as needed to pick up changes to mathlib-ci scripts
1212
# This is also updated automatically by .github/workflows/update_dependencies.yml
13-
default: d7b053bde8ef240c29f6724fa285dc5bb6bbe00a
13+
default: e7a159e9a129f92fd07e6852a742485798678473
1414
path:
1515
description: Checkout destination path.
1616
required: false

.github/workflows/PR_summary.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
ref: ${{ github.event.pull_request.head.sha }}
2323
fetch-depth: 0
2424
path: pr-branch
25+
# Untrusted (potentially fork) checkout: don't persist the GITHUB_TOKEN into its .git/config.
26+
persist-credentials: false
2527

2628
- name: Checkout local actions
2729
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/add_label_from_diff.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
ref: master
2828
path: tools
2929
- name: Configure Lean
30-
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
30+
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0
3131
with:
3232
auto-config: false
3333
use-github-cache: false
@@ -43,6 +43,8 @@ jobs:
4343
ref: ${{ github.event.pull_request.head.sha || github.sha }}
4444
fetch-depth: 0
4545
path: pr-branch
46+
# Untrusted (potentially fork) checkout: don't persist the GITHUB_TOKEN into its .git/config.
47+
persist-credentials: false
4648
- name: Run autolabel
4749
working-directory: pr-branch
4850
run: |

.github/workflows/bot_fix_style.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ on:
1212
# triggers on a review comment
1313
types: [created, edited]
1414

15+
# `lint-style-action` in `fix` mode pushes a style-fix commit and reacts/comments
16+
# on the PR. Grant exactly those scopes rather than inheriting the default token
17+
# permissions; all other scopes are implicitly 'none'.
18+
permissions:
19+
contents: write # push the style-fix commit to the PR branch
20+
pull-requests: write # add the bot's reaction/comment
21+
issues: write # PR comment reactions go through the issues API
22+
1523
jobs:
1624
fix_style:
1725
# we set some variables. The ones of the form `${{ X }}${{ Y }}` are typically not

.github/workflows/build_template.yml

Lines changed: 48 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ jobs:
127127
ref: ${{ inputs.pr_branch_ref }}
128128
fetch-depth: 2 # we may fetch cache from the commit before this one (or earlier)
129129
path: pr-branch
130+
# This is an untrusted (potentially fork) checkout whose code we build.
131+
# Don't leave the GITHUB_TOKEN in pr-branch/.git/config, where that code could read it.
132+
persist-credentials: false
130133

131134
- name: Prepare DownstreamTest directory
132135
shell: bash
@@ -222,7 +225,7 @@ jobs:
222225
223226
- name: validate lake-manifest.json inputRevs
224227
# Only enforce this on the main mathlib4 repository, not on nightly-testing
225-
if: github.repository == 'leanprover-community/mathlib4'
228+
if: github.repository == 'leanprover-community/mathlib4' && github.ref_name != 'nightly-testing'
226229
shell: bash
227230
run: |
228231
cd pr-branch
@@ -451,7 +454,7 @@ jobs:
451454
452455
- name: upload cache staging artifact
453456
if: ${{ always() && steps.cache_staging_check.outputs.has_files == 'true' }}
454-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
457+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
455458
with:
456459
name: cache-staging
457460
path: cache-staging/
@@ -513,19 +516,19 @@ jobs:
513516
run: |
514517
cd pr-branch
515518
set -o pipefail
516-
# Try running with --trace; if it fails due to argument parsing, the PR needs to merge master
519+
# If lint fails because the PR predates lake-lint configuration or the
520+
# old --trace argument-parsing behavior, ask the author to merge master.
517521
# We use .lake/ for the output file because landrun restricts /tmp access
518522
for attempt in 1 2; do
519-
if timeout 10m env LEAN_ABORT_ON_PANIC=1 stdbuf -oL lake exe runLinter --trace Mathlib 2>&1 | tee ".lake/lint_output_attempt_${attempt}.txt"; then
523+
if timeout 10m env LEAN_ABORT_ON_PANIC=1 stdbuf -oL lake lint -- --trace 2>&1 | tee ".lake/lint_output_attempt_${attempt}.txt"; then
520524
break
521525
fi
522526
status=${PIPESTATUS[0]}
523-
if grep -q "cannot parse arguments" ".lake/lint_output_attempt_${attempt}.txt"; then
527+
if grep -qE "cannot parse arguments|no lint driver configured" ".lake/lint_output_attempt_${attempt}.txt"; then
524528
echo ""
525529
echo "=============================================================================="
526-
echo "ERROR: Your branch uses an older version of runLinter that doesn't support"
527-
echo "the --trace flag. Please merge 'master' into your PR branch to get the"
528-
echo "updated linter, then push again."
530+
echo "ERROR: Your branch predates the current 'lake lint' configuration."
531+
echo "Please merge 'master' into your PR branch and push again."
529532
echo ""
530533
echo "You can do this with:"
531534
echo " git fetch upstream"
@@ -574,12 +577,14 @@ jobs:
574577
- name: Generate lean-pr-testing app token
575578
if: ${{ always() && github.repository == 'leanprover-community/mathlib4-nightly-testing' && (startsWith(github.ref_name, 'lean-pr-testing-') || startsWith(github.ref_name, 'batteries-pr-testing-')) }}
576579
id: lean-pr-testing-token
577-
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
580+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
578581
with:
579-
app-id: ${{ secrets.MATHLIB_LEAN_PR_TESTING_APP_ID }}
580-
private-key: ${{ secrets.MATHLIB_LEAN_PR_TESTING_PRIVATE_KEY }}
581-
owner: leanprover
582-
repositories: lean4
582+
# `batteries-pr-testing-*` branches need a token scoped to `leanprover-community/batteries`
583+
# for the labelling API; `lean-pr-testing-*` branches need one scoped to `leanprover/lean4`.
584+
app-id: ${{ startsWith(github.ref_name, 'batteries-pr-testing-') && secrets.MATHLIB_NIGHTLY_TESTING_APP_ID || secrets.MATHLIB_LEAN_PR_TESTING_APP_ID }}
585+
private-key: ${{ startsWith(github.ref_name, 'batteries-pr-testing-') && secrets.MATHLIB_NIGHTLY_TESTING_PRIVATE_KEY || secrets.MATHLIB_LEAN_PR_TESTING_PRIVATE_KEY }}
586+
owner: ${{ startsWith(github.ref_name, 'batteries-pr-testing-') && 'leanprover-community' || 'leanprover' }}
587+
repositories: ${{ startsWith(github.ref_name, 'batteries-pr-testing-') && 'batteries' || 'lean4' }}
583588
# The create-github-app-token README states that this token is masked and will not be logged accidentally.
584589
- name: Post comments for lean-pr-testing-NNNN and batteries-pr-testing-NNNN branches
585590
if: ${{ always() && github.repository == 'leanprover-community/mathlib4-nightly-testing' && (startsWith(github.ref_name, 'lean-pr-testing-') || startsWith(github.ref_name, 'batteries-pr-testing-')) }}
@@ -618,7 +623,7 @@ jobs:
618623
fetch-depth: 1
619624

620625
- name: Configure Lean
621-
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
626+
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0
622627
with:
623628
auto-config: false # Don't run `lake build`, `lake test`, or `lake lint` automatically.
624629
use-github-cache: false
@@ -687,9 +692,11 @@ jobs:
687692
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
688693
with:
689694
ref: ${{ inputs.pr_branch_ref }}
695+
# Untrusted (potentially fork) checkout: don't persist the GITHUB_TOKEN into its .git/config.
696+
persist-credentials: false
690697

691698
- name: Configure Lean
692-
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
699+
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0
693700
with:
694701
auto-config: false # Don't run `lake build`, `lake test`, or `lake lint` automatically.
695702
use-github-cache: false
@@ -731,17 +738,36 @@ jobs:
731738
run: |
732739
lake exe graph
733740
741+
- name: Checkout local actions
742+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
743+
with:
744+
ref: ${{ github.workflow_sha }}
745+
fetch-depth: 1
746+
sparse-checkout: .github/actions
747+
path: workflow-actions
748+
749+
- name: Get mathlib-ci
750+
uses: ./workflow-actions/.github/actions/get-mathlib-ci
751+
752+
- name: dump declarations and transitive-import counts
753+
run: |
754+
lake env lean --run "${CI_SCRIPTS_DIR}/pr_summary/dumpReasonableDecls.lean" \
755+
--out decls.txt --imports-out imports.json Mathlib
756+
734757
- name: upload the import graph
735-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
758+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
736759
with:
737760
name: import-graph
738-
path: import_graph.dot
739-
## the default is 90, but we build often, so unless there's a reason
740-
## to care about old copies in the future, just say 7 days for now
741-
retention-days: 7
761+
path: |
762+
import_graph.dot
763+
decls.txt
764+
imports.json
765+
## Master pushes: 90 days, so later PRs forked from these commits
766+
## can consume the dumps from the artifact. Other branches: 7 days.
767+
retention-days: ${{ github.ref == 'refs/heads/master' && '90' || '7' }}
742768

743769
- name: clean up the import graph file
744-
run: rm import_graph.dot
770+
run: rm -f import_graph.dot decls.txt imports.json
745771

746772
- name: check all scripts build successfully
747773
run: |
@@ -874,7 +900,7 @@ jobs:
874900
steps.get-label-actor.outputs.username != 'mathlib-update-dependencies' &&
875901
steps.get-label-actor.outputs.username != 'mathlib-splicebot'
876902
name: check team membership
877-
uses: tspascoal/get-user-teams-membership@57e9f42acd78f4d0f496b3be4368fc5f62696662 # v3.0.0
903+
uses: tspascoal/get-user-teams-membership@818140d631d5f29f26b151afbe4179f87d9ceb5e # v4.0.1
878904
id: actorTeams
879905
with:
880906
organization: leanprover-community # optional. Default value ${{ github.repository_owner }}

.github/workflows/check_pr_titles.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
ref: master
2525
- name: Configure Lean
26-
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
26+
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0
2727
with:
2828
auto-config: false
2929
use-github-cache: false
@@ -70,7 +70,7 @@ jobs:
7070
fi
7171
7272
- name: Add comment to fix PR title
73-
uses: marocchino/sticky-pull-request-comment@70d2764d1a7d5d9560b100cbea0077fc8f633987 # v3.0.2
73+
uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4
7474
if: failure() && steps.pr-title-check.outputs.errors
7575
with:
7676
header: 'PR Title Check'
@@ -120,7 +120,7 @@ jobs:
120120
121121
- name: Add comment that PR title is fixed
122122
if: steps.pr-title-check.outcome == 'success'
123-
uses: marocchino/sticky-pull-request-comment@70d2764d1a7d5d9560b100cbea0077fc8f633987 # v3.0.2
123+
uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4
124124
with:
125125
header: 'PR Title Check'
126126
# should do nothing if a 'PR Title Check' comment does not exist

.github/workflows/daily.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
ref: ${{ env.BRANCH_REF }}
5959

6060
- name: Configure Lean
61-
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
61+
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0
6262
with:
6363
auto-config: false
6464
use-github-cache: false
@@ -127,7 +127,7 @@ jobs:
127127
api-key: ${{ secrets.ZULIP_API_KEY }}
128128
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
129129
organization-url: 'https://leanprover.zulipchat.com'
130-
to: 'nightly-testing'
130+
to: 'nightly-testing-mathlib'
131131
type: 'stream'
132132
topic: 'leanchecker'
133133
content: |
@@ -140,7 +140,7 @@ jobs:
140140
api-key: ${{ secrets.ZULIP_API_KEY }}
141141
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
142142
organization-url: 'https://leanprover.zulipchat.com'
143-
to: 'nightly-testing'
143+
to: 'nightly-testing-mathlib'
144144
type: 'stream'
145145
topic: 'leanchecker failure'
146146
content: |
@@ -183,7 +183,7 @@ jobs:
183183
ref: ${{ env.BRANCH_REF }}
184184

185185
- name: Configure Lean
186-
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
186+
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0
187187
with:
188188
auto-config: false
189189
use-github-cache: false
@@ -250,7 +250,7 @@ jobs:
250250
api-key: ${{ secrets.ZULIP_API_KEY }}
251251
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
252252
organization-url: 'https://leanprover.zulipchat.com'
253-
to: 'nightly-testing'
253+
to: 'nightly-testing-mathlib'
254254
type: 'stream'
255255
topic: 'mathlib test executable'
256256
content: |
@@ -263,7 +263,7 @@ jobs:
263263
api-key: ${{ secrets.ZULIP_API_KEY }}
264264
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
265265
organization-url: 'https://leanprover.zulipchat.com'
266-
to: 'nightly-testing'
266+
to: 'nightly-testing-mathlib'
267267
type: 'stream'
268268
topic: 'mathlib test executable failure'
269269
content: |
@@ -306,7 +306,7 @@ jobs:
306306
ref: ${{ env.BRANCH_REF }}
307307

308308
- name: Configure Lean
309-
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
309+
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0
310310
with:
311311
auto-config: false
312312
use-github-cache: false
@@ -415,7 +415,7 @@ jobs:
415415
api-key: ${{ secrets.ZULIP_API_KEY }}
416416
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
417417
organization-url: 'https://leanprover.zulipchat.com'
418-
to: 'nightly-testing'
418+
to: 'nightly-testing-mathlib'
419419
type: 'stream'
420420
topic: 'nanoda'
421421
content: |
@@ -428,7 +428,7 @@ jobs:
428428
api-key: ${{ secrets.ZULIP_API_KEY }}
429429
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
430430
organization-url: 'https://leanprover.zulipchat.com'
431-
to: 'nightly-testing'
431+
to: 'nightly-testing-mathlib'
432432
type: 'stream'
433433
topic: 'nanoda failure'
434434
content: |

0 commit comments

Comments
 (0)