bug: dispatcher grep -oP fails in Alpine — BusyBox doesn't support Perl regex #150

Closed
opened 2026-04-02 15:57:40 +00:00 by dev-bot · 0 comments
Collaborator

Problem

The dispatcher's get_pr_for_file() function uses grep -oP '#\d+' to extract PR numbers from merge commit messages. BusyBox grep in the Alpine-based edge container does not support -P (Perl regex). The command fails silently, returning empty, causing every vault action to fail with "No PR found".

Fix

Replace grep -oP with grep -oE (extended regex, supported by BusyBox):

# Before (broken in Alpine):
pr_num=$(echo "$merge_line" | grep -oP '#\d+' | head -1 | tr -d '#')

# After (works everywhere):
pr_num=$(echo "$merge_line" | grep -oE '#[0-9]+' | head -1 | tr -d '#')

Also audit the entire dispatcher for other grep -P usage and replace with -E.

Affected files

  • docker/edge/dispatcher.shget_pr_for_file() function

Acceptance criteria

  • No grep -P or grep -oP in dispatcher.sh
  • get_pr_for_file() correctly extracts PR number in Alpine/BusyBox
  • End-to-end: vault TOML via merged PR is detected and runner launched
  • CI green
## Problem The dispatcher's `get_pr_for_file()` function uses `grep -oP '#\d+'` to extract PR numbers from merge commit messages. BusyBox grep in the Alpine-based edge container does not support `-P` (Perl regex). The command fails silently, returning empty, causing every vault action to fail with "No PR found". ## Fix Replace `grep -oP` with `grep -oE` (extended regex, supported by BusyBox): ```bash # Before (broken in Alpine): pr_num=$(echo "$merge_line" | grep -oP '#\d+' | head -1 | tr -d '#') # After (works everywhere): pr_num=$(echo "$merge_line" | grep -oE '#[0-9]+' | head -1 | tr -d '#') ``` Also audit the entire dispatcher for other `grep -P` usage and replace with `-E`. ## Affected files - `docker/edge/dispatcher.sh` — `get_pr_for_file()` function ## Acceptance criteria - [ ] No `grep -P` or `grep -oP` in dispatcher.sh - [ ] `get_pr_for_file()` correctly extracts PR number in Alpine/BusyBox - [ ] End-to-end: vault TOML via merged PR is detected and runner launched - [ ] CI green
dev-bot added the
backlog
priority
labels 2026-04-02 15:57:40 +00:00
dev-qwen self-assigned this 2026-04-02 15:59:18 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-02 15:59:19 +00:00
dev-qwen removed their assignment 2026-04-02 16:14:23 +00:00
dev-qwen removed the
in-progress
label 2026-04-02 16:14:24 +00:00
Sign in to join this conversation.
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: johba/disinto#150
No description provided.