Skip to content
Snippets Groups Projects
Commit b98efb6c authored by Marc Shaw's avatar Marc Shaw :two:
Browse files

Expose the prepared_at attribute ot the api

MR: gitlab.com/gitlab-org/gitlab/-/merge_requests/122001
Issue: gitlab.com/gitlab-org/gitlab/-/issues/386562

Changelog: added
parent 16183af2
No related branches found
No related tags found
2 merge requests!122001Add prepared_at to merge_request api to let people know when diffs ready,!119439Draft: Prevent file variable content expansion in downstream pipeline
......@@ -13,6 +13,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - `merge_status` was [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/3169#note_1162532204) in favor of `detailed_merge_status` in GitLab 15.6.
> - `with_merge_status_recheck` [changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/115948) in GitLab 15.11 [with a flag](../administration/feature_flags.md) named `restrict_merge_status_recheck` to be ignored for requests from users insufficient permissions. Disabled by default.
> - `approvals_before_merge` was [deprecated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119503) in GitLab 16.0.
> - `prepared_at` was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122001) in GitLab 16.1.
Authentication is required for API calls to non-public information.
......@@ -108,6 +109,7 @@ Supported attributes:
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"created_at": "2017-04-29T08:46:00Z",
......@@ -296,6 +298,7 @@ Supported attributes:
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"created_at": "2017-04-29T08:46:00Z",
......@@ -471,6 +474,7 @@ Supported attributes:
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"created_at": "2017-04-29T08:46:00Z",
......@@ -628,6 +632,7 @@ Supported attributes:
| `merged_by` | object | User who merged this merge request or set it to auto-merge. [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/350534) in GitLab 14.7, and scheduled for removal in [API version 5](https://gitlab.com/groups/gitlab-org/-/epics/8115). Use `merge_user` instead. |
| `milestone` | object | Milestone of the merge request. |
| `pipeline` | object | Pipeline running on the branch HEAD of the merge request. Consider using `head_pipeline` instead, as it contains more information. |
| `prepared_at` | datetime | Timestamp of when the merge request was prepared. This field is populated one time, only after all the [preparation steps](#preparation-steps) are completed, and is not updated if more changes are added. |
| `project_id` | integer | ID of the merge request project. |
| `reference` | string | Internal reference of the merge request. Returned in shortened format by default. [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/20354) in GitLab 12.7, and scheduled for removal in [API version 5](https://gitlab.com/groups/gitlab-org/-/epics/8115). Use `references` instead. |
| `references` | object | Internal references of the merge request. Includes `short`, `relative`, and `full` references. `references.relative` is relative to the merge request's group or project. When fetched from the merge request's project, `relative` and `short` formats are identical. When requested across groups or projects, `relative` and `full` formats are identical.|
......@@ -664,6 +669,7 @@ Supported attributes:
"merged_by": null, // Deprecated and will be removed in API v5. Use `merge_user` instead.
"merge_user": null,
"merged_at": null,
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"target_branch": "master",
......@@ -822,6 +828,18 @@ Use `detailed_merge_status` instead of `merge_status` to account for all potenti
- `not_open`: The merge request must be open before merge.
- `policies_denied`: The merge request contains denied policies.
### Preparation steps
The `prepared_at` field is populated one time, only after all of the preparation steps
are completed. It is not updated if more changes are added to the merge request:
- The diff is created.
- Web hooks are executed.
- Pipelines are created.
- Mergeability is checked.
- Git LFS objects are linked.
- Notifications are sent.
## Get single merge request participants
Get a list of merge request participants.
......@@ -1353,6 +1371,7 @@ POST /projects/:id/merge_requests
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
......@@ -1524,6 +1543,7 @@ Must include at least one non-required attribute from above.
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
......@@ -1701,6 +1721,7 @@ Supported attributes:
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
......@@ -1902,6 +1923,7 @@ Supported attributes:
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
......@@ -2202,6 +2224,7 @@ Example response:
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
......@@ -2361,6 +2384,7 @@ Example response:
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
......
......@@ -68,6 +68,7 @@ class MergeRequestBasic < IssuableEntity
expose :discussion_locked
expose :should_remove_source_branch?, as: :should_remove_source_branch
expose :force_remove_source_branch?, as: :force_remove_source_branch
expose :prepared_at
with_options if: -> (merge_request, _) { merge_request.for_fork? } do
expose :allow_collaboration
......
......@@ -21,7 +21,7 @@ def present(obj)
merged_by merge_user merged_at closed_by closed_at target_branch user_notes_count upvotes downvotes
author assignees assignee reviewers source_project_id target_project_id labels draft work_in_progress
milestone merge_when_pipeline_succeeds merge_status detailed_merge_status sha merge_commit_sha
squash_commit_sha discussion_locked should_remove_source_branch force_remove_source_branch
squash_commit_sha discussion_locked should_remove_source_branch force_remove_source_branch prepared_at
reference references web_url time_stats squash task_completion_status has_conflicts blocking_discussions_resolved
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment