beads/internal/gitlab
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
..
client.go fix: address PR review feedback 2026-03-30 09:15:55 -07:00
client_test.go feat: add optional group-level GitLab issue sync (PR #2801) 2026-03-26 19:31:45 -07:00
fieldmapper.go refactor: inline tracker adapters into internal packages 2026-02-14 16:18:37 -08:00
mapping.go chore: unexport 12 dead symbols in internal/gitlab 2026-02-07 17:53:51 -08:00
mapping_test.go chore: unexport 12 dead symbols in internal/gitlab 2026-02-07 17:53:51 -08: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 feat: add optional group-level GitLab issue sync (PR #2801) 2026-03-26 19:31:45 -07:00
types_test.go style: run gofmt across entire codebase (bd-nmk12) 2026-02-07 19:35:20 -08:00