Show the pipeline on the merged branch in MR widget
What does this MR do?
This is one of the %11.5 Deliverable MRs
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22380
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22410
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22381
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22385
- This MR
merge_pipeline
in MR widget API
Expose the information of We're currently exposing the information of the head pipeline for the merge request widget. FE gets the information via MR widget API merge_requests/X.json?serializer=widget
.
In this MR, we're going to add additional keyword merge_pipeline
, which represents the pipeline on the merged branch. For example, if the MR has been merged into master branch, users can see both pipelines on MR branch and master branch.
Remeber that we've already exposed the deployment status in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22385. So that we can just present merge_pipeline
. Automatically, deployment status comes along with it.
Here is the sample payload.
Sample payload
# merge_requests/6.json?serializer=widget
{
...
"pipeline": {
...
"details": {
...
"deployments_statuses": [
{
"environment_text_for_pipeline": "Outdated deployment to %{environment_path}. View the most recent deployment %{deployment_path}.",
"environment_text_for_job": "This job is an out-of-date deployment to %{environment_path}. View the most recent deployment %{deployment_path}.",
"environment_path": "/root/stateful-deployments/environments/108",
"deployment_path": "/root/stateful-deployments/-/jobs/3668",
"environment_name": "review/feature-5",
"metrics_url": null,
"metrics_monitoring_url": "/root/stateful-deployments/environments/108/metrics",
"stop_url": "/root/stateful-deployments/environments/108/stop",
"external_url": "http://feature-5.my.domain.com",
"external_url_formatted": "feature-5.my.domain.com",
"deployed_at": "2018-10-16T06:11:13.464Z",
"deployed_at_formatted": "Oct 16, 2018 6:11am"
},
{
"environment_text_for_pipeline": "Outdated deployment to %{environment_path}. View the most recent deployment %{deployment_path}.",
"environment_text_for_job": "This job is an out-of-date deployment to %{environment_path}. View the most recent deployment %{deployment_path}.",
"environment_path": "/root/stateful-deployments/environments/108",
"deployment_path": "/root/stateful-deployments/-/jobs/3668",
"environment_name": "review/feature-5",
"metrics_url": null,
"metrics_monitoring_url": "/root/stateful-deployments/environments/108/metrics",
"stop_url": "/root/stateful-deployments/environments/108/stop",
"external_url": "http://feature-5.my.domain.com",
"external_url_formatted": "feature-5.my.domain.com",
"deployed_at": "2018-10-16T06:11:13.490Z",
"deployed_at_formatted": "Oct 16, 2018 6:11am"
}
]
},
...
},
"merge_pipeline": {
...
"details": {
...
"deployments_statuses": [
{
"environment_text_for_pipeline": "Successfully deployed to %{environment_path}.",
"environment_text_for_job": "This job is the most recent deployment to %{environment_path}.",
"environment_path": "/root/stateful-deployments/environments/68",
"deployment_path": "/root/stateful-deployments/-/jobs/3661",
"environment_name": "production",
"metrics_url": null,
"metrics_monitoring_url": "/root/stateful-deployments/environments/68/metrics",
"stop_url": "/root/stateful-deployments/environments/68/stop",
"external_url": "http://production.my.domain.com",
"external_url_formatted": "production.my.domain.com",
"deployed_at": "2018-10-16T09:59:47.880Z",
"deployed_at_formatted": "Oct 16, 2018 9:59am"
},
{
"environment_text_for_pipeline": "Successfully deployed to %{environment_path}.",
"environment_text_for_job": "This job is the most recent deployment to %{environment_path}.",
"environment_path": "/root/stateful-deployments/environments/72",
"deployment_path": "/root/stateful-deployments/-/jobs/3660",
"environment_name": "staging",
"metrics_url": null,
"metrics_monitoring_url": "/root/stateful-deployments/environments/72/metrics",
"stop_url": "/root/stateful-deployments/environments/72/stop",
"external_url": "http://staging.my.domain.com",
"external_url_formatted": "staging.my.domain.com",
"deployed_at": "2018-10-16T09:59:47.902Z",
"deployed_at_formatted": "Oct 16, 2018 9:59am"
}
]
},
What are the relevant issue numbers?
Related: https://gitlab.com/gitlab-org/gitlab-ce/issues/25140
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides