这是indexloc提供的服务,不要输入任何密码
Skip to content

Add GraphQL MetadataInfo interface for namespace metadata

What does this MR do and why?

Add GraphQL MetadataInfo interface for namespace metadata

  • Add metadata_info field to NamespaceType
  • Create MetadataInfo interface with common metadata fields
  • Implement GroupNamespaceMetadataInfoType with group-specific logic
  • Implement ProjectNamespaceMetadataInfoType with project-specific logic
  • Implement UserNamespaceMetadataInfoType for user namespaces
  • Add comprehensive specs following existing patterns

Fields added:

  • defaultBranch: Project default branch
  • timeTrackingLimitToHours: Time tracking configuration
  • initialSort: User's issue sort preference
  • isSignedIn: Authentication status
  • isIssueRepositioningDisabled: Issue repositioning setting
  • showNewWorkItem: Work item creation permission check
  • maxAttachmentSize: Maximum attachment size limit
  • hasProjects: Group projects existence check
  • groupId: Group/namespace ID

Changelog: added EE: true

References

Relates to #578973

Example

query result
fragment namespaceURLs on Namespace {
  availableFeatures {
    hasWorkItemPlanningViewFeature
    hasDuoRemoteFlowsFeature
  }
  metadata{
    timeTrackingLimitToHours
    initialSort
    isIssueRepositioningDisabled
    showNewWorkItem
    maxAttachmentSize
    groupId
    ... on GroupNamespaceMetadata {
      hasProjects
    }
    ... on ProjectNamespaceMetadata {
      defaultBranch
    }
  }
}


query getNamespaceMetadata1 {
  public_group_namespace: namespace(fullPath: "twitter") {
    ...namespaceURLs
  }
}

query getNamespaceMetadata2 {
	public_project_namespace: namespace(fullPath: "twitter/Typeahead.Js") {
	...namespaceURLs
	}
}

query getNamespaceMetadata3 {
	user_namespace: namespace(fullPath: "root") {
	...namespaceURLs
	}
}

query getNamespaceMetadata4 {
	user_namespace: namespace(fullPath: "root/weather-app") {
	...namespaceURLs
	}
}







{
  "data": {
    "public_group_namespace": {
      "availableFeatures": {
        "hasWorkItemPlanningViewFeature": true,
        "hasDuoRemoteFlowsFeature": true
      },
      "metadata": {
        "timeTrackingLimitToHours": false,
        "initialSort": "created_date",
        "isIssueRepositioningDisabled": false,
        "showNewWorkItem": true,
        "maxAttachmentSize": "100 MiB",
        "groupId": "35",
        "hasProjects": true
      }
    }
  },
  "correlationId": "01K9WGZK7R63YPPA42DDQQYX7P"
}

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Vedant Jain

Merge request reports

Loading