* feat(gitlab): sync issue dependency links on push
After issue content syncs, mirror local beads dependency edges as GitLab
issue links: blocks -> GitLab blocks/is_blocked_by (direction-normalized),
related/relates-to -> a single relates_to link per unordered pair (deduped).
Children of synced epics also keep the epic's milestone during a
dependency-only sync. Reports links_pushed in --json.
Additive only (never deletes remote links). License-aware: blocks/
is_blocked_by needs GitLab Premium/Ultimate; on instances without it the
link is reported as a single curated, non-fatal message (links_license_skipped
in JSON) while relates_to and milestones still apply. Genuine (non-license)
link failures remain real warnings, kept distinct from the license case.
Feature: max-efe
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(gitlab): address review — drop dead RelationMap, add push link parity
Follow-up to maphew's review on #4294.
- Delete the dead GitLab RelationMap: issueLinksToDependencies maps link
types via hardcoded constants and ignores MappingConfig, so the field, its
default, and the test assertion were dead config surface implying a
configurability that does not exist. (Linear's RelationMap is untouched.)
- Give `bd gitlab push` dependency-link + epic-milestone parity with
`bd gitlab sync`: extract the shared pushGitLabDependencyLinks helper from
runGitLabSync's inline block and call it from runGitLabPush, scoped to the
requested IssueIDs. Render push output natively so the link pass runs
before the summary, dry-run ordering is correct, and the --json payload
carries links_pushed / links_license_skipped / milestones_updated, matching
sync in all output modes; also guard OnMessage under !jsonOutput.
Reviewed with /code-review + /codex (dry-run "Synced" line, output ordering,
and --json link-stat omission all caught and fixed here).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(gitlab): check outputJSON error in runGitLabSync (errcheck)
CI lint (first run on this branch, only-new-issues=false) flagged the
unchecked outputJSON return in the sync --json path. Return it, matching
runGitLabPush. Fixes the Lint / Build Artifacts / PR Lint failures.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(gitlab): carry closed state on push; surface failed-close in sync result
GitLab's POST /issues (and milestone/work-item creation) cannot set state,
so closed beads were pushed as opened issues and closed epics as active
milestones — milestone progress read 0/X even when all children were done.
- Close after create on all three paths (CreateIssue, createMilestone,
createTaskWorkItem) via a best-effort follow-up state_event=close.
- BeadsIssueToGitLabFields emits state_event close/reopen so the update path
flips both directions (reopening a bead reopens the GitLab issue). deferred
stays open — only "done" work counts toward milestone completion.
- A failed best-effort close now records a warning on TrackerIssue.Warnings,
which the engine drains into the sync result (visible in --json) instead of
a bare stderr print that left --json reporting errors:0 while the issue was
left open.
On close failure the created issue and its external_ref are still returned so
the next push doesn't create a duplicate (the push skip-guard means it won't
retry the close until the bead is next modified — hence the surfaced warning).
Reviewed via /code-review + Codex.
bd: max-9t6
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ten error messages across github, gitlab, and ado commands recommend
'bd config {key} {value}' but the CLI requires the 'set' verb:
'bd config set {key} {value}'.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds CLI layer for selective sync on top of #2957:
- --issues flag registered on all 6 tracker sync commands via shared helpers
- New push/pull subcommands with --dry-run support
- --parent flag ported from Linear-only to ADO, Jira, GitHub, GitLab
Co-authored-by: Harry <harry_miller@trimble.com>
- Fix pull dedup: check wisps table and match work_items URLs
- Add type-based filtering to GitLab sync CLI
- Default-exclude molecule/message/event types from push
- Fix source_system update that breaks external_ref persistence
- Map all beads statuses to GitLab scoped labels for board columns
- Handle status::review and status::done labels on pull
- Map epic beads to GitLab milestones instead of issues
- Create task beads as GitLab Task work items with parent hierarchy
- Walk parent chain to find epic milestone, use API ID not IID
Co-authored-by: ktoulgaridis <ktoulg@gmail.com>
Executed-By: beads/crew/emma
* feat: add optional group-level GitLab issue sync (be-711)
When gitlab.group_id is configured, FetchIssues and FetchIssuesSince
use the /groups/:id/issues API endpoint to aggregate issues across all
projects in the group. Issue creation still uses the project endpoint
(via gitlab.project_id or gitlab.default_project_id).
New config keys:
- gitlab.group_id / GITLAB_GROUP_ID
- gitlab.default_project_id / GITLAB_DEFAULT_PROJECT_ID
Backward compatible: existing project-level sync is unchanged when
group_id is not set.
* feat: add filtering support to GitLab group sync (be-4js)
Add optional filters for labels, project, milestone, and assignee to
the GitLab issue sync. Filters work on both project and group endpoints.
Filters can be set via config (gitlab.filter_labels, etc.), environment
variables (GITLAB_FILTER_LABELS, etc.), or CLI flags (--label, --project,
--milestone, --assignee). CLI flags override config defaults.
Labels, milestone, and assignee are passed as GitLab API query params.
Project filtering within a group is done client-side since the GitLab
group issues API doesn't support it natively.
Several helper paths (list, completions, github, gitlab, linear) reopen
Dolt with only a raw path when the global store is nil. This loses
repo-local metadata like custom dolt_database names and server ports,
falling back to the wrong database or port.
Add a shared openReadOnlyStoreForDBPath() helper that maps dbPath back
to its owning .beads dir and reopens with full metadata. Also fix port
resolution in applyConfigDefaults to use BeadsDir (the .beads/ config
directory) instead of Path (the dolt data directory).
Fixes#2627
Co-Authored-By: Gary <gary@algorune.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
In shared-server mode, the DB issue_prefix belongs to whichever project
initialized first. This caused all projects sharing a server to use the
wrong prefix for issue creation, ID generation, and imports.
Fix: YAML config.yaml issue-prefix now takes precedence over the DB value
in create.go, github.go, gitlab.go, linear.go, orphans.go, and merge_slot.go
(which already had the correct pattern).
Also: EnsureRunning() now calls KillStaleServers() before starting a new
server, cleaning up orphaned dolt sql-server processes that accumulate when
parent processes crash without graceful shutdown (GH#2372).
Also: add cross-project data isolation tests (5 tests covering read isolation,
port collision, same-prefix isolation, concurrent writes, and concurrent
read-write mix). Based on tests by @PabloLION (PR #2472).
Co-Authored-By: PabloLION <dev@pablolion.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove Config.ServerMode and Config.OpenTimeout fields (dead since embedded removal)
- Rewrite doctor/dolt.go to use MySQL protocol instead of embedded dolthub/driver
- Rename openDoltDBWithLock to openDoltConn, remove closeDoltDB helpers
- Delete dolt_nocgo.go stubs (doctor + store_nocgo_test.go)
- Remove cgo build tags from doctor package
- Update lock error messages for server-only world
- Clean up unused lockTimeout parameter threading in list.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 7 (a5da57e3) deleted internal/storage/factory/ and internal/storage/memory/
but left 30+ files still importing them. This commit fixes all broken references:
- Created internal/storage/dolt/open.go with NewFromConfig/NewFromConfigWithOptions
- Replaced all factory.New/NewFromConfig/NewWithOptions with dolt equivalents
- Broke import cycles in dolt/bootstrap.go (routing/utils/audit → local types)
- Removed dead storage.Config struct
- Converted all test files from memory.New() to dolt.New() test stores
- Removed tests that depended on deleted detectPrefix/LoadFromIssues/mockRemoteStore
46 files changed, 249 insertions(+), 851 deletions(-)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Remove the entire internal/storage/sqlite/ package (~43K lines) and update
all 80+ files that imported it to use either the Dolt backend directly
(test files) or the storage factory (production files).
Key changes:
- Delete internal/storage/sqlite/ directory (150+ files)
- Update factory to make Dolt the sole backend, treating "sqlite" as alias for "dolt"
- Replace sqlite.New() calls with dolt.New() in tests, factory.New() in production
- Replace *sqlite.SQLiteStorage with storage.Storage interface throughout
- Replace :memory: SQLite URIs with t.TempDir() for Dolt compatibility
- Inline sqlite.GenerateIssueID() as SHA-256 content hashing where needed
- Fix import cycle in routing/routes.go (routing→factory→dolt→routing)
- Preserve backward-compatible beads.NewSQLiteStorage() wrapper in public API
228 files changed, 605 insertions, 43,821 deletions.
go vet ./... passes clean.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add wrapper functions (doPullFromGitLab, doPushToGitLab,
detectGitLabConflicts) so integration tests compile
- Change IssueConversion.Issue from interface{} to *types.Issue
(new package, no backwards compat needed); remove GetIssue() helper
- Replace raw http.Client in runGitLabProjects with gitlab.Client
method (ListProjects), getting retry/auth logic for free
- Add HTTPS validation on GitLab URL to prevent sending tokens
in cleartext (allows localhost for dev/testing)
- Add io.LimitReader (50MB) to client.go doRequest to prevent OOM
- Improve token masking: show only first 4 chars, not first+last 4
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Changes based on PR #1290 code review:
1. Wire up SyncContext in runGitLabSync - SyncContext was created
but not actually used in the main entry point
2. Delete legacy non-WithContext functions - removes code duplication
and eliminates dead code maintenance burden. All sync operations
now use WithContext variants exclusively
3. Fix --prefer-local behavior - conflicting issues now go to
forceUpdateIDs (to force push) instead of skipUpdateIDs. This
ensures local changes actually win when that strategy is selected
4. Document conflict detection 1-second tolerance - explains the
timestamp comparison window and its limitations for clock skew
5. Document UUID alternative for ID generation - notes that
distributed deployments may need UUIDs instead of the current
timestamp+counter+random approach
Test updates:
- All tests now use WithContext functions
- Removed global store manipulation from tests
- All 18 GitLab tests pass
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Add --prefer-local, --prefer-gitlab, and --prefer-newer flags to bd gitlab sync:
- --prefer-local: Always keep local beads version on conflict
- --prefer-gitlab: Always use GitLab version on conflict
- --prefer-newer: Use most recently updated version (default)
Features:
- Unified resolveGitLabConflicts() function with strategy parameter
- Flag validation (only one conflict strategy allowed)
- Automatic conflict detection and resolution in bidirectional sync
- 7 new tests for conflict resolution
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Added gitlab_sync.go with full sync implementation:
- doPullFromGitLab: imports GitLab issues to beads with incremental sync
- doPushToGitLab: creates/updates GitLab issues from local beads issues
- detectGitLabConflicts: finds issues modified on both sides since last sync
- resolveGitLabConflictsByTimestamp: resolves conflicts using newer-wins
- parseGitLabSourceSystem: parses "gitlab:projectID:iid" format
Updated gitlab.go:
- runGitLabSync now uses sync functions with --pull-only/--push-only flags
- Added proper error handling and progress output
8 new tests in gitlab_sync_test.go, all passing.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew