Skip to content

Commit 319a5eb

Browse files
Merge pull request #224 from BioVisionCenter/fix/ci-nodejs20
cleanup ci with legacy node
2 parents 82c89c9 + 4554d3b commit 319a5eb

8 files changed

Lines changed: 112 additions & 135 deletions

File tree

.github/TEST_FAIL_TEMPLATE.md

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Opens (or updates) the [test-bot] issue for a failing scheduled run.
2+
#
3+
# Replaces JasonEtco/create-an-issue, which is still `using: node20`. Composite, so
4+
# it pulls in no Node runtime at all; `gh` and `jq` are preinstalled on the ubuntu,
5+
# macos and windows runners, and `shell: bash` gives Git Bash on windows.
6+
name: Report failure
7+
description: Open a [test-bot] issue for a failing scheduled run, or update the open one.
8+
9+
inputs:
10+
title:
11+
description: Issue title. An open issue with this exact title is updated in place.
12+
required: true
13+
platform:
14+
description: Runner platform the failure was seen on.
15+
required: true
16+
python:
17+
description: Python environment label, e.g. `test11` or `py3.13, pip stable`.
18+
required: true
19+
token:
20+
description: Token carrying issues-write permission. Needed explicitly because checkout runs without persisted credentials.
21+
required: true
22+
23+
runs:
24+
using: composite
25+
steps:
26+
- shell: bash
27+
# Every caller-supplied value goes through `env:` rather than `${{ }}`
28+
# interpolation into the script body, so nothing can be injected into it.
29+
env:
30+
GH_TOKEN: ${{ inputs.token }}
31+
TITLE: ${{ inputs.title }}
32+
PLATFORM: ${{ inputs.platform }}
33+
PYTHON: ${{ inputs.python }}
34+
run: |
35+
set -euo pipefail
36+
37+
# printf rather than a heredoc: a heredoc body inside this block scalar
38+
# would carry its YAML indentation into the issue text.
39+
body=$(printf '%s\n' \
40+
"The ${GITHUB_WORKFLOW} workflow failed on $(date -u '+%Y-%m-%d %H:%M') UTC" \
41+
"" \
42+
"The most recent failing test was on ${PLATFORM} (${PYTHON})" \
43+
"with commit: ${GITHUB_SHA}" \
44+
"" \
45+
"Full run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" \
46+
"" \
47+
"(This post will be updated if another test fails, as long as this issue remains open.)")
48+
49+
# Match the title exactly rather than relying on `--search`, whose tokenizer
50+
# does not treat the leading "[test-bot]" as a literal.
51+
number=$(gh issue list --state open --label bug --limit 100 --json number,title \
52+
| jq -r --arg t "${TITLE}" 'map(select(.title == $t)) | .[0].number // empty')
53+
54+
if [ -n "${number}" ]; then
55+
echo "Updating existing issue #${number}"
56+
gh issue edit "${number}" --body "${body}"
57+
else
58+
echo "Opening a new issue"
59+
gh issue create --title "${TITLE}" --label bug --body "${body}"
60+
fi

.github/workflows/ci.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ jobs:
3535
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
3636
with:
3737
python-version: "3.13"
38-
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
38+
# prek is a drop-in reimplementation of pre-commit; its action caches the hook
39+
# environments itself, unlike pre-commit/action, which is maintenance-only and
40+
# hardcodes actions/cache@v4 (Node 20) internally.
41+
# `prek-version` defaults to `latest` — pin it, and keep it in step with the
42+
# `prek` version resolved in pixi.lock so CI and `pixi run -e dev lint` agree.
43+
- uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0
44+
with:
45+
prek-version: "0.4.12"
3946

4047
check-manifest:
4148
# check-manifest is a tool that checks that all files in version control are
@@ -191,16 +198,12 @@ jobs:
191198
# If something goes wrong with scheduled tests, open an issue in the repo
192199
- name: 📝 Report Failures
193200
if: failure() && github.event_name == 'schedule'
194-
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
195-
env:
196-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
197-
PLATFORM: ${{ matrix.platform }}
198-
PYTHON: ${{ matrix.environment }}
199-
RUN_ID: ${{ github.run_id }}
200-
TITLE: "[test-bot] Scheduled tests are failing"
201+
uses: ./.github/actions/report-failure
201202
with:
202-
filename: .github/TEST_FAIL_TEMPLATE.md
203-
update_existing: true
203+
title: "[test-bot] Scheduled tests are failing"
204+
platform: ${{ matrix.platform }}
205+
python: ${{ matrix.environment }}
206+
token: ${{ github.token }}
204207

205208
- name: Coverage
206209
if: success() && matrix.platform == 'ubuntu-latest' && matrix.environment == 'test11'

.github/workflows/ci_upstream.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,12 @@ jobs:
6565

6666
- name: 📝 Report Failures
6767
if: failure() && github.event_name == 'schedule'
68-
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71-
PLATFORM: ubuntu-latest
72-
PYTHON: "3.13 (pip stable)"
73-
RUN_ID: ${{ github.run_id }}
74-
TITLE: "[test-bot] pip stable tests are failing"
68+
uses: ./.github/actions/report-failure
7569
with:
76-
filename: .github/TEST_FAIL_TEMPLATE.md
77-
update_existing: true
70+
title: "[test-bot] pip stable tests are failing"
71+
platform: ubuntu-latest
72+
python: "py3.13, pip stable"
73+
token: ${{ github.token }}
7874

7975
test-pip-pre:
8076
name: pip (--pre)
@@ -118,13 +114,9 @@ jobs:
118114

119115
- name: 📝 Report Failures
120116
if: failure()
121-
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
122-
env:
123-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124-
PLATFORM: ubuntu-latest
125-
PYTHON: "3.13 (pip --pre)"
126-
RUN_ID: ${{ github.run_id }}
127-
TITLE: "[test-bot] pip --pre tests are failing"
117+
uses: ./.github/actions/report-failure
128118
with:
129-
filename: .github/TEST_FAIL_TEMPLATE.md
130-
update_existing: true
119+
title: "[test-bot] pip --pre tests are failing"
120+
platform: ubuntu-latest
121+
python: "py3.13, pip --pre"
122+
token: ${{ github.token }}

.pre-commit-config.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
# enable pre-commit.ci at https://pre-commit.ci/
2-
# it adds:
3-
# 1. auto fixing pull requests
4-
# 2. auto updating the pre-commit configuration
5-
ci:
6-
autoupdate_schedule: monthly
7-
autofix_commit_msg: "style(pre-commit.ci): auto fixes [...]"
8-
autoupdate_commit_msg: "ci(pre-commit.ci): autoupdate"
1+
# Hooks are run by `prek` (a drop-in reimplementation of pre-commit), both in the
2+
# `lint` CI job and via `pixi run -e dev lint`. Bump the `rev:` pins with
3+
# `prek auto-update`.
94

105
# Vendored third-party files, kept byte-identical to what upstream ships. The SIL OFL
116
# text in particular should not be rewritten by the whitespace hooks.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
- `atomic_add_image` / `atomic_remove_image` warn on Windows that their lock is best-effort: `filelock` can hand it to two writers at once, so concurrent ones can lose an update — `v1.0.0` lost it silently. A single writer is unaffected.
1313
- Lock files moved to a `<store>.ngio-locks/` directory beside the store, one per group path. Nothing is written inside the Zarr store any more, and groups differing only after a dot (`foo.bar`, `foo.baz`) no longer share a lock. A `≤1.0.0` writer takes the old paths, so upgrade all writers to a plate together.
1414

15+
### Chores
16+
17+
- Linting moves from `pre-commit` to [`prek`](https://github.com/j178/prek), a drop-in reimplementation. `.pre-commit-config.yaml` is unchanged apart from dropping a `ci:` block for pre-commit.ci, which was never enabled. `pixi run -e dev lint` is still the entry point; `pre-commit autoupdate` becomes `prek auto-update`.
18+
- CI no longer depends on any Node 20 action, which GitHub now warns about on every run. `pre-commit/action` is maintenance-only and pins `actions/cache@v4` internally, so it is replaced by `j178/prek-action`; `JasonEtco/create-an-issue` is `using: node20`, so the scheduled-failure issue reporter moves to a local composite action at `.github/actions/report-failure` (and `.github/TEST_FAIL_TEMPLATE.md` goes with it).
19+
1520
## [v1.0.0]
1621

1722
First stable release. Everything deprecated in `v0.5.0` (each warned "will be removed in `ngio=0.6`") is now removed — that release became `1.0.0`.

0 commit comments

Comments
 (0)