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
-
create a top level group called
milestone-test
, and a subgroup of it calledmilestone-subgroup
, and a project in the subgroup calledmilestone-project
. Make them both public for ease of testing -
in each create a milestone
-
open the graphql explorer, such as
http://localhost:3000/-/graphql-explorer
-
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
-
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 themilestone-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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #421030 (closed)