Skip to content

Add the ability to query descendant milestones via REST API

What does this MR do and why?

Add support for querying milestones in descendant groups/project. The GraphQL API already supports this, so the relevant code is moved into a shared concern to keep it DRY and provide the same logic for both REST and GraphQL

How to set up and validate locally

  1. create a top level group called milestone-test, and a subgroup of it called milestone-subgroup, and a project in the subgroup called milestone-project. Make them both public for ease of testing

  2. in each create a milestone

  3. open the graphql explorer, such as http://localhost:3000/-/graphql-explorer

  4. use the following query

    query {
      group(fullPath: "milestone-test/milestone-subgroup") {
        id
        milestones(includeDescendants: true) {
          nodes {
            id
            title
          }
        }
      }
    }

    You should get the subgroup and project milestones

  5. test the REST API, in a new tab enter

    http://localhost:3000/api/v4/groups/84/milestones?include_descendants=true

    where 84 is the group id of the milestone-subgroup group

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #421030 (closed)

Edited by Brett Walker

Merge request reports