* 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>
- 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
- 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
- Fix swallowed json.Marshal error during retry (client.go line 114)
Now logs the error and continues to next retry attempt instead of
silently ignoring with _.
- Add GetIssue() helper to IssueConversion for type-safe access
Returns *types.Issue from interface{} field, nil if wrong type.
Avoids import cycle by keeping interface{} but providing safe accessor.
- Eliminate duplicate mapping definitions between types.go and mapping.go
Export PriorityMapping, StatusMapping, TypeMapping from types.go as
single source of truth. DefaultMappingConfig now uses these exports.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Add bidirectional mapping between GitLab issues and beads issues:
- MappingConfig for configurable field mappings (priority, status, type, relations)
- GitLabIssueToBeads for import/pull operations
- BeadsIssueToGitLabFields for export/push operations
- IssueLinksToDependencies for dependency conversion
- Support for scoped labels (priority::*, status::*, type::*)
- FilterNonScopedLabels to preserve custom labels
All 11 mapping tests passing (30 total in gitlab package).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew