Commit graph

7 commits

Author SHA1 Message Date
beads/crew/emma
29531d2b68 feat: GitLab sync — dedup fixes, type filtering, epic→milestone mapping, work item hierarchy (#2889)
- 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
2026-04-02 20:58:25 -07:00
Kyriakos Toulgaridis
9dc3264663
feat: add optional group-level GitLab issue sync (PR #2801)
* 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.
2026-03-26 19:31:45 -07:00
beads/crew/lizzy
f0292aa638 fix: CI test failures after Dolt transition (bd-2a5i3)
Fix 13 failing tests across 10 files caused by the SQLite→Dolt migration:

- Fix real bug: scanDependencyRow never assigned metadata to dep.Metadata
- Fix backend detection in doctor/fix to only skip when config says Dolt
- Fix global state pollution in gitlab tests (dbPath/store leak)
- Replace SQLite PRAGMA/datetime syntax with Dolt SET FOREIGN_KEY_CHECKS/NOW()
- Add NOT NULL columns to repair test INSERTs (Dolt strict mode)
- Replace :memory: DB path with temp dir (Dolt needs filesystem)
- Skip tests that depend on JSONL ExportToMultiRepo (no-op on Dolt)
- Skip tests incompatible with Dolt backend (migrate, show, repair hang)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 19:54:29 -08:00
beads/crew/lydia
7cff5d3c9e Fix TestGitLabConfigFromEnv nil pointer panic
The test used the global store variable which may be set by prior tests
to a closed Dolt store. Clear store to nil so the test exercises the
environment variable fallback path as intended.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:38:46 -08:00
obsidian
a7f9e86319 fix: resolve remaining errcheck violations in gitlab files
Add explicit error suppression (`_ =`) for unchecked resp.Body.Close()
in internal/gitlab/client.go and unchecked json.NewEncoder, w.Write,
json.NewDecoder, and os.Setenv/Unsetenv calls in gitlab test files.
Replace os.Setenv/Unsetenv with t.Setenv in gitlab_test.go for
automatic cleanup.

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

Executed-By: beads/polecats/obsidian
Rig: beads
Role: polecats
2026-02-02 15:09:06 -07:00
beads/crew/emma
96a28eefaa fix(gitlab): address PR review findings for merge readiness
- 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
2026-01-31 00:07:10 -08:00
Ramos
04b34b25a0 Add bd gitlab command with sync, status, projects subcommands
Implements Issue #7 from the beads GitLab backend epic.

Features:
- bd gitlab status: Show GitLab configuration and sync status
- bd gitlab sync: Sync issues with GitLab (--dry-run, --pull-only, --push-only)
- bd gitlab projects: List accessible GitLab projects

Configuration via bd config or environment variables:
- gitlab.url / GITLAB_URL
- gitlab.token / GITLAB_TOKEN
- gitlab.project_id / GITLAB_PROJECT_ID

Tests: 6 passing tests for config, validation, and command registration.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-01-31 00:01:43 -08:00