머지 리퀘스트 컨텍스트 커밋 API
GitLab v19.5Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
요약
머지 리퀘스트가 이전 머지 리퀘스트를 기반으로 하는 경우 컨텍스트를 위해 머지 리퀘스트에 이전에 머지된 커밋 포함이 필요할 수 있습니다. 단일 머지 리퀘스트의 컨텍스트 커밋을 나열합니다. 단일 머지 리퀘스트의 컨텍스트 커밋을 생성합니다.
머지 리퀘스트가 이전 머지 리퀘스트를 기반으로 하는 경우 컨텍스트를 위해 머지 리퀘스트에 이전에 머지된 커밋 포함이 필요할 수 있습니다. 이 API를 사용하여 더 많은 컨텍스트를 위해 머지 리퀘스트에 커밋을 추가합니다.
머지 리퀘스트의 컨텍스트 커밋 목록 조회#
단일 머지 리퀘스트의 컨텍스트 커밋을 나열합니다.
GET /projects/:id/merge_requests/:merge_request_iid/context_commits
매개변수:
| 속성 | 유형 | 필수 여부 | 설명 |
|---|---|---|---|
id |
정수 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
merge_request_iid |
정수 | 예 | 머지 리퀘스트의 내부 ID. |
요청 예시:
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/15/merge_requests/12/context_commits"
응답 예시:
[
{
"id": "4a24d82dbca5c11c61556f3b35ca472b7463187e",
"short_id": "4a24d82d",
"created_at": "2017-04-11T10:08:59.000Z",
"parent_ids": null,
"title": "Update README.md to include usage in testing and development",
"message": "Update README.md to include usage in testing and development",
"author_name": "Example User",
"author_email": "user@example.com",
"authored_date": "2017-04-11T10:08:59.000Z",
"committer_name": "Example User",
"committer_email": "user@example.com",
"committed_date": "2017-04-11T10:08:59.000Z",
"trailers": {},
"extended_trailers": null,
"web_url": "https://gitlab.example.com/example/project/-/commit/4a24d82dbca5c11c61556f3b35ca472b7463187e",
"author": {
"id": 1,
"username": "example",
"public_email": null,
"name": "Example User",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
"web_url": "https://gitlab.example.com/example",
"show_status": false,
"path": "/example"
},
"author_gravatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
"commit_url": "https://gitlab.example.com/example/project/-/commit/4a24d82dbca5c11c61556f3b35ca472b7463187e",
"commit_path": "/example/project/-/commit/4a24d82dbca5c11c61556f3b35ca472b7463187e",
"description_html": "",
"title_html": "Update README.md to include usage in testing and development",
"signature_html": null,
"prev_commit_id": null,
"next_commit_id": null,
"pipeline_status_path": null
}
]
머지 리퀘스트의 컨텍스트 커밋 생성#
단일 머지 리퀘스트의 컨텍스트 커밋을 생성합니다.
POST /projects/:id/merge_requests/:merge_request_iid/context_commits
매개변수:
| 속성 | 유형 | 필수 여부 | 설명 |
|---|---|---|---|
id |
정수 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로 |
merge_request_iid |
정수 | 예 | 머지 리퀘스트의 내부 ID. |
commits |
문자열 배열 | 예 | 컨텍스트 커밋의 SHA. |
요청 예시:
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
--header 'Content-Type: application/json' \
--data '{"commits": ["51856a574ac3302a95f82483d6c7396b1e0783cb"]}' \
--url "https://gitlab.example.com/api/v4/projects/15/merge_requests/12/context_commits"
응답 예시:
[
{
"id": "51856a574ac3302a95f82483d6c7396b1e0783cb",
"short_id": "51856a57",
"created_at": "2014-02-27T10:05:10.000+02:00",
"parent_ids": [
"57a82e2180507c9e12880c0747f0ea65ad489515"
],
"title": "Commit title",
"message": "Commit message",
"author_name": "Example User",
"author_email": "user@example.com",
"authored_date": "2014-02-27T10:05:10.000+02:00",
"committer_name": "Example User",
"committer_email": "user@example.com",
"committed_date": "2014-02-27T10:05:10.000+02:00",
"trailers": {},
"web_url": "https://gitlab.example.com/project/path/-/commit/b782f6c553653ab4e16469ff34bf3a81638ac304"
}
]
머지 리퀘스트에서 컨텍스트 커밋 삭제#
단일 머지 리퀘스트에서 컨텍스트 커밋을 삭제합니다.
DELETE /projects/:id/merge_requests/:merge_request_iid/context_commits
매개변수:
| 속성 | 유형 | 필수 여부 | 설명 |
|---|---|---|---|
commits |
문자열 배열 | 예 | 컨텍스트 커밋의 SHA. |
id |
정수 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
merge_request_iid |
정수 | 예 | 머지 리퀘스트의 내부 ID. |