Skip to content

Add ability to uniquelly identify a work item by path and iid pair

Alexandru Croitor requested to merge identify_work_item_by_path_iid_pair into master

What does this MR do and why?

Add ability to uniquelly identify a work item by path and iid pair

Add the ability to identify uniquelly a work item by namespace full path and work item iid.

This can be done by using a root level work_item query or using the group, project or namespace level work_item field.

MR acceptance checklist

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

How to set up and validate locally

query root_level {
  groupLevelByID: workItem(id: "gid://gitlab/WorkItem/350") {
    id
    title
    namespace {
      fullPath
    }
  }
  projectLevelByID: workItem(id: "gid://gitlab/WorkItem/89") {
    id
    title
    namespace {
      fullPath
    }
  }
  groupLevelByPathAndIID: workItem(
    namespacePathWithIid: {fullPath: "toolbox", iid: 20}
  ) {
    id
    title
    namespace {
      fullPath
    }
  }
  projectLevelByPathAndIID: workItem(
    namespacePathWithIid: {fullPath: "toolbox/gitlab-smoke-tests", iid: 20}
  ) {
    id
    title
    namespace {
      fullPath
    }
  }
}

query group_level {
  group(fullPath: "toolbox") {
    id
    name
    workItem(iid: "20") {
      id
      title
    }
  }
}

query project_level {
  project(fullPath: "toolbox/gitlab-smoke-tests") {
    id
    name
    workItem(iid: "20") {
      id
      title
    }
  }
}

query group_namespace_level {
  namespace(fullPath: "toolbox") {
    id
    name
    workItem(iid: "20") {
      id
      title
    }
  }
}

# this does not work yet because Resolvers::NamespaceResolver does not resolve projects by full path yet
query project_namespace_level {
  namespace(fullPath: "toolbox/gitlab-smoke-tests") {
    id
    name
    workItem(iid: "20") {
      id
      title
    }
  }
}

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Edited by Alexandru Croitor

Merge request reports