Skip to content

feat(workitems): extend manage_work_item with date, time tracking, and tier-specific widgets#163

Merged
polaz merged 9 commits intomainfrom
feat/#135-featworkitems-extend-manageworkitem-with-date-time
Jan 24, 2026
Merged

feat(workitems): extend manage_work_item with date, time tracking, and tier-specific widgets#163
polaz merged 9 commits intomainfrom
feat/#135-featworkitems-extend-manageworkitem-with-date-time

Conversation

@polaz
Copy link
Copy Markdown
Member

@polaz polaz commented Jan 23, 2026

Summary

  • Add date (startDate/dueDate), time tracking (timeEstimate/timeSpent), hierarchy (parentId/childrenIds), and tier-specific widget parameters to manage_work_item create/update actions
  • Add add_link/remove_link actions for work item relationships (BLOCKS/IS_BLOCKED_BY/RELATES_TO)
  • Add GraphQL mutations workItemAddLinkedItems and workItemRemoveLinkedItems
  • Fix tier matrix: LINKED_ITEMS→free, COLOR→ultimate, PROGRESS→premium
  • Extend UPDATE_WORK_ITEM response with all widget fragments

New Parameters

Free tier: startDate, dueDate, parentId, childrenIds, timeEstimate, timeSpent, timeSpentAt, timeSpentSummary
Premium tier: isFixed, weight, iterationId, progressCurrentValue
Ultimate tier: healthStatus, color

New Actions

Action Description
add_link Add BLOCKS/IS_BLOCKED_BY/RELATES_TO relationship between work items
remove_link Remove relationship link between work items

Test plan

  • yarn lint — 0 errors
  • yarn test — 3743/3743 tests passed
  • yarn build — successful
  • Integration tests with real GitLab instance (dates, hierarchy, time tracking, linked items)

Closes #135

…erarchy, and linked items

Add widget parameters for create/update actions:
- Free tier: startDate, dueDate, parentId, childrenIds, timeEstimate,
  timeSpent, timeSpentAt, timeSpentSummary
- Premium: isFixed, weight, iterationId, progressCurrentValue
- Ultimate: healthStatus, color

Add new actions for work item relationships:
- add_link: create BLOCKS/IS_BLOCKED_BY/RELATES_TO links between items
- remove_link: remove relationship links

GraphQL layer updates:
- Add WORK_ITEM_ADD_LINKED_ITEMS and WORK_ITEM_REMOVE_LINKED_ITEMS mutations
- Extend UPDATE_WORK_ITEM response with all widget fragments
- Fix WorkItemLinkedItemsWidget interface to include linkType field
- Add WorkItemIterationWidget and WorkItemTimelog interfaces
- Add Iteration to GID entity types

Fix tier matrix: LINKED_ITEMS -> free, COLOR -> ultimate, PROGRESS -> premium

Closes #135
Copilot AI review requested due to automatic review settings January 23, 2026 22:52
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 23, 2026

Test Coverage Report

Overall Coverage: 93.34%

Metric Percentage
Statements 92.85%
Branches 84.52%
Functions 82.73%
Lines 93.34%

View detailed coverage report

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 89.24731% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/entities/workitems/registry.ts 89.02% 0 Missing and 9 partials ⚠️
src/utils/idConversion.ts 80.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends the manage_work_item tool to support additional work item widget fields (dates, hierarchy, time tracking, progress, color, iteration/weight/health) and adds new actions to link/unlink work items via dedicated GraphQL mutations, alongside a corrected tier availability matrix.

Changes:

  • Added add_link / remove_link actions and expanded create/update inputs to cover more widget-backed fields.
  • Extended GraphQL types and mutations (including linked-item mutations) and expanded the update response to include additional widget fragments.
  • Updated widget tier availability rules (LINKED_ITEMS free, PROGRESS premium, COLOR ultimate) and related unit tests; added Iteration GID support.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/unit/services/WidgetAvailability.test.ts Updates tier expectations and parameter→widget mapping assertions.
src/utils/idConversion.ts Adds Iteration GID prefix support for ID conversion.
src/services/WidgetAvailability.ts Updates parameter→widget mapping and tier requirements for widgets.
src/graphql/workItems.ts Adds new widget input shapes/types, linked-items node typing, and linked-items mutations; expands update widget fragments.
src/entities/workitems/schema.ts Extends manage_work_item Zod schema with new fields and new actions.
src/entities/workitems/registry.ts Implements new widget input wiring for create/update and adds link/unlink action handlers.

polaz added 4 commits January 24, 2026 01:03
…apping, add unit tests

- Throw error when timeSpentAt/timeSpentSummary provided without timeSpent
- Remove linkedItemIds from PARAMETER_WIDGET_MAP (linked items use add_link/remove_link actions)
- Add 23 unit tests for add_link, remove_link, and all new widget parameters
…anageworkitem-with-date-time' into feat/#135-featworkitems-extend-manageworkitem-with-date-time
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 12 comments.

…date tests

- Add .min(1) to parentId, childrenIds, iterationId in create and update
  schemas to prevent empty strings producing invalid GIDs
- Add unit tests for update with weight, healthStatus, progress, color widgets
- Add unit test for create with childrenIds
- Add unit test for remove_link with empty workItem response
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

…e in responses

- Add LINKED_ITEMS widget handling to cleanWorkItemResponse: extract simple
  IDs from nested workItem.id fields
- Map GraphQL RELATED linkType back to user-facing RELATES_TO for consistency
  with add_link/remove_link input schema
- Extend GitLabWidget interface with linkedItems typing
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

@polaz polaz requested a review from Copilot January 24, 2026 00:24
@polaz polaz merged commit d63a757 into main Jan 24, 2026
23 checks passed
@polaz polaz deleted the feat/#135-featworkitems-extend-manageworkitem-with-date-time branch January 24, 2026 00:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment on lines 2875 to +2876

[02:18:39.959] INFO (gitlab-mcp): Using in-memory session storage (sessions will be lost on restart)
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated TOOLS.md contains a runtime log line with ANSI color codes at the end ([02:18:39.959] INFO ...). This breaks the markdown and will keep changing between runs, creating noisy diffs. Remove this line and adjust the doc generation pipeline to ensure only the markdown output is written (e.g., suppress logger output / write logs to stderr).

Suggested change
[02:18:39.959][32mINFO�[39m (gitlab-mcp): �[36mUsing in-memory session storage (sessions will be lost on restart)�[39m

Copilot uses AI. Check for mistakes.
Comment on lines +501 to +506
if (parentId !== undefined || (childrenIds !== undefined && childrenIds.length > 0)) {
createInput.hierarchyWidget = {};
if (parentId !== undefined) {
createInput.hierarchyWidget.parentId = toGid(parentId, "WorkItem");
}
if (childrenIds !== undefined && childrenIds.length > 0) {
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

childrenIds can be passed as an empty array (schema allows it), but this childrenIds.length > 0 guard means the value is silently ignored. Either enforce childrenIds to be non-empty in the Zod schema, or handle “provided but empty” explicitly (pass through if meaningful, or throw a validation error).

Suggested change
if (parentId !== undefined || (childrenIds !== undefined && childrenIds.length > 0)) {
createInput.hierarchyWidget = {};
if (parentId !== undefined) {
createInput.hierarchyWidget.parentId = toGid(parentId, "WorkItem");
}
if (childrenIds !== undefined && childrenIds.length > 0) {
if (parentId !== undefined || childrenIds !== undefined) {
createInput.hierarchyWidget = {};
if (parentId !== undefined) {
createInput.hierarchyWidget.parentId = toGid(parentId, "WorkItem");
}
if (childrenIds !== undefined) {

Copilot uses AI. Check for mistakes.
Comment on lines +667 to +674
if (parentId !== undefined || (childrenIds !== undefined && childrenIds.length > 0)) {
updateInput.hierarchyWidget = {};
if (parentId !== undefined) {
// null means unlink parent, string means set parent
updateInput.hierarchyWidget.parentId =
parentId === null ? null : toGid(parentId, "WorkItem");
}
if (childrenIds !== undefined && childrenIds.length > 0) {
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On update, childrenIds can be provided as an empty array (schema allows it), but the childrenIds.length > 0 check prevents sending hierarchyWidget.childrenIds, so the request ignores the user input. Align schema + handler behavior (non-empty schema, or pass through/explicitly reject empty arrays).

Suggested change
if (parentId !== undefined || (childrenIds !== undefined && childrenIds.length > 0)) {
updateInput.hierarchyWidget = {};
if (parentId !== undefined) {
// null means unlink parent, string means set parent
updateInput.hierarchyWidget.parentId =
parentId === null ? null : toGid(parentId, "WorkItem");
}
if (childrenIds !== undefined && childrenIds.length > 0) {
if (parentId !== undefined || childrenIds !== undefined) {
updateInput.hierarchyWidget = {};
if (parentId !== undefined) {
// null means unlink parent, string means set parent
updateInput.hierarchyWidget.parentId =
parentId === null ? null : toGid(parentId, "WorkItem");
}
if (childrenIds !== undefined) {

Copilot uses AI. Check for mistakes.
sw-release-bot bot pushed a commit that referenced this pull request Jan 24, 2026
## [6.37.0](v6.36.0...v6.37.0) (2026-01-24)

### Features

* **workitems:** extend manage_work_item with date, time tracking, and tier-specific widgets ([#163](#163)) ([d63a757](d63a757)), closes [#135](#135)
@sw-release-bot
Copy link
Copy Markdown

🎉 This PR is included in version 6.37.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(workitems): extend manage_work_item with date, time tracking, and tier-specific widgets

2 participants