Skip to content

Commit d4ab577

Browse files
committed
merge
2 parents ad02163 + 1cf0c13 commit d4ab577

File tree

2,752 files changed

+74093
-59118
lines changed

Some content is hidden

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

2,752 files changed

+74093
-59118
lines changed

.ci/merge-fixes.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/sh
2+
# Merge open PRs from sagemath/sage labeled "blocker".
3+
REPO="sagemath/sage"
4+
GH="gh -R $REPO"
5+
PRs="$($GH pr list --label "p: blocker / 1" --json number --jq '.[].number')"
6+
if [ -z "$PRs" ]; then
7+
echo 'Nothing to do: Found no open PRs with "blocker" status.'
8+
else
9+
echo "Found PRs: " $PRs
10+
export GIT_AUTHOR_NAME="ci-sage workflow"
11+
export GIT_AUTHOR_EMAIL="[email protected]"
12+
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
13+
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
14+
git tag -f test_base
15+
git commit -q -m "Uncommitted changes" --no-allow-empty -a
16+
for a in $PRs; do
17+
echo "::group::Merging PR https://github.com/$REPO/pull/$a"
18+
git tag -f test_head
19+
$GH pr checkout -b pr-$a $a
20+
git fetch --unshallow --all
21+
git checkout -q test_head
22+
if git merge --no-edit --squash -q pr-$a; then
23+
echo "::endgroup::"
24+
if git commit -q -m "Merge https://github.com/$REPO/pull/$a" -a --no-allow-empty; then
25+
echo "Merged #$a"
26+
else
27+
echo "Empty, skipped"
28+
fi
29+
else
30+
echo "::endgroup::"
31+
echo "Failure merging #$a, resetting"
32+
git reset --hard
33+
fi
34+
done
35+
git log test_base..HEAD
36+
fi

.github/sync_labels.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ReviewDecision(Enum):
5656
"""
5757
changes_requested = 'CHANGES_REQUESTED'
5858
approved = 'APPROVED'
59-
unclear = 'COMMENTED'
59+
unclear = 'UNCLEAR'
6060

6161
class Priority(Enum):
6262
r"""
@@ -319,12 +319,15 @@ def get_review_decision(self):
319319
return None
320320

321321
if self._review_decision is not None:
322+
if self._review_decision == ReviewDecision.unclear:
323+
return None
322324
return self._review_decision
323325

324326
data = self.view('reviewDecision')
325327
if data:
326328
self._review_decision = ReviewDecision(data)
327329
else:
330+
# To separate a not supplied value from not cached (see https://github.com/sagemath/sage/pull/36177#issuecomment-1704022893 ff)
328331
self._review_decision = ReviewDecision.unclear
329332
info('Review decision for %s: %s' % (self._issue, self._review_decision.value))
330333
return self._review_decision
@@ -349,9 +352,9 @@ def get_reviews(self, complete=False):
349352
self.get_commits()
350353

351354
date = self._commit_date
352-
no_rev = ReviewDecision.unclear.value
355+
unproper_rev = RevState.commented.value
353356
new_revs = [rev for rev in self._reviews if rev['submittedAt'] > date]
354-
proper_new_revs = [rev for rev in new_revs if rev['state'] != no_rev]
357+
proper_new_revs = [rev for rev in new_revs if rev['state'] != unproper_rev]
355358
info('Proper reviews after %s for %s: %s' % (date, self._issue, proper_new_revs))
356359
return proper_new_revs
357360

@@ -463,11 +466,6 @@ def approve_allowed(self):
463466
r"""
464467
Return if the actor has permission to approve this PR.
465468
"""
466-
revs = self.get_reviews(complete=True)
467-
if not any(rev['authorAssociation'] in ('MEMBER', 'OWNER') for rev in revs):
468-
info('PR %s can\'t be approved because of missing member review' % (self._issue))
469-
return False
470-
471469
revs = self.get_reviews()
472470
revs = [rev for rev in revs if rev['author']['login'] != self._actor]
473471
ch_req = ReviewDecision.changes_requested

.github/workflows/build.yml

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,34 @@ concurrency:
2424
cancel-in-progress: true
2525

2626
jobs:
27+
get_ci_fixes:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
id: checkout
32+
uses: actions/checkout@v4
33+
- name: Merge CI fixes from sagemath/sage
34+
run: |
35+
.ci/merge-fixes.sh
36+
env:
37+
GH_TOKEN: ${{ github.token }}
38+
- name: Store CI fixes in upstream artifact
39+
run: |
40+
mkdir -p upstream
41+
git format-patch --stdout test_base > upstream/ci_fixes.patch
42+
- uses: actions/upload-artifact@v3
43+
with:
44+
path: upstream
45+
name: upstream
46+
2747
build:
2848
runs-on: ubuntu-latest
2949
container: ghcr.io/sagemath/sage/sage-${{ github.event.inputs.platform || 'ubuntu-focal-standard' }}-with-targets:${{ github.event.inputs.docker_tag || 'dev'}}
50+
needs: [get_ci_fixes]
3051
steps:
3152
- name: Checkout
3253
id: checkout
33-
uses: actions/checkout@v3
54+
uses: actions/checkout@v4
3455

3556
- name: Update system packages
3657
id: prepare
@@ -68,6 +89,19 @@ jobs:
6889
if [ ! -f worktree-image/.gitignore ]; then cp .gitignore worktree-image/; fi
6990
(cd worktree-image && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset --quiet old && git add -N . && git status)
7091
92+
- name: Download upstream artifact
93+
uses: actions/download-artifact@v3
94+
with:
95+
path: upstream
96+
name: upstream
97+
98+
- name: Apply CI fixes from sagemath/sage
99+
# After applying the fixes, make sure all changes are marked as uncommitted changes.
100+
run: |
101+
if [ -r upstream/ci_fixes.patch ]; then
102+
(cd worktree-image && git commit -q -m "current changes" --allow-empty -a && git am; git reset --quiet old; git add -N .) < upstream/ci_fixes.patch
103+
fi
104+
71105
- name: Incremental build, test changed files (sage -t --new)
72106
id: incremental
73107
run: |
@@ -76,15 +110,15 @@ jobs:
76110
./bootstrap && make build && ./sage -t --new -p2
77111
working-directory: ./worktree-image
78112
env:
79-
MAKE: make -j2
113+
MAKE: make -j2 --output-sync=recurse
80114
SAGE_NUM_THREADS: 2
81115

82116
- name: Build and test modularized distributions
83117
if: always() && steps.worktree.outcome == 'success'
84118
run: make V=0 tox && make pypi-wheels
85119
working-directory: ./worktree-image
86120
env:
87-
MAKE: make -j2
121+
MAKE: make -j2 --output-sync=recurse
88122
SAGE_NUM_THREADS: 2
89123

90124
- name: Set up node to install pyright
@@ -103,17 +137,29 @@ jobs:
103137
run: pyright
104138
working-directory: ./worktree-image
105139

106-
- name: Build (fallback to non-incremental)
107-
id: build
140+
- name: Clean (fallback to non-incremental)
141+
id: clean
108142
if: always() && steps.worktree.outcome == 'success' && steps.incremental.outcome != 'success'
109143
run: |
110144
set -ex
111-
./bootstrap && make doc-clean doc-uninstall sagelib-clean && git clean -fx src/sage && ./config.status && make build
145+
./bootstrap && make doc-clean doc-uninstall sagelib-clean && git clean -fx src/sage && ./config.status
112146
working-directory: ./worktree-image
113147
env:
114148
MAKE: make -j2
115149
SAGE_NUM_THREADS: 2
116150

151+
- name: Build
152+
# This step is needed because building the modularized distributions installs some optional packages,
153+
# so the editable install of sagelib needs to build the corresponding optional extension modules.
154+
id: build
155+
if: always() && (steps.incremental.outcome == 'success' || steps.clean.outcome == 'success')
156+
run: |
157+
make build
158+
working-directory: ./worktree-image
159+
env:
160+
MAKE: make -j2 --output-sync=recurse
161+
SAGE_NUM_THREADS: 2
162+
117163
- name: Pytest
118164
if: contains(github.ref, 'pytest')
119165
run: |
@@ -125,22 +171,22 @@ jobs:
125171
COLUMNS: 120
126172

127173
- name: Test all files (sage -t --all --long)
128-
if: always() && (steps.incremental.outcome == 'success' || steps.build.outcome == 'success')
174+
if: always() && steps.build.outcome == 'success'
129175
run: |
130176
../sage -python -m pip install coverage
131177
../sage -python -m coverage run ./bin/sage-runtests --all --long -p2 --random-seed=286735480429121101562228604801325644303
132178
working-directory: ./worktree-image/src
133179

134180
- name: Prepare coverage results
135-
if: always() && (steps.incremental.outcome == 'success' || steps.build.outcome == 'success')
181+
if: always() && steps.build.outcome == 'success'
136182
run: |
137183
./venv/bin/python3 -m coverage combine src/.coverage/
138184
./venv/bin/python3 -m coverage xml
139185
find . -name *coverage*
140186
working-directory: ./worktree-image
141187

142188
- name: Upload coverage to codecov
143-
if: always() && (steps.incremental.outcome == 'success' || steps.build.outcome == 'success')
189+
if: always() && steps.build.outcome == 'success'
144190
uses: codecov/codecov-action@v3
145191
with:
146192
files: ./worktree-image/coverage.xml

.github/workflows/ci-conda.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
- 'public/build/**-runci'
99
pull_request:
1010
types:
11+
# Defaults
12+
- opened
13+
- synchronize
14+
- reopened
15+
# When a CI label is added
1116
- labeled
1217
workflow_dispatch:
1318
# Allow to run manually
@@ -21,13 +26,18 @@ jobs:
2126
test:
2227
name: Conda
2328
runs-on: ${{ matrix.os }}
24-
25-
# Run on push, workflow dispatch and when certain labels are added
29+
30+
# Run on push, workflow dispatch and when certain labels are added or are present
2631
if: |
27-
github.event.action != 'labeled' ||
28-
github.event.label.name == 'c: packages: optional' ||
29-
github.event.label.name == 'c: packages: standard' ||
30-
github.event.label.name == 's: run conda ci'
32+
github.event_name != 'pull_request' ||
33+
((github.event.action != 'labeled' &&
34+
(contains(github.event.pull_request.labels.*.name, 'c: packages: standard') ||
35+
contains(github.event.pull_request.labels.*.name, 'c: packages: optional') ||
36+
contains(github.event.pull_request.labels.*.name, 's: run conda ci'))) ||
37+
(github.event.action == 'labeled' &&
38+
(github.event.label.name == 'c: packages: optional' ||
39+
github.event.label.name == 'c: packages: standard' ||
40+
github.event.label.name == 's: run conda ci')))
3141
3242
strategy:
3343
fail-fast: false
@@ -39,7 +49,13 @@ jobs:
3949
conda-env: [environment]
4050

4151
steps:
42-
- uses: actions/checkout@v3
52+
- uses: actions/checkout@v4
53+
54+
- name: Merge CI fixes from sagemath/sage
55+
run: |
56+
.ci/merge-fixes.sh
57+
env:
58+
GH_TOKEN: ${{ github.token }}
4359

4460
- name: Check for Miniconda
4561
id: check_conda
@@ -89,9 +105,6 @@ jobs:
89105
echo "::remove-matcher owner=configure-system-package-warning::"
90106
echo "::remove-matcher owner=configure-system-package-error::"
91107
92-
# Manually install ptyprocess for now, until https://github.com/sagemath/sage/issues/32147 is fixed
93-
pip install --no-build-isolation -v -v ptyprocess==0.5.1
94-
95108
- name: Build
96109
shell: bash -l {0}
97110
run: |

0 commit comments

Comments
 (0)