fix(ci): repair broken PR lint jobs (mypy/node not found) #6

Merged
rs merged 1 commit from fix/ci-workflows into main 2026-09-02 21:22:27 +00:00
Owner

Both on_pr.yaml jobs have been failing since at least PR #4 (verified via the actions API: lint-and-check-python and lint-and-check-kubernetes both failure), so PR checks were red and being ignored.

lint-and-check-python — mypy: not found

Each run: step is a fresh shell, so the venv activation from step 2 never persists. The job ran venv-mypy once, then relied on an apt install -y black python3-mypy tacked onto the end of step 3 to provide system black/mypy for steps 4–5 — which never took effect (mypy: not found). Even if it had, system mypy cannot see the venv-installed dependencies (discord, aiohttp, …), so it would fail with import errors instead. Additionally python3.11-venv is hardcoded and breaks on any runner image whose default Python is not 3.11.

Fix: install python3-venv (version-agnostic), build the venv in one step, and invoke the tools by explicit path:

- run: |
    apt update
    apt install -y python3-venv
- run: |
    python3 -m venv .venv
    .venv/bin/pip install -r requirements.txt black mypy
- run: .venv/bin/mypy .
- run: .venv/bin/black .

Removes the duplicate mypy run and the redundant apt tool installs. Behavior otherwise unchanged (black . still without --check; enforcing that is a separate change since waifu/discord_bot.py:119 is currently not black-clean on main).

lint-and-check-kubernetes — node: not found

The job overrides the container with git.pr0.tech/rs/builder-kube:latest, which has kube-linter but no Node. actions/checkout@v6 is a JavaScript action and needs node — it died in ~5 s at checkout. Node is not needed by the job itself (kube-linter is a self-contained Go binary); only the checkout action requires it. The default runner image ships Node, which is why the main-branch jobs are green.

Fix: drop the JS checkout and clone with git directly using Forgejo's automatic per-run token:

- run: git clone --depth 1 https://rs:${{ forgejo.token }}@git.pr0.tech/${{ forgejo.repository }}.git repo
- run: /kube-linter lint repo

(Fallback if builder-kube lacks git too: fetch a tarball from the Forgejo API with curl.)

Out of scope / follow-ups

  • black --check . to make the format gate real (needs the one pre-existing formatting violation fixed)
  • synchronize in the PR trigger so updated branches are re-checked
  • gating release_on_main jobs on lint; unique chart versions instead of hardcoded v0.0.1
Both `on_pr.yaml` jobs have been failing since at least PR #4 (verified via the actions API: `lint-and-check-python` and `lint-and-check-kubernetes` both `failure`), so PR checks were red and being ignored. ## `lint-and-check-python` — `mypy: not found` Each `run:` step is a fresh shell, so the venv activation from step 2 never persists. The job ran venv-`mypy` once, then relied on an `apt install -y black python3-mypy` tacked onto the end of step 3 to provide *system* `black`/`mypy` for steps 4–5 — which never took effect (`mypy: not found`). Even if it had, system mypy cannot see the venv-installed dependencies (`discord`, `aiohttp`, …), so it would fail with import errors instead. Additionally `python3.11-venv` is hardcoded and breaks on any runner image whose default Python is not 3.11. **Fix:** install `python3-venv` (version-agnostic), build the venv in one step, and invoke the tools by explicit path: ```yaml - run: | apt update apt install -y python3-venv - run: | python3 -m venv .venv .venv/bin/pip install -r requirements.txt black mypy - run: .venv/bin/mypy . - run: .venv/bin/black . ``` Removes the duplicate mypy run and the redundant apt tool installs. Behavior otherwise unchanged (`black .` still without `--check`; enforcing that is a separate change since `waifu/discord_bot.py:119` is currently not black-clean on main). ## `lint-and-check-kubernetes` — `node: not found` The job overrides the container with `git.pr0.tech/rs/builder-kube:latest`, which has kube-linter but no Node. `actions/checkout@v6` is a JavaScript action and needs `node` — it died in ~5 s at checkout. Node is **not** needed by the job itself (kube-linter is a self-contained Go binary); only the checkout action requires it. The default runner image ships Node, which is why the `main`-branch jobs are green. **Fix:** drop the JS checkout and clone with git directly using Forgejo's automatic per-run token: ```yaml - run: git clone --depth 1 https://rs:${{ forgejo.token }}@git.pr0.tech/${{ forgejo.repository }}.git repo - run: /kube-linter lint repo ``` (Fallback if `builder-kube` lacks `git` too: fetch a tarball from the Forgejo API with `curl`.) ## Out of scope / follow-ups - `black --check .` to make the format gate real (needs the one pre-existing formatting violation fixed) - `synchronize` in the PR trigger so updated branches are re-checked - gating `release_on_main` jobs on lint; unique chart versions instead of hardcoded `v0.0.1`
fix(ci): repair broken pr lint jobs (mypy/node not found)
Some checks failed
/ lint-and-check-kubernetes (pull_request) Failing after 4s
/ lint-and-check-python (pull_request) Successful in 44s
eb9cfe90cf
rs merged commit 03f3006563 into main 2026-09-02 21:22:27 +00:00
rs deleted branch fix/ci-workflows 2026-09-02 21:22:27 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rs/acidwaifu!6
No description provided.