Skip to content

Commit 2fb6f32

Browse files
chore(automations): prevent duplicate work on in-progress issues (#35)
Feature Builder and Bug Fixer could rationalize picking up issues already marked status:in-progress when all backlog items had unsatisfied dependencies. Now both automations: - Filter queries to status:backlog only (Bug Fixer priority queries previously omitted this filter) - Include an explicit CRITICAL instruction forbidding non-backlog issue pickup - Accept status:done label (not just closed state) as satisfied dependency Co-authored-by: Ona <no-reply@ona.com>
1 parent 6bbd9ab commit 2fb6f32

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

.ona/automations/bug-fixer.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,21 @@ action:
5151
5252
2. Find the next bug to fix. Query in priority order:
5353
```
54-
gh issue list --label "bug" --label "priority:1" --state open --json number,title,body,labels \
54+
gh issue list --label "bug" --label "status:backlog" --label "priority:1" --state open --json number,title,body,labels \
5555
--jq '[.[] | select(.labels | map(.name) | contains(["needs-human"]) | not)] | sort_by(.number) | .[0]'
5656
```
57-
If no priority:1 bugs, try priority:2, then priority:3, then any open bug with no priority label:
57+
If no priority:1 bugs, try priority:2, then priority:3, then any open bug with
58+
`status:backlog` and no priority label:
5859
```
59-
gh issue list --label "bug" --state open --json number,title,body,labels \
60-
--jq '[.[] | select(.labels | map(.name) | (contains(["needs-human"]) or contains(["status:in-progress"]) or contains(["status:in-review"]) or contains(["status:done"])) | not)] | sort_by(.number) | .[0]'
60+
gh issue list --label "bug" --label "status:backlog" --state open --json number,title,body,labels \
61+
--jq '[.[] | select(.labels | map(.name) | contains(["needs-human"]) | not)] | sort_by(.number) | .[0]'
6162
```
6263
If no eligible bug issues, stop — do nothing. This is expected, not a failure.
6364
65+
CRITICAL: Only pick issues labeled `status:backlog`. NEVER pick up an issue that is
66+
`status:in-progress`, `status:in-review`, or `status:done` — even if it appears
67+
stalled, abandoned, or has no PR. Another automation or human owns it.
68+
6469
3. Check if the issue already has an open linked PR. Use two checks (GitHub search has indexing lag):
6570
a) Check for a branch matching the naming convention:
6671
`gh pr list --state open --json number,headRefName --jq '[.[] | select(.headRefName | test("fix/<N>-|fix/<N>$"))] | length'`

.ona/automations/feature-builder.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,17 @@ action:
6666
If no priority:1 issues, try priority:2, then priority:3.
6767
If no backlog issues at all, stop — do nothing. This is expected, not a failure.
6868
69+
CRITICAL: Only pick issues labeled `status:backlog`. NEVER pick up an issue that is
70+
`status:in-progress`, `status:in-review`, or `status:done` — even if it appears
71+
stalled, abandoned, or has no PR. Another automation or human owns it. If every
72+
backlog issue has unsatisfied dependencies, stop. Do NOT rationalize picking up
73+
a non-backlog issue.
74+
6975
4. Read the issue body. Check the "Dependencies" section.
7076
For each dependency (e.g., "Depends on #N"), check:
71-
gh issue view N --json state --jq '.state'
72-
If any dependency is still open, skip this issue and try the next one.
77+
gh issue view N --json state,labels --jq '{state: .state, labels: [.labels[].name]}'
78+
A dependency is satisfied when its state is "closed" OR it has label "status:done".
79+
If any dependency is not satisfied, skip this issue and try the next one.
7380
If no issues have satisfied dependencies, stop — do nothing.
7481
7582
## Implementation

0 commit comments

Comments
 (0)