Skip to content

Commit 35fc80f

Browse files
committed
[GR-21590] Import update
PullRequest: graalpython/4306
2 parents 9491ac0 + 0edeb91 commit 35fc80f

8 files changed

Lines changed: 173 additions & 15 deletions

File tree

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: graalpython-rota
3+
description: Run GraalPy ROTA maintenance workflows for (1) import update pull requests and (2) triage of recent periodic job failures in Jira. Use when asked to perform or guide recurring ROTA tasks from `docs/contributor/ROTA.md`, including branch setup, `mx` update commands, PR creation with reviewers/gates via `ol-cli bitbucket`, and date-bounded periodic-failure issue triage via `ol-cli jira`.
4+
---
5+
6+
# GraalPy ROTA
7+
8+
## Overview
9+
Execute recurring GraalPy ROTA tasks with exact commands and strict output structure. Prefer the procedures in this skill, and use `docs/contributor/ROTA.md` as the detailed source text.
10+
11+
## Source Of Truth
12+
- Primary: `docs/contributor/ROTA.md`
13+
- If this skill workflow differs from the primary source, follow `docs/contributor/ROTA.md`.
14+
15+
## Choose Workflow
16+
- Use `Import update` when asked to refresh imports and open the standard PR.
17+
- Use `Recent periodic issues` when asked to triage periodic job failures in Jira.
18+
19+
## Import Update Workflow
20+
1. Create a branch from latest `master`:
21+
```bash
22+
git checkout master
23+
git pull --ff-only
24+
git checkout -b "update/GR-21590/$(date +%d%m%y)"
25+
```
26+
2. Update graal import:
27+
```bash
28+
mx python-update-import
29+
```
30+
3. Update CPython unittest whitelist and inspect diff for plausibility. Expect mostly additions, not removals:
31+
```bash
32+
mx --dy /graalpython-enterprise python-update-unittest-tags
33+
```
34+
4. Create PR with description `[GR-21590] Import update`.
35+
5. Use `ol-cli bitbucket` to create PR, start gates, and set reviewers:
36+
- `tim.felgentreff@oracle.com`
37+
- `michael.simacek@oracle.com`
38+
- `stepan.sindelar@oracle.com`
39+
6. Fix gate failures and push updates until gates pass.
40+
41+
## Recent Periodic Issues Workflow
42+
1. Verify creator identity mapping:
43+
- Treat `ol-automation_ww` as Jira username `olauto`.
44+
- If query returns zero results, test both identities, then keep `creator = olauto` once verified.
45+
46+
2. Filter to recent periodic job failures, excluding in progress or closed.
47+
- Default to the last 14 days unless user specifies otherwise.
48+
- Always state concrete start/end calendar dates in the response.
49+
```bash
50+
ol-cli jira search --json --max 100 \
51+
-f key,summary,creator,created,status,labels,components,assignee \
52+
-jql "project = GR AND component = Python AND creator = olauto AND labels = periodic-job-failures AND created >= -14d AND status != Closed AND status != 'In Progress' ORDER BY created DESC"
53+
```
54+
55+
3. Fetch shortlisted issue details with `get-issue`:
56+
```bash
57+
ol-cli jira get-issue --json -id GR-XXXX \
58+
| jq '{key, summary:.fields.summary, status:.fields.status.name, created:.fields.created, labels:.fields.labels, assignee:(.fields.assignee.name // null), description:.fields.description, comments:(.fields.comment.comments | map({author:.author.name, created, body}))}'
59+
```
60+
61+
7. Convert findings into an implementation-ready plan per issue:
62+
- Extract failing job name, error signature, and log clue.
63+
- Map probable source area in repo.
64+
- Propose first verification command.
65+
- Define exit criteria to close ticket.
66+
- Prepare temporary git worktree per issue with branch naming based on Jira key plus very short hyphenated description.
67+
68+
## Output Contract For Periodic Triage
69+
Return exactly:
70+
1. Query scope used (component, creator, time window, status filter).
71+
2. Count summary (total recent automation issues vs periodic failures).
72+
3. Issue list with key, created date, summary, status.
73+
4. Per-issue plan with:
74+
- Hypothesis
75+
- First code locations to inspect
76+
- First reproducibility command
77+
- Exit criteria for closing ticket
78+
5. Recommended implementation order.
79+
80+
## Guardrails
81+
- State concrete dates for recency windows.
82+
- Prefer `--json` and explicit `-f` fields in searches.
83+
- Use `get-issue` only for shortlisted issues to keep output small.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: pr-gate-check
3+
description: Check gate status for a Bitbucket PR by resolving the PR head commit, finding the gate merge commit, inspecting builds on that merge commit, and summarizing root-cause failures with actionable next steps.
4+
---
5+
6+
# PR Gate Check
7+
8+
## Overview
9+
Use this workflow when asked for gate status of a PR. Usually the builds are tied to a merge commit generated on Bitbucket, so this skill goes through finding the remote merge commit.
10+
11+
## Workflow
12+
1. Get PR commits and identify PR head commit (first commit in `ol-cli bitbucket commits` output):
13+
```bash
14+
ol-cli bitbucket commits --project=G --repo=graalpython --pullrequest=<PR_ID> --all --json
15+
```
16+
17+
2. Fetch refs and locate merge commit whose parent includes PR head:
18+
```bash
19+
git ls-remote origin 'refs/pull-requests/<PR_ID>/*'
20+
git fetch --no-tags origin '+refs/heads/*:refs/remotes/origin/*' --prune
21+
git rev-list --all --parents | rg ' <PR_HEAD_SHA>( |$)'
22+
```
23+
Pick the merge commit where one parent is `<PR_HEAD_SHA>` and the other is the target branch tip at merge time.
24+
25+
3. Check builds on that merge commit:
26+
```bash
27+
ol-cli bitbucket get-builds --commit=<MERGE_SHA> --all --format=key,state,url
28+
```
29+
30+
4. Separate root failures from fan-out failures:
31+
- `FAILED` + `/builders/.../builds/...` URL: executed failed build (root failure candidate).
32+
- `FAILED` + `build_request?brid=` URL: usually not-run/downstream due to earlier failure.
33+
34+
5. Inspect root failed build logs and extract exact failing test/error:
35+
- Open build URL and `Run executor` stdio log.
36+
- Capture failing test id, traceback/assertion, and command context.
37+
38+
6. Report back:
39+
- PR head SHA
40+
- merge SHA + parents (target parent + PR parent)
41+
- build summary counts
42+
- root cause failure(s)
43+
- fix options and next action question
44+
45+
## Output Template
46+
1. `PR head:` `<sha>`
47+
2. `Gate merge commit:` `<sha>` (`parent1=<target_sha>`, `parent2=<pr_sha>`)
48+
3. `Builds:` `<total>` total, `<success>` successful, `<failed>` failed
49+
4. `Root failure(s):`
50+
- `<build key>`: `<error summary>`
51+
- `<failing test/path>`
52+
- `<build url>`
53+
5. `Proposed fixes:` short list
54+
6. Ask user what to do next.
55+
56+
## Guardrails
57+
- Do not conclude from PR commit statuses alone; always resolve and inspect merge-commit builds.
58+
- If many builds are failed but only one executed failure exists, treat that one as primary cause.
59+
- Keep proposed fixes minimal and scoped to observed failure.

ci/graal/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
55
],
66

7-
"mx_version": "7.69.0",
7+
"mx_version": "7.71.0",
88

99
"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
1010
"jdks": {

graalpython/com.oracle.graal.python.test/src/tests/test_fcntl.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -65,6 +65,7 @@ def log(msg):
6565
def python_flock_blocks_sh_flock(python_flock_type, sh_flock_type):
6666
os.close(os.open(TEST_FILENAME_FULL_PATH, os.O_WRONLY | os.O_CREAT))
6767
file = os.open(TEST_FILENAME_FULL_PATH, os.O_WRONLY)
68+
p = None
6869
try:
6970
fcntl.flock(file, python_flock_type)
7071
p = subprocess.Popen("flock -%s %s -c 'exit 42'" % (sh_flock_type, TEST_FILENAME_FULL_PATH), shell=True)
@@ -74,10 +75,13 @@ def python_flock_blocks_sh_flock(python_flock_type, sh_flock_type):
7475
log("unlocking the file...")
7576
fcntl.flock(file, fcntl.LOCK_UN) # release the lock
7677
log("checking the retcode...")
77-
time.sleep(0.25)
78-
assert p.poll() == 42
79-
log(f"{p.returncode=}")
78+
retcode = p.wait(timeout=5)
79+
assert retcode == 42
80+
log(f"{retcode=}")
8081
finally:
82+
if p is not None and p.poll() is None:
83+
p.terminate()
84+
p.wait(timeout=2)
8185
fcntl.flock(file, fcntl.LOCK_UN)
8286
os.close(file)
8387

graalpython/lib-python/3/test/test_concurrent_futures/executor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ def test_map_timeout(self):
5959
# GraalPy change: submit some dummy work first, so the next map call doesn't time out in the worker start up
6060
list(self.executor.map(time.sleep, [0]))
6161
try:
62+
# GraalPy change: larger timeout for CI flakiness
63+
# for i in self.executor.map(time.sleep, [0, 0, 6], timeout=5):
6264
for i in self.executor.map(time.sleep,
63-
[0, 0, 6],
64-
timeout=5):
65+
[0, 0, 8],
66+
timeout=3):
6567
results.append(i)
6668
except futures.TimeoutError:
6769
pass

mx.graalpython/mx_graalpython.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,7 +2347,7 @@ def python_coverage(args):
23472347
'--strict-mode',
23482348
'--tags', args.tags,
23492349
] + jacoco_args, env=env)
2350-
run_mx([
2350+
jacoco_report_cmd = [
23512351
'--strict-compliance',
23522352
'--kill-with-sigquit',
23532353
'jacocoreport',
@@ -2356,7 +2356,14 @@ def python_coverage(args):
23562356
'coverage',
23572357
'--generic-paths',
23582358
'--exclude-src-gen',
2359-
], env=env)
2359+
]
2360+
# CI can occasionally leave transiently truncated execution data; retry once to reduce flakiness.
2361+
try:
2362+
run_mx(jacoco_report_cmd, env=env)
2363+
except Exception: # pylint: disable=broad-except
2364+
mx.warn("jacocoreport failed, retrying once after a short delay")
2365+
time.sleep(5)
2366+
run_mx(jacoco_report_cmd, env=env)
23602367

23612368
if args.mode == 'truffle':
23622369
executable = graalpy_standalone_jvm()

mx.graalpython/mx_graalpython_python_benchmarks.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
"bench_core.CountNonzero.time_count_nonzero_multi_axis(2, 1000000, <class 'str'>)", # Times out
7878
"bench_core.CountNonzero.time_count_nonzero_multi_axis(3, 1000000, <class 'str'>)", # Times out
7979
"bench_linalg.LinalgSmallArrays.time_det_small_array", # TODO fails with numpy.linalg.LinAlgError
80+
"bench_indexing.IndexingSeparate.time_mmap_fancy_indexing", # Hangs in periodic job GR-73912
81+
"bench_indexing.IndexingStructured0D.time_array_slice", # Hangs in periodic job GR-73912
8082
]
8183

8284
DEFAULT_PANDAS_BENCHMARKS = [
@@ -98,6 +100,8 @@
98100
"reshape.Explode.time_explode", # Transient failure GR-61245, exit code -11
99101
]
100102

103+
SETUPTOOLS_PIN = "77.0.1"
104+
101105
DEFAULT_PYPERFORMANCE_BENCHMARKS = [
102106
# "2to3",
103107
# "chameleon",
@@ -564,7 +568,7 @@ class NumPySuite(PySuite):
564568

565569
BENCHMARK_REQ = [
566570
"asv==0.5.1",
567-
"setuptools==70.3.0",
571+
f"setuptools=={SETUPTOOLS_PIN}",
568572
"distlib==0.3.6",
569573
"filelock==3.8.0",
570574
"platformdirs==2.5.2",
@@ -671,7 +675,7 @@ class PandasSuite(PySuite):
671675

672676
BENCHMARK_REQ = [
673677
"asv==0.5.1",
674-
"setuptools==70.3.0",
678+
f"setuptools=={SETUPTOOLS_PIN}",
675679
"distlib==0.3.6",
676680
"filelock==3.8.0",
677681
"platformdirs==2.5.2",
@@ -762,8 +766,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
762766
vm.run(workdir, ["-m", "venv", join(workdir, vm_venv)])
763767
pip = join(workdir, vm_venv, "bin", "pip")
764768
with tempfile.NamedTemporaryFile('w') as constraints:
765-
# Constrain the version of setuptools used to build pandas
766-
constraints.write('setuptools==70.3.0\n')
769+
constraints.write(f"setuptools=={SETUPTOOLS_PIN}\n")
767770
constraints.flush()
768771
env = os.environ.copy()
769772
env['PIP_CONSTRAINT'] = constraints.name

mx.graalpython/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@
5353
},
5454
{
5555
"name": "tools",
56-
"version": "bb17fd7e8ec441c087b63300c2d75e06828b8dde",
56+
"version": "fcbc5553eb65a0d6c88495efc24e998606dd5fa6",
5757
"subdir": True,
5858
"urls": [
5959
{"url": "https://github.com/oracle/graal", "kind": "git"},
6060
],
6161
},
6262
{
6363
"name": "regex",
64-
"version": "bb17fd7e8ec441c087b63300c2d75e06828b8dde",
64+
"version": "fcbc5553eb65a0d6c88495efc24e998606dd5fa6",
6565
"subdir": True,
6666
"urls": [
6767
{"url": "https://github.com/oracle/graal", "kind": "git"},

0 commit comments

Comments
 (0)