beads/internal/ado
Harry Miller 618db288cb
fix(ado): preserve unmanaged links on push instead of clobbering them (#4523)
bd ado push deleted Related and Predecessor/Successor links on the work
items it pushed (and on a re-asserted parent), causing silent data loss in
Azure DevOps. PushLinks built the desired relation set only from the
forward-direction link types beads emits (Dependency-Forward,
Hierarchy-Forward, Related) targeting beads-tracked items, then removed any
System.LinkTypes.* relation not in that set. That swept away:

  - reverse-direction links (Dependency-Reverse = predecessor/successor,
    Hierarchy-Reverse = parent), which beads represents via the forward link
    on the *other* work item and so never appear in the desired set; and
  - Related/forward links pointing at items beads does not track (e.g. links
    a human created in ADO outside the synced set).

Make push read-merge-write: only remove a current relation when beads owns
it — its type is one beads emits (removableRelTypes) AND its target is a
beads-tracked work item (managedTargets). All other relations are left
untouched. Adds TestPushLinks_PreservesUnmanagedLinks and threads the
managed-target set from pushADOLinks.

Fixes #4522

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 10:53:05 -07:00
..
bootstrap.go feat(ado): add Azure DevOps work item tracker package 2026-03-19 14:34:28 -07:00
bootstrap_test.go feat(ado): add Azure DevOps work item tracker package 2026-03-19 14:34:28 -07:00
client.go fix(ado): use date-only format for WIQL ChangedDate queries (#3345) 2026-04-20 13:05:34 -07:00
client_test.go fix(ado): use date-only format for WIQL ChangedDate queries (#3345) 2026-04-20 13:05:34 -07:00
fieldmapper.go fix: set ADO Severity field for Bug work items during sync 2026-03-30 12:22:26 -07:00
links.go fix(ado): preserve unmanaged links on push instead of clobbering them (#4523) 2026-07-05 10:53:05 -07:00
links_test.go fix(ado): preserve unmanaged links on push instead of clobbering them (#4523) 2026-07-05 10:53:05 -07:00
mapping.go fix: set ADO Severity field for Bug work items during sync 2026-03-30 12:22:26 -07:00
mapping_test.go fix: set ADO Severity field for Bug work items during sync 2026-03-30 12:22:26 -07:00
reconcile.go fix: replace fragile string matching with typed APIError for HTTP status checks 2026-03-30 20:28:13 -07:00
reconcile_test.go feat(ado): add Azure DevOps work item tracker package 2026-03-19 14:34:28 -07:00
richtext.go feat(ado): add Azure DevOps work item tracker package 2026-03-19 14:34:28 -07:00
richtext_test.go feat(ado): add Azure DevOps work item tracker package 2026-03-19 14:34:28 -07:00
statetransition.go fix: replace fragile string matching with typed APIError for HTTP status checks 2026-03-30 20:28:13 -07:00
statetransition_test.go fix(ado): create work items in initial state then transition to target 2026-03-30 12:25:32 -07:00
tracker.go fix(trackers): route secret keys through config.yaml in all tracker getConfig methods 2026-05-15 09:07:12 -07:00
tracker_test.go fix(trackers): route secret keys through config.yaml in all tracker getConfig methods 2026-05-15 09:07:12 -07:00
types.go fix: set ADO Severity field for Bug work items during sync 2026-03-30 12:22:26 -07:00
types_test.go feat(ado): add Azure DevOps work item tracker package 2026-03-19 14:34:28 -07:00