Implement development widget for WorkItem REST API

Implement the development widget for rendering in the WorkItem REST API.

This is a complex widget with multiple connection fields and nested types. Some sub-fields (e.g., relatedMergeRequests, relatedBranches) may warrant separate sub-endpoints due to pagination needs and rate limiting.

GraphQL fields available

Field Type Nullable Description Notes
closingMergeRequests ClosingMergeRequestsConnection yes MRs that close the work item on merge Custom connection with count
relatedBranches [WorkItemRelatedBranch] yes Branches referencing the work item Calls Gitaly, limited to 1 call/request
relatedMergeRequests MergeRequestConnection yes MRs mentioning the work item Limited to 1 call/request, experimental
willAutoCloseByMergeRequest Boolean no Whether auto-close is enabled
featureFlags [FeatureFlag] yes Associated feature flags EE only

Nested types

WorkItemClosingMergeRequest:

Field Type Description
id ID Global ID
mergeRequest MergeRequest Full MR object
fromMrDescription Boolean Whether link is from MR description closing pattern

WorkItemRelatedBranch:

Field Type Description
name String Branch name
comparePath String Path to compare with default branch
pipelineStatus DetailedStatus Pipeline status for the branch

FeatureFlag (EE only):

Field Type Description
id ID Global ID
name String Feature flag name
active Boolean Whether active
path String Path to feature flag
reference String Reference string

Filters/arguments

Standard pagination on all connections. No custom filters. Rate-limited: relatedBranches and relatedMergeRequests (1 resolution per request).

Key files

  • Widget model: app/models/work_items/widgets/development.rb
  • GraphQL type (CE): app/graphql/types/work_items/widgets/development_type.rb
  • GraphQL type (EE): ee/app/graphql/ee/types/work_items/widgets/development_type.rb
  • Closing MR type: app/graphql/types/work_items/closing_merge_request_type.rb
  • Related branch type: app/graphql/types/work_items/related_branch_type.rb
  • Related MR resolver: app/graphql/resolvers/merge_requests/work_item_related_resolver.rb
Edited by 🤖 GitLab Bot 🤖