Added service and GraphQL mutation to create timelogs
What does this MR do and why?
This MR lays down some foundations for the work needed for #363880 (closed).
Specifically, this MR adds a service and a GraphQL mutation to create timelogs as the only way to create one was with quick actions and those didn't implement the service.
Screenshots or screen recordings
How to set up and validate locally
- Log in into GDK
- Find an issue or MR of a project the user you logged in with has at least reporter access and get it's ID
- Open a new tab for the GraphiQL explorer
- Run this mutation
mutation { timelogCreate(input: { issuableId: "<id of the issue or the MR>", timeSpent: "1h 5m", spentAt: "2022-07-07", summary: "Test from GQL" }) { errors timelog { id timeSpent spentAt } } }
- The timelog should get created and a system note added to the issue or the MR
- Now impersonate a user with guest access, refresh the GraphiQL explorer page and run the mutation again
- It should return an unauthorized error and not create the timelog nor the system note
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.
Edited by Marco Zille