Commit graph

3 commits

Author SHA1 Message Date
Mike Taylor
c2c37605de
fix(github) bd github sync (GitHub issues integration) (#3929)
* fix(github): read github.token from config.yaml in tracker.Init

The github tracker's getConfig() only checked store.GetConfig (Dolt DB)
and the env var, but github.token is a yaml-only secret key and is
never stored in the DB. As a result, `bd github sync` errored with
"GitHub token not configured" even when the token was correctly set
in .beads/config.yaml via `bd config set github.token <token>`.

Mirror the pattern already used by internal/linear/tracker.go and
cmd/bd/github.go:getGitHubConfigValue(): check config.IsYamlOnlyKey
first and read from config.yaml for those keys.

Also adds TestGetConfig_YamlOnlyKeyBypassesStore: constructs a Tracker
with a nil store and verifies getConfig still resolves github.token via
env-var fallback — proof that yaml-only keys no longer deref the store.
Without the fix this test would panic on the nil store.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* test(github): cover yaml-read path for github.token getConfig

The original regression test (TestGetConfig_YamlOnlyKeyBypassesStore)
only proves the env-var fallback path through the yaml-only branch. It
does not assert the primary behavior the PR fixes: that github.token is
actually read from config.yaml when set there.

Add TestGetConfig_YamlOnlyKeyReadsFromYaml: writes a temp .beads/config.yaml
containing github.token, runs config.Initialize (with HOME/XDG isolated
and BEADS_TEST_IGNORE_REPO_CONFIG=1 so only the temp file loads), and
verifies tr.getConfig returns the yaml value with GITHUB_TOKEN unset.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 08:47:39 -07:00
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
beads/crew/emma
0cf8666fff feat: add GitHub Issues integration (tracker plugin) (GH#2373)
Implements tracker.IssueTracker and tracker.FieldMapper interfaces for
GitHub Issues, mirroring the existing GitLab integration pattern. Adds
bd github sync/status/repos commands for bidirectional issue sync with
scoped label mapping, pagination, rate-limit handling, and GitHub
Enterprise support.

Co-Authored-By: StefanTrockel <StefanTrockel@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:53:31 -07:00