beads/internal/ado
Harry Miller 33cab03193
fix: recognize ado:NNNNN shorthand in IsExternalRef and ExtractIdentifier (#2966)
* fix: recognize ado:NNNNN shorthand in IsExternalRef and ExtractIdentifier

IsExternalRef and ExtractIdentifier only matched full ADO URLs
(/_workitems/edit/\d+), but BuildExternalRef produces ado:NNNNN
shorthand when org/project config is unavailable. This caused the
sync engine to treat existing beads as new, creating duplicate ADO
work items instead of updating existing ones.

Fixes harry-miller-trimble/beads#28

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: add shorthand ref support to GitHub/GitLab trackers, tighten ado:0

Address PR #2966 review feedback:

- GitHub tracker: add ghShorthandPattern (github:{id}) to IsExternalRef
  and ExtractIdentifier, fixing the same duplicate-creation bug as ADO
- GitLab tracker: add glShorthandPattern (gitlab:{id}) to IsExternalRef
  and ExtractIdentifier, fixing the same duplicate-creation bug as ADO
- ADO tracker: tighten regex from ^ado:(\d+)$ to ^ado:([1-9]\d*)$ to
  reject ado:0 which is invalid in practice
- Add test cases for shorthand format in all three trackers

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-02 19:20:30 -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 Merge pull request #2814 from harry-miller-trimble/feat/tracker-hardening-and-core 2026-03-30 20:41:05 -07:00
client_test.go fix: use proper RFC3339 timezone in WIQL date formatting (bd-wz8) 2026-03-30 12:31:26 -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 dependency links not imported due to ID format mismatch 2026-03-23 18:03:02 -07:00
links_test.go fix: ADO dependency links not imported due to ID format mismatch 2026-03-23 18:03:02 -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: recognize ado:NNNNN shorthand in IsExternalRef and ExtractIdentifier (#2966) 2026-04-02 19:20:30 -07:00
tracker_test.go fix: recognize ado:NNNNN shorthand in IsExternalRef and ExtractIdentifier (#2966) 2026-04-02 19:20:30 -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