-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Summary
The bd rename-prefix command updates issue IDs in the issues table and dependencies, but does not update or invalidate the blocked_issues_cache table. This causes blocked issues to incorrectly appear as ready after a prefix rename.
Steps to Reproduce
- Create a project with issues and blocking dependencies
- Run
bd rename-prefixto change the prefix (e.g.,dndmanage→dm) - Run
bd ready --json
Expected Behavior
Blocked issues should be excluded from bd ready output.
Actual Behavior
All issues appear as ready because the blocked_issues_cache table still contains entries with the OLD prefix (e.g., dndmanage-8l6) while the issues table has the NEW prefix (e.g., dm-8l6). The NOT EXISTS check in GetReadyWork() fails to match anything.
Evidence
-- After rename-prefix from dndmanage to dm:
sqlite> SELECT * FROM blocked_issues_cache LIMIT 3;
dndmanage-2v5
dndmanage-8l6
dndmanage-fz8
sqlite> SELECT id FROM issues LIMIT 3;
dm-05u
dm-0ko
dm-2v5Workaround
Modify any blocking dependency to trigger a cache rebuild:
bd dep remove <issue> <blocker>
bd dep add <issue> <blocker>Suggested Fix
In cmd/bd/rename_prefix.go, after renaming IDs, either:
- Update entries in
blocked_issues_cachewith the new prefix, or - Clear the cache and trigger a rebuild via
rebuildBlockedCache()
Option 2 is simpler and consistent with how dependency changes already trigger rebuilds.
Version
bd version 0.47.0