beads/internal/github
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
..
client.go github: classify rate-limit 403s and stop the push loop when one hits (#3624) 2026-05-02 14:24:57 -07:00
client_ratelimit_test.go github: classify rate-limit 403s and stop the push loop when one hits (#3624) 2026-05-02 14:24:57 -07:00
errors.go github: classify rate-limit 403s and stop the push loop when one hits (#3624) 2026-05-02 14:24:57 -07:00
fieldmapper.go feat: add GitHub Issues integration (tracker plugin) (GH#2373) 2026-03-10 15:53:31 -07:00
mapping.go feat: add GitHub Issues integration (tracker plugin) (GH#2373) 2026-03-10 15:53:31 -07:00
mapping_test.go fix(github): map decision, spike, story, milestone GitHub type labels (GH#3604) (#3639) 2026-05-02 14:02:06 -07:00
tracker.go fix(github) bd github sync (GitHub issues integration) (#3929) 2026-05-15 08:47:39 -07:00
tracker_test.go fix(github) bd github sync (GitHub issues integration) (#3929) 2026-05-15 08:47:39 -07:00
types.go github: classify rate-limit 403s and stop the push loop when one hits (#3624) 2026-05-02 14:24:57 -07:00
types_test.go feat: add GitHub Issues integration (tracker plugin) (GH#2373) 2026-03-10 15:53:31 -07:00