fix: run the dependency cycle check before blocks_add writes an edge #848
No reviewers
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea!848
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-822-blocks-add-cycle-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
blocks_add("issue A blocks issue B") wrote its edge with no cycle check.deps_addalready checks the whole graph before it writes. The forge refuses only a cycle of two issues, soblocks_addcould close a longer ring, such as A blocks B, B blocks C, and C blocks A, and the forge stored it.The change:
internal/service/deps/block.go). "A blocks B" is the edge "B depends on A".AddBlockWithreads the existing dependencies of both issues, runs the same cycle check thatdeps_addruns, and returns a cycle error that names the path. It writes nothing on a cycle.issue subblocks) and the MCPblocks_addaction both call the deps service, so both surfaces refuse a cycle the same way.blocks_addrefuses a cycle.Tests:
ok madtea.lol/internal/service/deps 34.889s../scripts/gate.shpasses on this commit.Closes #822