- API v5의 제거 사항
- 머지 요청 목록
- 프로젝트 병합 요청 목록
- 그룹 병합 요청 목록
- 단일 MR 가져오기
- 단일 병합 요청 참가자 가져오기
- 단일 병합 요청 검토자 가져오기
- 단일 병합 요청 커밋 가져오기
- 병합 요청 의존성 가져오기
- 병합 요청 종속성 삭제
- 병합 요청 종속성 생성
- 단일 병합 요청 변경 사항 가져오기
- 병합 요청 차이점 목록
- 병합 요청 파이프라인 목록
- 병합 요청 파이프라인 생성
- MR 생성
- MR 업데이트
- 병합 요청 삭제
- 병합 요청 병합
- 기본 병합 참조 경로로 병합
- 파이프라인 성공 시 병합 취소
- 병합 요청 리베이스
- 병합 요청에 대한 댓글
- 병합 시 닫히는 이슈 목록
- 병합 요청과 관련된 이슈 목록
- 병합 요청 구독하기
- 병합 요청에서 구독 해지
- 할 일 항목 생성
- 병합 요청 차이 버전 가져오기
- 단일 병합 요청 차이 버전 가져오기
- 병합 요청에 대한 시간 추정 설정
- 병합 요청에 대한 시간 추정 초기화
- 병합 요청에 대한 소요 시간 추가
- Merge Request의 소요 시간 재설정
- 시간 추적 통계 가져오기
- 승인
- Merge Request 상태 이벤트 목록
- 문제 해결
머지 요청 API
reference
사용 중단됨 in GitLab 12.7.merged_by
사용 중단됨 in GitLab 14.7.merge_status
사용 중단됨detailed_merge_status
로 대체됨 in GitLab 15.6.with_merge_status_recheck
변경됨 in GitLab 15.11 플래그restrict_merge_status_recheck
이 있는 경우 적절한 권한이 없는 사용자 요청에 대해 무시됩니다. 기본적으로 비활성화되어 있습니다.approvals_before_merge
사용 중단됨 in GitLab 16.0.prepared_at
도입됨 in GitLab 16.1.merge_after
도입됨 in GitLab 17.5.
모든 비공개 정보에 대한 API 호출에는 인증이 필요합니다.
API v5의 제거 사항
approvals_before_merge
속성은 사용 중단되었으며, 제거 예정입니다
API v5에서 Merge request approvals API로 대체됩니다.
머지 요청 목록
인증된 사용자가 액세스할 수 있는 모든 머지 요청을 가져옵니다.
기본적으로 현재 사용자가 생성한 머지 요청만 반환됩니다. 모든 머지 요청을 가져오려면 매개변수 scope=all
을 사용하세요.
state
매개변수를 사용하여 특정 상태(opened
, closed
, locked
, 또는 merged
)의 머지 요청만 가져오거나 모든 상태(all
)를 가져올 수 있습니다.
locked
로 검색하면 일반적으로 결과가 반환되지 않습니다
그 상태는 단기적이며 일시적입니다. page
와
per_page
페이지 매개변수를 사용하여 머지 요청 목록을 제한합니다.
GET /merge_requests
GET /merge_requests?state=opened
GET /merge_requests?state=all
GET /merge_requests?milestone=release
GET /merge_requests?labels=bug,reproduced
GET /merge_requests?author_id=5
GET /merge_requests?author_username=gitlab-bot
GET /merge_requests?my_reaction_emoji=star
GET /merge_requests?scope=assigned_to_me
GET /merge_requests?search=foo&in=title
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
approved_by_ids |
정수 배열 | 아니오 | 주어진 id 를 가진 모든 사용자에 의해 승인된 머지 요청을 반환합니다. 최대 5명의 사용자. None 은 승인 없는 머지 요청을 반환합니다. Any 는 승인된 머지 요청을 반환합니다. Premium 및 Ultimate만 가능합니다. |
approver_ids |
정수 배열 | 아니오 | 주어진 id 를 가진 모든 사용자를 개별 승인자로 지정한 머지 요청을 반환합니다. None 은 승인자가 없는 머지 요청을 반환합니다. Any 는 승인자가 있는 머지 요청을 반환합니다. Premium 및 Ultimate만 가능합니다. |
approved |
문자열 | 아니오 | 머지 요청을 approved 상태로 필터링합니다. yes 는 승인된 머지 요청만 반환합니다. no 는 승인되지 않은 머지 요청만 반환합니다. 도입됨 in GitLab 15.11 플래그 mr_approved_filter 와 함께. 기본적으로 비활성화되어 있습니다. |
assignee_id |
정수 | 아니오 | 주어진 사용자 id 에 할당된 머지 요청을 반환합니다. None 은 할당되지 않은 머지 요청을 반환합니다. Any 는 할당자가 있는 머지 요청을 반환합니다. |
author_id |
정수 | 아니오 | 주어진 사용자 id 가 생성한 머지 요청을 반환합니다. author_username 과 상호 배타적입니다. scope=all 또는 scope=assigned_to_me 와 함께 결합하여 사용하세요. |
author_username |
문자열 | 아니오 | 주어진 username 가 생성한 머지 요청을 반환합니다. author_id 와 상호 배타적입니다. |
created_after |
날짜/시간 | 아니오 | 주어진 시간 이후에 생성된 머지 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
created_before |
날짜/시간 | 아니오 | 주어진 시간 이전에 생성된 머지 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
deployed_after |
날짜/시간 | 아니오 | 주어진 날짜/시간 이후에 배포된 머지 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
deployed_before |
날짜/시간 | 아니오 | 주어진 날짜/시간 이전에 배포된 머지 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
environment |
문자열 | 아니오 | 주어진 환경에 배포된 머지 요청을 반환합니다. |
in |
문자열 | 아니오 |
search 속성의 범위를 변경합니다. title , description , 또는 그것들을 쉼표로 연결한 문자열. 기본값은 title,description 입니다. |
labels |
문자열 | 아니오 | 쉼표로 구분된 레이블 목록과 일치하는 머지 요청을 반환합니다. None 은 레이블이 없는 모든 머지 요청을 나열합니다. Any 는 최소한 하나의 레이블이 있는 모든 머지 요청을 나열합니다. 미리 정의된 이름은 대소문자를 구분하지 않습니다. |
merge_user_id |
정수 | 아니오 | 주어진 사용자 id 에 의해 머지된 머지 요청을 반환합니다. merge_user_username 과 상호 배타적입니다. 도입됨 in GitLab 17.0. |
merge_user_username |
문자열 | 아니오 | 주어진 username 에 의해 머지된 머지 요청을 반환합니다. merge_user_id 와 상호 배타적입니다. 도입됨 in GitLab 17.0. |
milestone |
문자열 | 아니오 | 특정 마일스톤에 대한 머지 요청을 반환합니다. None 은 마일스톤이 없는 머지 요청을 반환합니다. Any 는 할당된 마일스톤이 있는 머지 요청을 반환합니다. |
my_reaction_emoji |
문자열 | 아니오 | 인증된 사용자가 지정한 emoji 로 반응한 머지 요청을 반환합니다. None 은 반응이 없는 문제를 반환합니다. Any 는 적어도 하나의 반응이 있는 문제를 반환합니다. |
not |
해시 | 아니오 | 공급된 매개변수와 일치하지 않는 머지 요청을 반환합니다. 수용 가능: labels , milestone , author_id , author_username , assignee_id , assignee_username , reviewer_id , reviewer_username , my_reaction_emoji . |
order_by |
문자열 | 아니오 |
created_at , title , merged_at (도입됨 in GitLab 17.2), 또는 updated_at 필드로 정렬된 요청을 반환합니다. 기본값은 created_at 입니다. |
reviewer_id |
정수 | 아니오 | 주어진 사용자 id 를 가진 사용자를 리뷰어로 포함한 머지 요청을 반환합니다. None 은 리뷰어가 없는 머지 요청을 반환합니다. Any 는 모든 리뷰어가 있는 머지 요청을 반환합니다. reviewer_username 와 상호 배타적입니다. |
reviewer_username |
문자열 | 아니오 | 주어진 username 을 가진 사용자를 리뷰어로 포함한 머지 요청을 반환합니다. None 은 리뷰어가 없는 머지 요청을 반환합니다. Any 는 모든 리뷰어가 있는 머지 요청을 반환합니다. reviewer_id 와 상호 배타적입니다. |
scope |
문자열 | 아니오 | 주어진 범위에 대한 머지 요청을 반환합니다: created_by_me , assigned_to_me 또는 all . 기본값은 created_by_me 입니다. |
search |
문자열 | 아니오 | 머지 요청을 title 및 description 으로 검색합니다. |
sort |
문자열 | 아니오 | 요청이 asc 또는 desc 순서로 정렬되어 반환됩니다. 기본값은 desc 입니다. |
source_branch |
문자열 | 아니오 | 주어진 소스 브랜치가 있는 머지 요청을 반환합니다. |
state |
문자열 | 아니오 | 모든 머지 요청 또는 opened , closed , locked , 또는 merged 상태의 머지 요청을 반환합니다. |
target_branch |
문자열 | 아니오 | 주어진 타겟 브랜치가 있는 머지 요청을 반환합니다. |
updated_after |
날짜/시간 | 아니오 | 주어진 시간 이후에 업데이트된 머지 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
updated_before |
날짜/시간 | 아니오 | 주어진 시간 이전에 업데이트된 머지 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
view |
문자열 | 아니오 |
simple 인 경우, 머지 요청의 iid , URL, 제목, 설명 및 기본 상태를 반환합니다. |
with_labels_details |
불리언 | 아니오 |
true 인 경우, 응답이 레이블 필드의 각 레이블에 대한 더 많은 세부 정보를 반환합니다: :name , :color , :description , :description_html , :text_color . 기본값은 false 입니다. |
with_merge_status_recheck |
불리언 | 아니오 |
true 인 경우, 이 프로젝션은 merge_status 필드의 비동기 재계산을 요청합니다(보장하지 않습니다). 기본값은 false 입니다. GitLab 15.11 및 이후 버전에서, 이 속성을 요구하는 사용자의 권한이 적어도 Developer 역할 이상일 때 무시하도록 restrict_merge_status_recheck 기능 flag를 활성화하세요. |
wip |
문자열 | 아니오 | 머지 요청을 그들의 wip 상태로 필터링합니다. yes 는 오직 드래프트 머지 요청만 반환하고, no 는 비 드래프트 머지 요청을 반환합니다. |
예시 응답:
[
{
"id": 1,
"iid": 1,
"project_id": 3,
"title": "test1",
"description": "로그인 페이지 CSS 패딩 수정",
"state": "merged",
"imported": false,
"imported_from": "none",
"merged_by": { // Deprecated and will be removed in API v5, use `merge_user` instead
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merge_user": {
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"merge_after": "2018-09-07T11:16:00.000Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"created_at": "2017-04-29T08:46:00Z",
"updated_at": "2017-04-29T08:46:00Z",
"target_branch": "main",
"source_branch": "test1",
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 1,
"name": "Administrator",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url": "https://gitlab.example.com/admin"
},
"assignee": {
"id": 1,
"name": "Administrator",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url": "https://gitlab.example.com/admin"
},
"assignees": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"reviewers": [{
"id": 2,
"name": "Sam Bauch",
"username": "kenyatta_oconnell",
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/956c92487c6f6f7616b536927e22c9a0?s=80&d=identicon",
"web_url": "http://gitlab.example.com//kenyatta_oconnell"
}],
"source_project_id": 2,
"target_project_id": 3,
"labels": [
"Community contribution",
"Manage"
],
"draft": false,
"work_in_progress": false,
"milestone": {
"id": 5,
"iid": 1,
"project_id": 3,
"title": "v2.0",
"description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
"state": "closed",
"created_at": "2015-02-02T19:49:26.013Z",
"updated_at": "2015-02-02T19:49:26.013Z",
"due_date": "2018-09-22",
"start_date": "2018-08-08",
"web_url": "https://gitlab.example.com/my-group/my-project/milestones/1"
},
"merge_when_pipeline_succeeds": true,
"merge_status": "can_be_merged",
"detailed_merge_status": "not_open",
"sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null,
"squash_commit_sha": null,
"user_notes_count": 1,
"discussion_locked": null,
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "my-group/my-project!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"task_completion_status": {
"count": 0,
"completed_count": 0
}
}
]
병합 요청 목록 응답 노트
-
병합 요청 목록은
merge_status
(이는has_conflicts
에도 영향을 미침)를 적극적으로 업데이트하지 않을 수 있습니다. 이는 비용이 많이 드는 작업이기 때문입니다. 이 엔드포인트에서 이러한 필드의 값이 필요한 경우 쿼리에서with_merge_status_recheck
매개변수를true
로 설정하세요. -
병합 요청 객체 필드에 대한 참고 사항은 단일 병합 요청 응답 노트를 참조하세요.
프로젝트 병합 요청 목록
이 프로젝트에 대한 모든 병합 요청을 가져옵니다.
GET /projects/:id/merge_requests
GET /projects/:id/merge_requests?state=opened
GET /projects/:id/merge_requests?state=all
GET /projects/:id/merge_requests?iids[]=42&iids[]=43
GET /projects/:id/merge_requests?milestone=release
GET /projects/:id/merge_requests?labels=bug,reproduced
GET /projects/:id/merge_requests?my_reaction_emoji=star
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로입니다. |
approved_by_ids |
정수 배열 | 아니오 | 주어진 id 를 가진 모든 사용자가 승인한 병합 요청을 반환합니다. 최대 5명의 사용자. None 은 승인 없이 병합 요청을 반환합니다. Any 는 승인이 있는 병합 요청을 반환합니다. Premium 및 Ultimate 전용입니다. |
approver_ids |
정수 배열 | 아니오 | 주어진 id 를 가진 사용자를 개별 승인자로 지정한 병합 요청을 반환합니다. None 은 승인자가 없는 병합 요청을 반환합니다. Any 는 승인자가 있는 병합 요청을 반환합니다. Premium 및 Ultimate 전용입니다. |
approved |
문자열 | 아니오 | 병합 요청의 approved 상태로 필터링합니다. yes 는 승인된 병합 요청만 반환합니다. no 는 승인되지 않은 병합 요청만 반환합니다. 도입됨 GitLab 15.11에서. 기능 플래그 mr_approved_filter 가 활성화된 경우에만 사용할 수 있습니다. |
assignee_id |
정수 | 아니오 | 주어진 사용자 id 에 할당된 병합 요청을 반환합니다. None 은 할당되지 않은 병합 요청을 반환합니다. Any 는 승인자가 있는 병합 요청을 반환합니다. |
author_id |
정수 | 아니오 | 주어진 사용자 id 에 의해 생성된 병합 요청을 반환합니다. author_username 과 상호 배타적입니다. |
author_username |
문자열 | 아니오 | 주어진 username 에 의해 생성된 병합 요청을 반환합니다. author_id 와 상호 배타적입니다. |
created_after |
날짜시간 | 아니오 | 주어진 시간 이후에 생성된 병합 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
created_before |
날짜시간 | 아니오 | 주어진 시간 이전에 생성된 병합 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
environment |
문자열 | 아니오 | 주어진 환경에 배포된 병합 요청을 반환합니다. |
iids[] |
정수 배열 | 아니오 | 주어진 iid 를 가진 요청을 반환합니다. |
labels |
문자열 | 아니오 | 쉼표로 구분된 레이블 목록과 일치하는 병합 요청을 반환합니다. None 은 레이블이 없는 모든 병합 요청을 나열합니다. Any 는 하나 이상의 레이블이 있는 모든 병합 요청을 나열합니다. 미리 정의된 이름은 대소문자를 구분하지 않습니다. |
merge_user_id |
정수 | 아니오 | 주어진 사용자 id 에 의해 병합된 병합 요청을 반환합니다. merge_user_username 과 상호 배타적입니다. 도입됨 GitLab 17.0에서. |
merge_user_username |
문자열 | 아니오 | 주어진 username 에 의해 병합된 병합 요청을 반환합니다. merge_user_id 와 상호 배타적입니다. 도입됨 GitLab 17.0에서. |
milestone |
문자열 | 아니오 | 특정 마일스톤에 대한 병합 요청을 반환합니다. None 은 마일스톤이 없는 병합 요청을 반환합니다. Any 는 할당된 마일스톤이 있는 병합 요청을 반환합니다. |
my_reaction_emoji |
문자열 | 아니오 | 인증된 사용자가 주어진 emoji 에 반응한 병합 요청을 반환합니다. None 은 반응이 없는 문제를 반환합니다. Any 는 적어도 하나의 반응이 있는 문제를 반환합니다. |
not |
해시 | 아니오 | 제공된 매개변수와 일치하지 않는 병합 요청을 반환합니다. 사용됩니다: labels , milestone , author_id , author_username , assignee_id , assignee_username , reviewer_id , reviewer_username , my_reaction_emoji . |
order_by |
문자열 | 아니오 |
created_at , title 또는 updated_at 필드에 의해 정렬된 요청을 반환합니다. 기본값은 created_at 입니다. |
page |
정수 | 아니오 | 반환할 결과 페이지입니다. 기본값은 1입니다. |
per_page |
정수 | 아니오 | 페이지당 결과 수입니다. 기본값은 20입니다. |
reviewer_id |
정수 | 아니오 | 주어진 사용자 id 를 가진 사용자가 리뷰어인 병합 요청을 반환합니다. None 은 리뷰어가 없는 병합 요청을 반환합니다. Any 는 모든 리뷰어가 있는 병합 요청을 반환합니다. reviewer_username 과 상호 배타적입니다. |
reviewer_username |
문자열 | 아니오 | 주어진 username 을 가진 사용자가 리뷰어인 병합 요청을 반환합니다. None 은 리뷰어가 없는 병합 요청을 반환합니다. Any 는 모든 리뷰어가 있는 병합 요청을 반환합니다. reviewer_id 와 상호 배타적입니다. |
scope |
문자열 | 아니오 | 주어진 범위에 대한 병합 요청을 반환합니다: created_by_me , assigned_to_me , 또는 all . |
search |
문자열 | 아니오 | 병합 요청을 title 및 description 에 대해 검색합니다. |
sort |
문자열 | 아니오 |
asc 또는 desc 순서로 정렬된 요청을 반환합니다. 기본값은 desc 입니다. |
source_branch |
문자열 | 아니오 | 주어진 소스 브랜치를 가진 병합 요청을 반환합니다. |
state |
문자열 | 아니오 | 모든 병합 요청(all ) 또는 opened , closed , locked , merged 상태의 병합 요청만 반환합니다. |
target_branch |
문자열 | 아니오 | 주어진 대상 브랜치를 가진 병합 요청을 반환합니다. |
updated_after |
날짜시간 | 아니오 | 주어진 시간 이후에 업데이트된 병합 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
updated_before |
날짜시간 | 아니오 | 주어진 시간 이전에 업데이트된 병합 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
view |
문자열 | 아니오 |
simple 이면 병합 요청의 iid , URL, 제목, 설명 및 기본 상태를 반환합니다. |
wip |
문자열 | 아니오 | 병합 요청의 wip 상태로 필터링합니다. yes 는 오직 초안 병합 요청만 반환하며, no 는 비 초안 병합 요청을 반환합니다. |
with_labels_details |
불리언 | 아니오 |
true 이면 응답은 레이블 필드의 각 레이블에 대한 더 많은 세부정보를 반환합니다: :name , :color , :description , :description_html , :text_color . 기본값은 false 입니다. |
with_merge_status_recheck |
불리언 | 아니오 |
true 이면 이 프로젝션은 merge_status 필드의 비동기 재계산을 요청합니다(하지만 보장하지는 않습니다). 기본값은 false 입니다. GitLab 15.11 및 이후 버전에서, restrict_merge_status_recheck 기능 플래그를 활성화하여 최소한 Developer 역할이 없는 사용자가 요청한 경우 이 속성을 무시할 수 있습니다. |
성공적으로 반환되면 200 OK
와 다음 응답 속성이 반환됩니다:
속성 | 유형 | 설명 |
---|---|---|
[].id |
정수 | 병합 요청의 ID입니다. |
[].iid |
정수 | 병합 요청의 내부 ID입니다. |
[].approvals_before_merge |
정수 | 이 병합 요청이 병합되기 전에 필요한 승인 수입니다. 승인 규칙을 구성하려면 병합 요청 승인 API를 참조하세요. Deprecated GitLab 16.0에서. Premium 및 Ultimate 전용입니다. |
[].assignee |
객체 | 병합 요청의 첫 번째 수신자입니다. |
[].assignees |
배열 | 병합 요청의 수신자입니다. |
[].author |
객체 | 이 병합 요청을 생성한 사용자입니다. |
[].blocking_discussions_resolved |
불리언 | 모든 논의가 병합 요청이 병합될 수 있기에 앞서 필수인 경우 해결되었음을 나타냅니다. |
[].closed_at |
날짜시간 | 병합 요청이 닫힌 시각의 타임스탬프입니다. |
[].closed_by |
객체 | 이 병합 요청을 닫은 사용자입니다. |
[].created_at |
날짜시간 | 병합 요청이 생성된 시각의 타임스탬프입니다. |
[].description |
문자열 | 병합 요청의 설명입니다. |
[].detailed_merge_status |
문자열 | 병합 요청의 상세 병합 상태입니다. 병합 상태를 참조하여 가능한 값 목록을 확인하세요. |
[].discussion_locked |
불리언 | 병합 요청에 대한 댓글이 멤버 전용으로 잠겨 있는지 여부를 나타냅니다. |
[].downvotes |
정수 | 병합 요청의 다운보트 수입니다. |
[].draft |
불리언 | 병합 요청이 초안인지 여부를 나타냅니다. |
[].force_remove_source_branch |
불리언 | 병합 후 소스 브랜치 삭제를 위한 프로젝트 설정을 나타냅니다. |
[].has_conflicts |
불리언 | 병합 요청이 충돌이 있는지 여부와 병합이 불가능한 지를 나타냅니다. merge_status 속성에 따라 달라집니다. merge_status 가 cannot_be_merged 일 때만 false 를 반환합니다. |
[].labels |
배열 | 병합 요청의 레이블입니다. |
[].merge_commit_sha |
문자열 | 병합 요청 커밋의 SHA입니다. 병합될 때까지 null 을 반환합니다. |
[].merge_status |
문자열 | 병합 요청의 상태입니다. unchecked , checking , can_be_merged , cannot_be_merged , 또는 cannot_be_merged_recheck 중 하나일 수 있습니다. has_conflicts 속성에 영향을 미칩니다. 응답 데이터에 대한 중요 메모는 단일 병합 요청 응답 노트를 참조하세요. Deprecated GitLab 15.6에서. 대신 detailed_merge_status 를 사용하세요. |
[].merge_user |
객체 | 이 병합 요청을 병합한 사용자, 자동 병합으로 설정한 사용자, 또는 null 입니다. 도입됨 GitLab 14.7에서. |
[].merge_when_pipeline_succeeds |
불리언 | 파이프라인이 성공할 때 병합하도록 설정되었는지를 나타냅니다. |
[].merged_at |
날짜시간 | 병합 요청이 병합된 시각의 타임스탬프입니다. |
[].merged_by |
객체 | 이 병합 요청을 병합한 사용자 또는 자동 병합으로 설정한 사용자입니다. Deprecated GitLab 14.7에서, API 버전 5에서 제거될 예정입니다. 대신 merge_user 를 사용하세요. |
[].milestone |
객체 | 병합 요청의 마일스톤입니다. |
[].prepared_at |
날짜시간 | 병합 요청이 준비된 시각의 타임스탬프입니다. 이 필드는 준비 단계가 완료된 후에만 한 번 채워지며, 더 이상의 변경이 추가되면 업데이트되지 않습니다. |
[].project_id |
정수 | 병합 요청이 있는 프로젝트의 ID입니다. 항상 target_project_id 와 같습니다. |
[].reference |
문자열 | 병합 요청의 내부 참조입니다. 기본적으로 축약형식으로 반환됩니다. Deprecated GitLab 12.7에서, API 버전 5에서 제거될 예정입니다. 대신 references 를 사용하세요. |
[].references |
객체 | 병합 요청의 내부 참조입니다. short , relative , 및 full 참조를 포함합니다. references.relative 는 병합 요청의 그룹 또는 프로젝트에 상대적입니다. 병합 요청의 프로젝트에서 가져올 경우, relative 및 short 형식은 동일합니다. 그룹이나 프로젝트를 횡단해서 요청할 경우, relative 및 full 형식은 동일합니다. |
[].reviewers |
배열 | 병합 요청의 리뷰어입니다. |
[].sha |
문자열 | 병합 요청의 Diff head SHA입니다. |
[].should_remove_source_branch |
불리언 | 이 병합 요청의 소스 브랜치를 병합 후 삭제해야 하는지를 나타냅니다. |
[].source_branch |
문자열 | 병합 요청의 소스 브랜치입니다. |
[].source_project_id |
정수 | 병합 요청 소스 프로젝트의 ID입니다. target_project_id 와 동일하며, 병합 요청이 포크에서 비롯된 경우를 제외합니다. |
[].squash |
불리언 |
true 이면 병합 시 모든 커밋을 하나의 커밋으로 압축합니다. 프로젝트 설정는 이 값을 무시할 수 있습니다. 프로젝트 압축 옵션을 고려할 경우 squash_on_merge 를 대신 사용하세요. |
[].squash_commit_sha |
문자열 | 압축 커밋의 SHA입니다. 병합될 때까지 비어 있습니다. |
[].squash_on_merge |
불리언 | 이 병합 요청이 병합될 때 압축될 것인지를 나타냅니다. |
[].state |
문자열 | 병합 요청의 상태입니다. opened , closed , merged , locked 중 하나일 수 있습니다. |
[].target_branch |
문자열 | 병합 요청의 대상 브랜치입니다. |
[].target_project_id |
정수 | 병합 요청 대상 프로젝트의 ID입니다. |
[].task_completion_status |
객체 | 작업의 완료 상태입니다. count 및 completed_count 를 포함합니다. |
[].time_stats |
객체 | 병합 요청의 시간 추적 통계입니다. time_estimate , total_time_spent , human_time_estimate , 및 human_total_time_spent 를 포함합니다. |
[].title |
문자열 | 병합 요청의 제목입니다. |
[].updated_at |
날짜시간 | 병합 요청이 업데이트된 시각의 타임스탬프입니다. |
[].upvotes |
정수 | 병합 요청에 대한 업보트 수입니다. |
[].user_notes_count |
정수 | 병합 요청의 사용자 노트 수입니다. |
[].web_url |
문자열 | 병합 요청의 웹 URL입니다. |
[].work_in_progress |
불리언 | Deprecated: 대신 draft 를 사용하세요. 병합 요청이 초안인지 여부를 나타냅니다. |
예제 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/merge_requests"
예제 응답:
[
{
"id": 1,
"iid": 1,
"project_id": 3,
"title": "test1",
"description": "로그인 페이지 CSS 패딩 수정",
"state": "merged",
"imported": false,
"imported_from": "none",
"merged_by": { // Deprecated 및 API v5에서 제거될 예정이므로 `merge_user`를 대신 사용하세요.
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"locked": false,
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merge_user": {
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"locked": false,
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"merge_after": "2018-09-07T11:16:00.000Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"created_at": "2017-04-29T08:46:00Z",
"updated_at": "2017-04-29T08:46:00Z",
"target_branch": "main",
"source_branch": "test1",
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 1,
"name": "관리자",
"username": "admin",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignee": {
"id": 1,
"name": "관리자",
"username": "admin",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignees": [{
"name": "미스 몬서라트 비에르",
"username": "axel.block",
"id": 12,
"state": "active",
"locked": false,
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"reviewers": [{
"id": 2,
"name": "샘 바우치",
"username": "kenyatta_oconnell",
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/956c92487c6f6f7616b536927e22c9a0?s=80&d=identicon",
"web_url": "http://gitlab.example.com//kenyatta_oconnell"
}],
"source_project_id": 2,
"target_project_id": 3,
"labels": [
"커뮤니티 기여",
"관리"
],
"draft": false,
"work_in_progress": false,
"milestone": {
"id": 5,
"iid": 1,
"project_id": 3,
"title": "v2.0",
"description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
"state": "closed",
"created_at": "2015-02-02T19:49:26.013Z",
"updated_at": "2015-02-02T19:49:26.013Z",
"due_date": "2018-09-22",
"start_date": "2018-08-08",
"web_url": "https://gitlab.example.com/my-group/my-project/milestones/1"
},
"merge_when_pipeline_succeeds": true,
"merge_status": "can_be_merged",
"detailed_merge_status": "not_open",
"sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null,
"squash_commit_sha": null,
"user_notes_count": 1,
"discussion_locked": null,
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"reference": "!1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"squash_on_merge": false,
"task_completion_status":{
"count":0,
"completed_count":0
},
"has_conflicts": false,
"blocking_discussions_resolved": true,
"approvals_before_merge": 2
}
]
응답 데이터에 대한 중요 메모는 병합 요청 목록 응답 노트를 참조하세요.
그룹 병합 요청 목록
이 그룹과 하위 그룹의 모든 병합 요청을 가져옵니다.
GET /groups/:id/merge_requests
GET /groups/:id/merge_requests?state=opened
GET /groups/:id/merge_requests?state=all
GET /groups/:id/merge_requests?milestone=release
GET /groups/:id/merge_requests?labels=bug,reproduced
GET /groups/:id/merge_requests?my_reaction_emoji=star
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 그룹의 ID 또는 URL로 인코딩된 경로. |
approved_by_ids |
정수 배열 | 아니오 | 주어진 id 를 가진 모든 사용자가 승인한 병합 요청을 반환합니다(최대 5명). None 은 승인 없는 병합 요청을 반환합니다. Any 는 승인이 있는 병합 요청을 반환합니다. Premium 및 Ultimate 전용. |
approved_by_usernames |
문자열 배열 | 아니오 | 주어진 username 을 가진 모든 사용자가 승인한 병합 요청을 반환합니다(최대 5명). None 은 승인 없는 병합 요청을 반환합니다. Any 는 승인이 있는 병합 요청을 반환합니다. Premium 및 Ultimate 전용. |
approver_ids |
정수 배열 | 아니오 | 주어진 id 를 가진 모든 사용자를 개별 승인자로 지정한 병합 요청을 반환합니다. None 은 승인자가 없는 병합 요청을 반환합니다. Any 는 승인자가 있는 병합 요청을 반환합니다. Premium 및 Ultimate 전용. |
approved |
문자열 | 아니오 |
approved 상태에 따라 병합 요청을 필터링합니다. yes 는 승인된 병합 요청만 반환합니다. no 는 승인되지 않은 병합 요청만 반환합니다. 도입됨 GitLab 15.11에서만 사용 가능하며, mr_approved_filter 기능 플래그가 활성화되어야 합니다. |
assignee_id |
정수 | 아니오 | 주어진 사용자 id 에 할당된 병합 요청을 반환합니다. None 은 할당되지 않은 병합 요청을 반환합니다. Any 는 할당자가 있는 병합 요청을 반환합니다. |
author_id |
정수 | 아니오 | 주어진 사용자 id 가 작성한 병합 요청을 반환합니다. author_username 와 상호 배타적입니다. |
author_username |
문자열 | 아니오 | 주어진 username 이 작성한 병합 요청을 반환합니다. author_id 와 상호 배타적입니다. |
created_after |
날짜 및 시간 | 아니오 | 주어진 시간 이후에 생성된 병합 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
created_before |
날짜 및 시간 | 아니오 | 주어진 시간 이전에 생성된 병합 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
labels |
문자열 | 아니오 | 쉼표로 구분된 레이블 목록과 일치하는 병합 요청을 반환합니다. None 은 라벨이 없는 모든 병합 요청을 나열합니다. Any 는 적어도 하나의 라벨이 있는 모든 병합 요청을 나열합니다. 미리 정의된 이름은 대소문자를 구분하지 않습니다. |
merge_user_id |
정수 | 아니오 | 주어진 사용자 id 로 병합된 병합 요청을 반환합니다. merge_user_username 와 상호 배타적입니다. 도입됨 GitLab 17.0에서. |
merge_user_username |
문자열 | 아니오 | 주어진 username 으로 병합된 병합 요청을 반환합니다. merge_user_id 와 상호 배타적입니다. 도입됨 GitLab 17.0에서. |
milestone |
문자열 | 아니오 | 특정 마일스톤의 병합 요청을 반환합니다. None 은 마일스톤이 없는 병합 요청을 반환합니다. Any 는 할당된 마일스톤이 있는 병합 요청을 반환합니다. |
my_reaction_emoji |
문자열 | 아니오 | 인증된 사용자가 주어진 emoji 에 반응한 병합 요청을 반환합니다. None 은 반응이 없는 문제를 반환합니다. Any 는 적어도 하나의 반응이 있는 문제를 반환합니다. |
non_archived |
불리언 | 아니오 | 비보관 프로젝트의 병합 요청만 반환합니다. 기본값은 true 입니다. |
not |
해시 | 아니오 | 제공된 매개변수와 일치하지 않는 병합 요청을 반환합니다. 허용: labels , milestone , author_id , author_username , assignee_id , assignee_username , reviewer_id , reviewer_username , my_reaction_emoji . |
order_by |
문자열 | 아니오 |
created_at , title 또는 updated_at 필드로 정렬된 병합 요청을 반환합니다. 기본값은 created_at 입니다. |
reviewer_id |
정수 | 아니오 | 주어진 사용자 id 가 리뷰어인 병합 요청을 반환합니다. None 은 리뷰어가 없는 병합 요청을 반환합니다. Any 는 리뷰어가 있는 병합 요청을 반환합니다. reviewer_username 와 상호 배타적입니다. |
reviewer_username |
문자열 | 아니오 | 주어진 username 이 리뷰어인 병합 요청을 반환합니다. None 은 리뷰어가 없는 병합 요청을 반환합니다. Any 는 리뷰어가 있는 병합 요청을 반환합니다. reviewer_id 와 상호 배타적입니다. |
scope |
문자열 | 아니오 | 주어진 범위에 대한 병합 요청을 반환합니다: created_by_me , assigned_to_me 또는 all . |
search |
문자열 | 아니오 |
title 및 description 에 대한 병합 요청을 검색합니다. |
source_branch |
문자열 | 아니오 | 주어진 소스 브랜치가 있는 병합 요청을 반환합니다. |
sort |
문자열 | 아니오 |
asc 또는 desc 순서로 정렬된 병합 요청을 반환합니다. 기본값은 desc 입니다. |
state |
문자열 | 아니오 | 모든 병합 요청(all ) 또는 opened , closed , locked 또는 merged 된 요청만 반환합니다. |
target_branch |
문자열 | 아니오 | 주어진 대상 브랜치가 있는 병합 요청을 반환합니다. |
updated_after |
날짜 및 시간 | 아니오 | 주어진 시간 이후에 업데이트된 병합 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
updated_before |
날짜 및 시간 | 아니오 | 주어진 시간 이전에 업데이트된 병합 요청을 반환합니다. ISO 8601 형식(2019-03-15T08:00:00Z )으로 예상됩니다. |
view |
문자열 | 아니오 |
simple 일 경우, 병합 요청의 iid , URL, 제목, 설명 및 기본 상태를 반환합니다. |
with_labels_details |
불리언 | 아니오 |
true 일 경우, 응답은 레이블 필드의 각 레이블에 대한 더 많은 세부 정보를 반환합니다: :name , :color , :description , :description_html , :text_color . 기본값은 false 입니다. |
with_merge_status_recheck |
불리언 | 아니오 |
true 일 경우, 이 투영 요청은 merge_status 필드의 비동기 재계산을 요청합니다(보장하지는 않습니다). 기본값은 false 입니다. GitLab 15.11 이상에서 사용자는 최소한 Developer 역할이 없을 경우 이 속성이 요청되었을 때 무시하도록 restrict_merge_status_recheck 기능 플래그를 활성화해야 합니다. |
병합 요청 목록을 제한하려면 page
및 per_page
페이지 매개변수를 사용하세요.
응답에서 group_id
는 병합 요청이 포함된 프로젝트의 그룹 ID를 나타냅니다.
예시 응답:
[
{
"id": 1,
"iid": 1,
"project_id": 3,
"title": "test1",
"description": "로그인 페이지 CSS 패딩 수정",
"state": "merged",
"imported": false,
"imported_from": "none",
"merged_by": { // 사용되지 않으며 API v5에서 제거될 예정입니다. 대신 `merge_user`를 사용하세요.
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merge_user": {
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"merge_after": "2018-09-07T11:16:00.000Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"created_at": "2017-04-29T08:46:00Z",
"updated_at": "2017-04-29T08:46:00Z",
"target_branch": "main",
"source_branch": "test1",
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 1,
"name": "Administrator",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignee": {
"id": 1,
"name": "Administrator",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignees": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"reviewers": [{
"id": 2,
"name": "Sam Bauch",
"username": "kenyatta_oconnell",
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/956c92487c6f6f7616b536927e22c9a0?s=80&d=identicon",
"web_url": "http://gitlab.example.com//kenyatta_oconnell"
}],
"source_project_id": 2,
"target_project_id": 3,
"labels": [
"Community contribution",
"Manage"
],
"draft": false,
"work_in_progress": false,
"milestone": {
"id": 5,
"iid": 1,
"project_id": 3,
"title": "v2.0",
"description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
"state": "closed",
"created_at": "2015-02-02T19:49:26.013Z",
"updated_at": "2015-02-02T19:49:26.013Z",
"due_date": "2018-10-22",
"start_date": "2018-09-08",
"web_url": "gitlab.example.com/my-group/my-project/milestones/1"
},
"merge_when_pipeline_succeeds": true,
"merge_status": "can_be_merged",
"detailed_merge_status": "not_open",
"sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null,
"squash_commit_sha": null,
"user_notes_count": 1,
"discussion_locked": null,
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "my-project!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"task_completion_status": {
"count": 0,
"completed_count": 0
},
"has_conflicts": false,
"blocking_discussions_resolved": true
}
]
응답 데이터에 대한 중요한 주의 사항은 병합 요청 목록 응답 주의 사항을 참조하세요.
단일 MR 가져오기
단일 병합 요청에 대한 정보를 표시합니다.
GET /projects/:id/merge_requests/:merge_request_iid
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
integer or string | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
merge_request_iid |
integer | 예 | 병합 요청의 내부 ID. |
include_diverged_commits_count |
boolean | 아니오 |
true 인 경우, 응답에 대상 브랜치 뒤의 커밋이 포함됩니다. |
include_rebase_in_progress |
boolean | 아니오 |
true 인 경우, 응답에 리베이스 작업이 진행 중인지 여부가 포함됩니다. |
render_html |
boolean | 아니오 |
true 인 경우, 응답에 제목과 설명의 렌더링된 HTML이 포함됩니다. |
응답
속성 | 유형 | 설명 |
---|---|---|
approvals_before_merge |
integer | 이 병합 요청이 병합되기 전에 필요한 승인 수. 승인 규칙을 구성하려면 병합 요청 승인 API를 참조하세요. Deprecated in GitLab 16.0. Premium과 Ultimate 전용. |
assignee |
object | 병합 요청의 첫 번째 담당자. |
assignees |
array | 병합 요청의 담당자. |
author |
object | 이 병합 요청을 생성한 사용자. |
blocking_discussions_resolved |
boolean | 모든 논의가 병합 요청이 병합되기 전에 요구되는 모든 논의가 해결되었는지를 나타냅니다. |
changes_count |
string | 병합 요청에서 수행된 변경 수. 병합 요청이 생성될 때 비어 있으며 비동기적으로 채워집니다. 문자열이며 정수가 아닙니다. 병합 요청에 표시하고 저장하기에 너무 많은 변경 사항이 있는 경우, 값은 1000으로 제한되며 문자열 "1000+" 이 반환됩니다. 새 병합 요청에 대한 빈 API 필드를 참조하십시오. |
closed_at |
datetime | 병합 요청이 닫힌 시간의 타임스탬프. |
closed_by |
object | 이 병합 요청을 닫은 사용자. |
created_at |
datetime | 병합 요청이 생성된 시간의 타임스탬프. |
description |
string | 병합 요청의 설명. HTML로 렌더링된 Markdown을 포함합니다. |
detailed_merge_status |
string | 병합 요청의 상세 병합 상태. 가능한 값 목록은 병합 상태를 참조하세요. |
diff_refs |
object | 이 병합 요청의 기본 SHA, 헤드 SHA 및 시작 SHA의 참조. 병합 요청의 최신 diff 버전과 일치합니다. 병합 요청이 생성될 때 비어 있으며 비동기적으로 채워집니다. 새 병합 요청에 대한 빈 API 필드를 참조하십시오. |
discussion_locked |
boolean | 병합 요청의 댓글이 멤버 전용으로 잠겨 있는지 여부를 나타냅니다. |
downvotes |
integer | 병합 요청에 대한 다운투표 수. |
draft |
boolean | 병합 요청이 초안인지 여부를 나타냅니다. |
first_contribution |
boolean | 병합 요청이 작성자의 첫 번째 기여인지 여부를 나타냅니다. |
first_deployed_to_production_at |
datetime | 첫 번째 배포가 끝난 시간의 타임스탬프. |
force_remove_source_branch |
boolean | 병합 후 프로젝트 설정이 소스 브랜치 삭제를 유도하는지 여부를 나타냅니다. |
has_conflicts |
boolean | 병합 요청에 충돌이 있는지 여부와 병합할 수 없는지 여부를 나타냅니다. merge_status 속성에 따라 다릅니다. merge_status 가 cannot_be_merged 가 아닌 한 false 를 반환합니다. |
head_pipeline |
object | 병합 요청의 브랜치 HEAD에서 실행 중인 파이프라인. pipeline 대신 사용하세요. 더 완전한 정보를 포함합니다. |
id |
integer | 병합 요청의 ID. |
iid |
integer | 병합 요청의 내부 ID. |
labels |
array | 병합 요청의 레이블. |
latest_build_finished_at |
datetime | 병합 요청에 대한 최신 빌드가 완료된 시간의 타임스탬프. |
latest_build_started_at |
datetime | 병합 요청에 대한 최신 빌드가 시작된 시간의 타임스탬프. |
merge_commit_sha |
string | 병합 요청 커밋의 SHA. 병합될 때까지 null 을 반환합니다. |
merge_error |
string | 병합이 실패했을 때 표시되는 오류 메시지. 병합 가능성을 확인하려면 대신 detailed_merge_status 를 사용하세요. |
merge_user |
object | 이 병합 요청을 병합한 사용자, 자동 병합으로 설정한 사용자 또는 null . |
merge_status |
string | 병합 요청의 상태. unchecked , checking , can_be_merged , cannot_be_merged , cannot_be_merged_recheck 중 하나일 수 있습니다. has_conflicts 속성에 영향을 미칩니다. 응답 데이터에 대한 중요한 메모는 단일 병합 요청 응답 메모를 참조하세요. Deprecated in GitLab 15.6. 대신 detailed_merge_status 를 사용하세요. |
merge_when_pipeline_succeeds |
boolean | 파이프라인이 성공할 때 병합되도록 설정되어 있는지를 나타냅니다. |
merged_at |
datetime | 병합 요청이 병합된 시간의 타임스탬프. |
merged_by |
object | 이 병합 요청을 병합한 사용자 또는 자동 병합으로 설정한 사용자. Deprecated in GitLab 14.7, 그리고 API 버전 5에서 제거될 예정입니다. 대신 merge_user 를 사용하세요. |
milestone |
object | 병합 요청의 이정표. |
pipeline |
object | 병합 요청의 브랜치 HEAD에서 실행 중인 파이프라인. 더 많은 정보가 포함되어 있으므로 대신 head_pipeline 을 사용하세요. |
prepared_at |
datetime | 병합 요청이 준비된 시간의 타임스탬프. 이 필드는 모든 준비 단계가 완료된 후 한 번만 채워지며, 추가 변경 사항이 추가되면 업데이트되지 않습니다. |
project_id |
integer | 병합 요청 프로젝트의 ID. |
reference |
string | 병합 요청의 내부 참조. 기본적으로 단축 형식으로 반환됩니다. Deprecated in GitLab 12.7, 그리고 API 버전 5에서 제거될 예정입니다. 대신 references 를 사용하세요. |
references |
object | 병합 요청의 내부 참조. short , relative , full 참조를 포함합니다. references.relative 는 병합 요청의 그룹 또는 프로젝트에 상대적입니다. 병합 요청의 프로젝트에서 가져올 때 relative 와 short 형식은 동일합니다. 그룹이나 프로젝트 간에 요청할 때 relative 와 full 형식은 동일합니다. |
reviewers |
array | 병합 요청의 리뷰어. |
sha |
string | 병합 요청의 diff head SHA. |
should_remove_source_branch |
boolean | 병합 후 병합 요청의 소스 브랜치를 삭제해야 하는지 여부를 나타냅니다. |
source_branch |
string | 병합 요청의 소스 브랜치. |
source_project_id |
integer | 병합 요청 소스 프로젝트의 ID. |
squash |
boolean | 병합 시 squash가 활성화되어 있는지 여부를 나타냅니다. |
squash_commit_sha |
string | squash 커밋의 SHA. 병합될 때까지 비어 있습니다. |
state |
string | 병합 요청의 상태. opened , closed , merged 또는 locked 중 하나일 수 있습니다. |
subscribed |
boolean | 현재 인증된 사용자가 이 병합 요청을 구독하는지 여부를 나타냅니다. |
target_branch |
string | 병합 요청의 대상 브랜치. |
target_project_id |
integer | 병합 요청 대상 프로젝트의 ID. |
task_completion_status |
object | 작업의 완료 상태. |
title |
string | 병합 요청의 제목. |
updated_at |
datetime | 병합 요청이 업데이트된 시간의 타임스탬프. |
upvotes |
integer | 병합 요청에 대한 업투표 수. |
user |
object | 병합 요청에 요청된 사용자 권한. |
user_notes_count |
integer | 병합 요청의 사용자 노트 수. |
web_url |
string | 병합 요청의 웹 URL. |
work_in_progress |
boolean | Deprecated: 대신 draft 를 사용하세요. 병합 요청이 초안인지 여부를 나타냅니다. |
예시 응답:
{
"id": 155016530,
"iid": 133,
"project_id": 15513260,
"title": "수동 작업 규칙",
"description": "",
"state": "opened",
"imported": false,
"imported_from": "none",
"created_at": "2022-05-13T07:26:38.402Z",
"updated_at": "2022-05-14T03:38:31.354Z",
"merged_by": null, // Deprecated and will be removed in API v5. Use `merge_user` instead.
"merge_user": null,
"merged_at": null,
"merge_after": "2018-09-07T11:16:00.000Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"target_branch": "main",
"source_branch": "manual-job-rules",
"user_notes_count": 0,
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 4155490,
"username": "marcel.amirault",
"name": "Marcel Amirault",
"state": "active",
"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/4155490/avatar.png",
"web_url": "https://gitlab.com/marcel.amirault"
},
"assignees": [],
"assignee": null,
"reviewers": [],
"source_project_id": 15513260,
"target_project_id": 15513260,
"labels": [],
"draft": false,
"work_in_progress": false,
"milestone": null,
"merge_when_pipeline_succeeds": false,
"merge_status": "can_be_merged",
"detailed_merge_status": "can_be_merged",
"sha": "e82eb4a098e32c796079ca3915e07487fc4db24c",
"merge_commit_sha": null,
"squash_commit_sha": null,
"discussion_locked": null,
"should_remove_source_branch": null,
"force_remove_source_branch": true,
"reference": "!133", // Deprecated. Use `references` instead.
"references": {
"short": "!133",
"relative": "!133",
"full": "marcel.amirault/test-project!133"
},
"web_url": "https://gitlab.com/marcel.amirault/test-project/-/merge_requests/133",
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"task_completion_status": {
"count": 0,
"completed_count": 0
},
"has_conflicts": false,
"blocking_discussions_resolved": true,
"approvals_before_merge": null, // deprecated, use [Merge request approvals API](merge_request_approvals.md)
"subscribed": true,
"changes_count": "1",
"latest_build_started_at": "2022-05-13T09:46:50.032Z",
"latest_build_finished_at": null,
"first_deployed_to_production_at": null,
"pipeline": { // Use `head_pipeline` instead.
"id": 538317940,
"iid": 1877,
"project_id": 15513260,
"sha": "1604b0c46c395822e4e9478777f8e54ac99fe5b9",
"ref": "refs/merge-requests/133/merge",
"status": "failed",
"source": "merge_request_event",
"created_at": "2022-05-13T09:46:39.560Z",
"updated_at": "2022-05-13T09:47:20.706Z",
"web_url": "https://gitlab.com/marcel.amirault/test-project/-/pipelines/538317940"
},
"head_pipeline": {
"id": 538317940,
"iid": 1877,
"project_id": 15513260,
"sha": "1604b0c46c395822e4e9478777f8e54ac99fe5b9",
"ref": "refs/merge-requests/133/merge",
"status": "failed",
"source": "merge_request_event",
"created_at": "2022-05-13T09:46:39.560Z",
"updated_at": "2022-05-13T09:47:20.706Z",
"web_url": "https://gitlab.com/marcel.amirault/test-project/-/pipelines/538317940",
"before_sha": "1604b0c46c395822e4e9478777f8e54ac99fe5b9",
"tag": false,
"yaml_errors": null,
"user": {
"id": 4155490,
"username": "marcel.amirault",
"name": "Marcel Amirault",
"state": "active",
"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/4155490/avatar.png",
"web_url": "https://gitlab.com/marcel.amirault"
},
"started_at": "2022-05-13T09:46:50.032Z",
"finished_at": "2022-05-13T09:47:20.697Z",
"committed_at": null,
"duration": 30,
"queued_duration": 10,
"coverage": null,
"detailed_status": {
"icon": "status_failed",
"text": "실패",
"label": "실패",
"group": "실패",
"tooltip": "실패",
"has_details": true,
"details_path": "/marcel.amirault/test-project/-/pipelines/538317940",
"illustration": null,
"favicon": "/assets/ci_favicons/favicon_status_failed-41304d7f7e3828808b0c26771f0309e55296819a9beea3ea9fbf6689d9857c12.png"
}
},
"diff_refs": {
"base_sha": "1162f719d711319a2efb2a35566f3bfdadee8bab",
"head_sha": "e82eb4a098e32c796079ca3915e07487fc4db24c",
"start_sha": "1162f719d711319a2efb2a35566f3bfdadee8bab"
},
"merge_error": null,
"first_contribution": false,
"user": {
"can_merge": true
},
"approvals_before_merge": { // Available for GitLab Premium and Ultimate tiers only
"id": 1,
"title": "test1",
"approvals_before_merge": null
},
}
단일 병합 요청 응답 노트
병합 가능성(merge_status
)은 이 엔드포인트에 요청이 들어올 때 비동기적으로 확인됩니다. 업데이트된 상태를 얻으려면 이 API 엔드포인트를 폴링하세요. 이는 merge_status
에 따라 달라지므로 has_conflicts
속성에 영향을 미칩니다. merge_status
가 cannot_be_merged
가 아닌 경우, false
를 반환합니다.
병합 상태
merge_status
는 GitLab 15.6에서 더 이상 사용되지 않음으로 표시됩니다.detailed_merge_status
는 GitLab 15.6에서 도입됨으로 표시됩니다.
모든 잠재적 상태를 고려하기 위해 merge_status
대신 detailed_merge_status
를 사용하세요.
-
detailed_merge_status
필드는 병합 요청과 관련하여 다음 값 중 하나를 포함할 수 있습니다:-
approvals_syncing
: 병합 요청의 승인이 동기화되고 있습니다. -
checking
: Git이 유효한 병합이 가능한지 테스트하고 있습니다. -
ci_must_pass
: 병합 전에 CI/CD 파이프라인이 성공해야 합니다. -
ci_still_running
: CI/CD 파이프라인이 여전히 실행되고 있습니다. -
commits_status
: 소스 브랜치가 존재해야 하며, 커밋을 포함해야 합니다. -
conflict
: 소스 브랜치와 대상 브랜치 간의 충돌이 존재합니다. -
discussions_not_resolved
: 병합 전에 모든 논의가 해결되어야 합니다. -
draft_status
: 병합 요청이 초안이므로 병합할 수 없습니다. -
jira_association_missing
: 제목 또는 설명이 Jira 이슈를 참조해야 합니다. 구성하려면 병합 요청이 병합되기 위해 관련 Jira 이슈 요구하기를 참조하세요. -
mergeable
: 브랜치가 대상 브랜치와 깔끔하게 병합할 수 있습니다. -
merge_request_blocked
: 다른 병합 요청에 의해 차단되었습니다. -
merge_time
: 지정된 시간 이후까지 병합할 수 없습니다. -
need_rebase
: 병합 요청은 리베이스해야 합니다. -
not_approved
: 병합 전에 승인이 필요합니다. -
not_open
: 병합 전에 병합 요청이 열려 있어야 합니다. -
preparing
: 병합 요청 diff가 생성되고 있습니다. -
requested_changes
: 변경 요청이 있는 검토자가 있는 병합 요청입니다. -
security_policy_evaluation
: 모든 보안 정책이 평가되어야 합니다.policy_mergability_check
기능 플래그가 활성화되어야 합니다. -
security_policy_violations
: 모든 보안 정책이 충족되어야 합니다.policy_mergability_check
기능 플래그가 활성화되어야 합니다. -
status_checks_must_pass
: 병합 전에 모든 상태 체크가 통과해야 합니다. -
unchecked
: Git이 아직 유효한 병합이 가능한지 테스트하지 않았습니다. -
locked_paths
: 다른 사용자가 잠근 경로는 기본 브랜치로 병합하기 전에 잠금을 해제해야 합니다. -
locked_lfs_files
: 다른 사용자가 잠근 LFS 파일은 병합하기 전에 잠금을 해제해야 합니다.
-
준비 단계
prepared_at
필드는 이 단계가 완료된 후 한 번만 채워집니다:
- diff 생성.
- 파이프라인 생성.
- 병합 가능성 확인.
- 모든 Git LFS 객체 링크.
- 알림 전송.
변경 사항이 병합 요청에 추가되면 prepared_at
필드는 업데이트되지 않습니다.
단일 병합 요청 참가자 가져오기
병합 요청 참가자 목록을 가져옵니다.
GET /projects/:id/merge_requests/:merge_request_iid/participants
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID입니다. |
예시 응답:
[
{
"id": 1,
"name": "John Doe1",
"username": "user1",
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/c922747a93b40d1ea88262bf1aebee62?s=80&d=identicon",
"web_url": "http://localhost/user1"
},
{
"id": 2,
"name": "John Doe2",
"username": "user2",
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/10fc7f102be8de7657fb4d80898bbfe3?s=80&d=identicon",
"web_url": "http://localhost/user2"
}
]
단일 병합 요청 검토자 가져오기
병합 요청 검토자 목록을 가져옵니다.
GET /projects/:id/merge_requests/:merge_request_iid/reviewers
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID입니다. |
예시 응답:
[
{
"user": {
"id": 1,
"name": "John Doe1",
"username": "user1",
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/c922747a93b40d1ea88262bf1aebee62?s=80&d=identicon",
"web_url": "http://localhost/user1"
},
"state": "unreviewed",
"created_at": "2022-07-27T17:03:27.684Z"
},
{
"user": {
"id": 2,
"name": "John Doe2",
"username": "user2",
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/10fc7f102be8de7657fb4d80898bbfe3?s=80&d=identicon",
"web_url": "http://localhost/user2"
},
"state": "reviewed",
"created_at": "2022-07-27T17:03:27.684Z"
}
]
단일 병합 요청 커밋 가져오기
병합 요청 커밋 목록을 가져옵니다.
GET /projects/:id/merge_requests/:merge_request_iid/commits
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID입니다. |
성공하면 200 OK
를 반환하며 다음 응답 속성이 포함됩니다:
속성 | 유형 | 설명 |
---|---|---|
commits |
객체 배열 | 병합 요청의 커밋. |
commits[].id |
문자열 | 커밋의 ID. |
commits[].short_id |
문자열 | 커밋의 짧은 ID. |
commits[].created_at |
datetime |
committed_date 필드와 동일합니다. |
commits[].parent_ids |
배열 | 부모 커밋의 ID. |
commits[].title |
문자열 | 커밋 제목. |
commits[].message |
문자열 | 커밋 메시지. |
commits[].author_name |
문자열 | 커밋 작성자 이름. |
commits[].author_email |
문자열 | 커밋 작성자 이메일 주소. |
commits[].authored_date |
datetime | 커밋 작성 날짜. |
commits[].committer_name |
문자열 | 커밋터의 이름. |
commits[].committer_email |
문자열 | 커밋터의 이메일 주소. |
commits[].committed_date |
datetime | 커밋 날짜. |
commits[].trailers |
객체 | 커밋에 대해 분석된 Git 트레일러. 중복 키는 마지막 값만 포함됩니다. |
commits[].extended_trailers |
객체 | 커밋에 대해 분석된 Git 트레일러. |
commits[].web_url |
문자열 | 병합 요청의 웹 URL. |
예시 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/merge_requests/1/commits"
예시 응답:
[
{
"id": "ed899a2f4b50b4370feeea94676502b42383c746",
"short_id": "ed899a2f4b5",
"title": "Replace sanitize with escape once",
"author_name": "Example User",
"author_email": "user@example.com",
"authored_date": "2012-09-20T11:50:22+03:00",
"committer_name": "Example User",
"committer_email": "user@example.com",
"committed_date": "2012-09-20T11:50:22+03:00",
"created_at": "2012-09-20T11:50:22+03:00",
"message": "Replace sanitize with escape once",
"trailers": {},
"extended_trailers": {},
"web_url": "https://gitlab.example.com/project/-/commit/ed899a2f4b50b4370feeea94676502b42383c746"
},
{
"id": "6104942438c14ec7bd21c6cd5bd995272b3faff6",
"short_id": "6104942438c",
"title": "Sanitize for network graph",
"author_name": "Example User",
"author_email": "user@example.com",
"authored_date": "2012-09-20T09:06:12+03:00",
"committer_name": "Example User",
"committer_email": "user@example.com",
"committed_date": "2012-09-20T09:06:12+03:00",
"created_at": "2012-09-20T09:06:12+03:00",
"message": "Sanitize for network graph",
"trailers": {},
"extended_trailers": {},
"web_url": "https://gitlab.example.com/project/-/commit/6104942438c14ec7bd21c6cd5bd995272b3faff6"
}
]
병합 요청 의존성 가져오기
병합하기 전에 해결해야 하는 병합 요청 의존성에 대한 정보를 표시합니다.
GET /projects/:id/merge_requests/:merge_request_iid/blocks
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로입니다. |
예제 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/merge_requests/1/blocks"
예제 응답:
[
{
"id": 1,
"blocking_merge_request": {
"id": 145,
"iid": 12,
"project_id": 7,
"title": "흥미로운 MR",
"description": "흥미로운 일을 합니다.",
"state": "opened",
"created_at": "2024-07-05T21:29:11.172Z",
"updated_at": "2024-07-05T21:29:11.172Z",
"merged_by": null,
"merge_user": null,
"merged_at": null,
"merge_after": "2018-09-07T11:16:00.000Z",
"closed_by": null,
"closed_at": null,
"target_branch": "master",
"source_branch": "v2.x",
"user_notes_count": 0,
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 2,
"username": "aiguy123",
"name": "AI GUY",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/aiguy123"
},
"assignees": [
{
"id": 2,
"username": "aiguy123",
"name": "AI GUY",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/aiguy123"
}
],
"assignee": {
"id": 2,
"username": "aiguy123",
"name": "AI GUY",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/aiguy123"
},
"reviewers": [
{
"id": 2,
"username": "aiguy123",
"name": "AI GUY",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/aiguy123"
},
{
"id": 1,
"username": "root",
"name": "관리자",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/root"
}
],
"source_project_id": 7,
"target_project_id": 7,
"labels": [],
"draft": false,
"imported": false,
"imported_from": "none",
"work_in_progress": false,
"milestone": null,
"merge_when_pipeline_succeeds": false,
"merge_status": "unchecked",
"detailed_merge_status": "unchecked",
"sha": "ce7e4f2d0ce13cb07479bb39dc10ee3b861c08a6",
"merge_commit_sha": null,
"squash_commit_sha": null,
"discussion_locked": null,
"should_remove_source_branch": null,
"force_remove_source_branch": true,
"prepared_at": null,
"reference": "!12",
"references": {
"short": "!12",
"relative": "!12",
"full": "my-group/my-project!12"
},
"web_url": "https://localhost/my-group/my-project/-/merge_requests/12",
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"squash_on_merge": false,
"task_completion_status": {
"count": 0,
"completed_count": 0
},
"has_conflicts": false,
"blocking_discussions_resolved": true,
"approvals_before_merge": null
},
"blocked_merge_request": {
"id": 146,
"iid": 13,
"project_id": 7,
"title": "정말 멋진 MR",
"description": "몇 가지 내용을 추가합니다.",
"state": "opened",
"created_at": "2024-07-05T21:31:34.811Z",
"updated_at": "2024-07-27T02:57:08.054Z",
"merged_by": null,
"merge_user": null,
"merged_at": null,
"merge_after": "2018-09-07T11:16:00.000Z",
"closed_by": null,
"closed_at": null,
"target_branch": "master",
"source_branch": "remove-from",
"user_notes_count": 0,
"upvotes": 1,
"downvotes": 0,
"author": {
"id": 2,
"username": "aiguy123",
"name": "AI GUY",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/aiguy123"
},
"assignees": [
{
"id": 2,
"username": "aiguy123",
"name": "AI GUY",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhose/aiguy123"
}
],
"assignee": {
"id": 2,
"username": "aiguy123",
"name": "AI GUY",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/aiguy123"
},
"reviewers": [
{
"id": 1,
"username": "root",
"name": "관리자",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/root"
}
],
"source_project_id": 7,
"target_project_id": 7,
"labels": [],
"draft": false,
"imported": false,
"imported_from": "none",
"work_in_progress": false,
"milestone": {
"id": 59,
"iid": 6,
"project_id": 7,
"title": "스프린트 1718897375",
"description": "Accusantium omnis iusto a animi.",
"state": "active",
"created_at": "2024-06-20T15:29:35.739Z",
"updated_at": "2024-06-20T15:29:35.739Z",
"due_date": null,
"start_date": null,
"expired": false,
"web_url": "https://localhost/my-group/my-project/-/milestones/6"
},
"merge_when_pipeline_succeeds": false,
"merge_status": "cannot_be_merged",
"detailed_merge_status": "not_approved",
"sha": "daa75b9b17918f51f43866ff533987fda71375ea",
"merge_commit_sha": null,
"squash_commit_sha": null,
"discussion_locked": null,
"should_remove_source_branch": null,
"force_remove_source_branch": true,
"prepared_at": "2024-07-11T18:50:46.215Z",
"reference": "!13",
"references": {
"short": "!13",
"relative": "!13",
"full": "my-group/my-project!12"
},
"web_url": "https://localhost/my-group/my-project/-/merge_requests/13",
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"squash_on_merge": false,
"task_completion_status": {
"count": 0,
"completed_count": 0
},
"has_conflicts": true,
"blocking_discussions_resolved": true,
"approvals_before_merge": null
},
"project_id": 7
}
]
병합 요청 종속성 삭제
병합 요청 종속성을 삭제합니다.
DELETE /projects/:id/merge_requests/:merge_request_iid/blocks/:block_id
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 인증된 사용자가 소유한 프로젝트의 ID 또는 URL 인코딩 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID. |
block_id |
정수 | 예 | 블록의 내부 ID. |
예제 요청:
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/merge_requests/1/blocks/1"
반환:
- 종속성이 성공적으로 삭제되면
204 No Content
. - 병합 요청을 업데이트할 권한이 없는 경우
403 Forbidden
. - 차단된 병합 요청을 읽을 권한이 없는 경우
403 Forbidden
.
병합 요청 종속성 생성
병합 요청 종속성을 생성합니다.
POST /projects/:id/merge_requests/:merge_request_iid/blocks
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 인증된 사용자가 소유한 프로젝트의 ID 또는 URL 인코딩 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID. |
blocking_merge_request_id |
정수 | 예 | 차단된 병합 요청의 내부 ID. |
예제 요청:
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/merge_requests/1/blocks?blocking_merge_request_id=2"
반환:
- 종속성이 성공적으로 생성되면
201 Created
. - 차단된 병합 요청 저장에 실패한 경우
400 Bad request
. - 차단된 병합 요청을 읽을 권한이 없는 경우
403 Forbidden
. - 차단된 병합 요청을 찾을 수 없는 경우
404 Not found
. - 블록이 이미 존재하는 경우
409 Conflict
.
예제 응답:
[
{
"id": 1,
"blocking_merge_request": {
"id": 145,
"iid": 12,
"project_id": 7,
"title": "Interesting MR",
"description": "Does interesting things.",
"state": "opened",
"created_at": "2024-07-05T21:29:11.172Z",
"updated_at": "2024-07-05T21:29:11.172Z",
"merged_by": null,
"merge_user": null,
"merged_at": null,
"merge_after": "2018-09-07T11:16:00.000Z",
"closed_by": null,
"closed_at": null,
"target_branch": "master",
"source_branch": "v2.x",
"user_notes_count": 0,
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 2,
"username": "aiguy123",
"name": "AI GUY",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/aiguy123"
},
"assignees": [
{
"id": 2,
"username": "aiguy123",
"name": "AI GUY",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/aiguy123"
}
],
"assignee": {
"id": 2,
"username": "aiguy123",
"name": "AI GUY",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/aiguy123"
},
"reviewers": [
{
"id": 2,
"username": "aiguy123",
"name": "AI GUY",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/aiguy123"
},
{
"id": 1,
"username": "root",
"name": "Administrator",
"state": "active",
"locked": false,
"avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
"web_url": "https://localhost/root"
}
],
"source_project_id": 7,
"target_project_id": 7,
"labels": [],
"draft": false,
"imported": false,
"imported_from": "none",
"work_in_progress": false,
"milestone": null,
"merge_when_pipeline_succeeds": false,
"merge_status": "unchecked",
"detailed_merge_status": "unchecked",
"sha": "ce7e4f2d0ce13cb07479bb39dc10ee3b861c08a6",
"merge_commit_sha": null,
"squash_commit_sha": null,
"discussion_locked": null,
"should_remove_source_branch": null,
"force_remove_source_branch": true,
"prepared_at": null,
"reference": "!12",
"references": {
"short": "!12",
"relative": "!12",
"full": "my-group/my-project!12"
},
"web_url": "https://localhost/my-group/my-project/-/merge_requests/12",
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"squash_on_merge": false,
"task_completion_status": {
"count": 0,
"completed_count": 0
},
"has_conflicts": false,
"blocking_discussions_resolved": true,
"approvals_before_merge": null
},
"project_id": 7
}
]
단일 병합 요청 변경 사항 가져오기
경고:
이 끝점은 더 이상 지원되지 않음 는 GitLab 15.7에서
API v5에서 제거될 예정입니다. 대신
병합 요청 차이 목록
끝점을 사용하세요.
병합 요청에 대한 정보와 그 파일 및 변경 내용을 표시합니다.
GET /projects/:id/merge_requests/:merge_request_iid/changes
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID. |
access_raw_diffs |
불리언 | 아니오 | Gitaly를 통해 변경 차이를 검색합니다. |
unidiff |
불리언 | 아니오 | 변경 차이를 통합된 차이 형식으로 표시합니다. 기본값은 false입니다. GitLab 16.5에서 소개됨. |
변경 세트와 관련된 차이는 API에서 반환되거나 UI를 통해 볼 수 있는 다른 차이에 적용되는 동일한 크기 제한이 적용됩니다. 이 제한이 결과에 영향을 미칠 경우, overflow
필드는 true
값을 가집니다.
access_raw_diffs
매개변수를 추가하여 이러한 제한 없이 차이 데이터를 검색할 수 있습니다. 이 매개변수는 데이터베이스에서가 아니라 Gitaly에서 차이를 직접 액세스합니다. 이 방법은 일반적으로 더 느리고 리소스 집약적이지만 데이터베이스 지원 차이에 부과되는 크기 제한에는 영향을 받지 않습니다.
Gitaly에 내재된 제한이 여전히 적용됩니다.
예제 응답:
{
"id": 21,
"iid": 1,
"project_id": 4,
"title": "Blanditiis beatae suscipit hic assumenda et molestias nisi asperiores repellat et.",
"state": "reopened",
"created_at": "2015-02-02T19:49:39.159Z",
"updated_at": "2015-02-02T20:08:49.959Z",
"target_branch": "secret_token",
"source_branch": "version-1-9",
"upvotes": 0,
"downvotes": 0,
"author": {
"name": "Chad Hamill",
"username": "jarrett",
"id": 5,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/b95567800f828948baf5f4160ebb2473?s=40&d=identicon",
"web_url" : "https://gitlab.example.com/jarrett"
},
"assignee": {
"name": "Administrator",
"username": "root",
"id": 1,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40&d=identicon",
"web_url" : "https://gitlab.example.com/root"
},
"assignees": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"reviewers": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"source_project_id": 4,
"target_project_id": 4,
"labels": [ ],
"description": "Qui voluptatibus placeat ipsa alias quasi. Deleniti rem ut sint. Optio velit qui distinctio.",
"draft": false,
"work_in_progress": false,
"milestone": {
"id": 5,
"iid": 1,
"project_id": 4,
"title": "v2.0",
"description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
"state": "closed",
"created_at": "2015-02-02T19:49:26.013Z",
"updated_at": "2015-02-02T19:49:26.013Z",
"due_date": null
},
"merge_when_pipeline_succeeds": true,
"merge_status": "can_be_merged",
"detailed_merge_status": "can_be_merged",
"subscribed" : true,
"sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null,
"squash_commit_sha": null,
"user_notes_count": 1,
"changes_count": "1",
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"squash": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"discussion_locked": false,
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"task_completion_status":{
"count":0,
"completed_count":0
},
"changes": [
{
"old_path": "VERSION",
"new_path": "VERSION",
"a_mode": "100644",
"b_mode": "100644",
"diff": "@@ -1 +1 @@\ -1.9.7\ +1.9.8",
"new_file": false,
"renamed_file": false,
"deleted_file": false
}
],
"overflow": false
}
병합 요청 차이점 목록
generated_file
소개됨 GitLab 16.9에서collapse_generated_diff_files
라는 플래그와 함께. 기본적으로 비활성화됨.- GitLab.com 및 자체 관리에서 활성화됨 GitLab 16.10에서.
generated_file
일반적으로 사용 가능 GitLab 16.11에서. 기능 플래그collapse_generated_diff_files
제거됨.
병합 요청에서 변경된 파일의 차이점을 나열합니다.
GET /projects/:id/merge_requests/:merge_request_iid/diffs
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID. |
page |
정수 | 아니오 | 반환할 결과 페이지. 기본값은 1. |
per_page |
정수 | 아니오 | 페이지당 결과 수. 기본값은 20. |
unidiff |
부울 | 아니오 | 통합 차이점 형식으로 차이점을 표시합니다. 기본값은 false입니다. GitLab 16.5에서 소개됨. |
성공하면 200 OK
및 다음 응답 속성을 반환합니다:
속성 | 유형 | 설명 |
---|---|---|
old_path |
문자열 | 파일의 이전 경로. |
new_path |
문자열 | 파일의 새 경로. |
a_mode |
문자열 | 파일의 이전 파일 모드. |
b_mode |
문자열 | 파일의 새 파일 모드. |
diff |
문자열 | 파일에 대한 변경 사항의 차이점 표현. |
new_file |
부울 | 파일이 새로 추가되었는지 여부를 나타냅니다. |
renamed_file |
부울 | 파일이 이름이 변경되었는지 여부를 나타냅니다. |
deleted_file |
부울 | 파일이 제거되었는지 여부를 나타냅니다. |
generated_file |
부울 | 파일이 생성된 것으로 표시됨인지 여부를 나타냅니다. GitLab 16.9에서 소개됨. |
예제 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/merge_requests/1/diffs?page=1&per_page=2"
예제 응답:
[
{
"old_path": "README",
"new_path": "README",
"a_mode": "100644",
"b_mode": "100644",
"diff": "@@ -1 +1 @@\ -Title\ +README",
"new_file": false,
"renamed_file": false,
"deleted_file": false,
"generated_file": false
},
{
"old_path": "VERSION",
"new_path": "VERSION",
"a_mode": "100644",
"b_mode": "100644",
"diff": "@@\ -1.9.7\ +1.9.8",
"new_file": false,
"renamed_file": false,
"deleted_file": false,
"generated_file": false
}
]
참고:
이 엔드포인트는 병합 요청 차이점 제한의 적용을 받습니다.
차이점 제한을 초과하는 병합 요청은 제한된 결과를 반환합니다.
병합 요청 파이프라인 목록
병합 요청 파이프라인 목록을 가져옵니다.
GET /projects/:id/merge_requests/:merge_request_iid/pipelines
지원되는 속성:
속성 | 타입 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID입니다. |
병합 요청 파이프라인 목록을 제한하려면 페이지 매김 매개변수 page
와 per_page
를 사용하세요.
예시 응답:
[
{
"id": 77,
"sha": "959e04d7c7a30600c894bd3c0cd0e1ce7f42c11d",
"ref": "main",
"status": "success"
}
]
병합 요청 파이프라인 생성
새로운 병합 요청을 위한 파이프라인을 생성합니다.
이 엔드포인트에서 생성된 파이프라인은 정규 브랜치/태그 파이프라인을 실행하지 않습니다.
작업을 생성하려면 .gitlab-ci.yml
파일을 only: [merge_requests]
로 구성하세요.
새 파이프라인은 다음과 같습니다:
- 분리된 병합 요청 파이프라인입니다.
- 병합된 결과 파이프라인 프로젝트 설정이 활성화된 경우입니다.
POST /projects/:id/merge_requests/:merge_request_iid/pipelines
지원되는 속성:
속성 | 타입 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID입니다. |
예시 응답:
{
"id": 2,
"sha": "b83d6e391c22777fca1ed3012fce84f633d7fed0",
"ref": "refs/merge-requests/1/head",
"status": "pending",
"web_url": "http://localhost/user1/project1/pipelines/2",
"before_sha": "0000000000000000000000000000000000000000",
"tag": false,
"yaml_errors": null,
"user": {
"id": 1,
"name": "John Doe1",
"username": "user1",
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/c922747a93b40d1ea88262bf1aebee62?s=80&d=identicon",
"web_url": "http://example.com"
},
"created_at": "2019-09-04T19:20:18.267Z",
"updated_at": "2019-09-04T19:20:18.459Z",
"started_at": null,
"finished_at": null,
"committed_at": null,
"duration": null,
"coverage": null,
"detailed_status": {
"icon": "status_pending",
"text": "pending",
"label": "pending",
"group": "pending",
"tooltip": "pending",
"has_details": false,
"details_path": "/user1/project1/pipelines/2",
"illustration": null,
"favicon": "/assets/ci_favicons/favicon_status_pending-5bdf338420e5221ca24353b6bff1c9367189588750632e9a871b7af09ff6a2ae.png"
}
}
MR 생성
새로운 merge request를 생성합니다.
POST /projects/:id/merge_requests
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL-인코딩 경로 |
source_branch |
문자열 | 예 | 소스 브랜치. |
target_branch |
문자열 | 예 | 대상 브랜치. |
title |
문자열 | 예 | MR의 제목. |
allow_collaboration |
불린 | 아니오 | 대상 브랜치에 머지할 수 있는 구성원으로부터 커밋을 허용합니다. |
approvals_before_merge |
정수 | 아니오 | 이 merge request가 머지되기 전에 필요한 승인 수(아래 참조). 승인 규칙을 구성하려면 Merge request approvals API를 참조하세요. GitLab 16.0에서 더 이상 사용되지 않음. Premium 및 Ultimate 전용. |
allow_maintainer_to_push |
불린 | 아니오 |
allow_collaboration 의 별칭. |
assignee_id |
정수 | 아니오 | 담당자 사용자 ID. |
assignee_ids |
정수 배열 | 아니오 | merge request에 할당할 사용자 ID. 모든 할당자를 해제하려면 0 으로 설정하거나 빈 값을 제공하세요. |
description |
문자열 | 아니오 | merge request의 설명. 1,048,576자 제한. |
labels |
문자열 | 아니오 | merge request를 위한 레이블, 쉼표로 구분된 목록으로. 레이블이 이미 존재하지 않으면 새 프로젝트 레이블을 생성하고 merge request에 할당합니다. |
milestone_id |
정수 | 아니오 | 마일스톤의 전역 ID. |
remove_source_branch |
불린 | 아니오 | 머지 시 소스 브랜치를 제거해야 하는지 나타내는 플래그. |
reviewer_ids |
정수 배열 | 아니오 | merge request에 리뷰어로 추가할 사용자 ID. 0 으로 설정하거나 비워두면 리뷰어가 추가되지 않습니다. |
squash |
불린 | 아니오 |
true 인 경우, 모든 커밋을 하나의 커밋으로 스쿼시합니다. 프로젝트 설정가 이 값을 무시할 수 있습니다. |
target_project_id |
정수 | 아니오 | 대상 프로젝트의 숫자 ID. |
예시 응답:
{
"id": 1,
"iid": 1,
"project_id": 3,
"title": "test1",
"description": "로그인 페이지 CSS 패딩 수정",
"state": "merged",
"imported": false,
"imported_from": "none",
"created_at": "2017-04-29T08:46:00Z",
"updated_at": "2017-04-29T08:46:00Z",
"target_branch": "main",
"source_branch": "test1",
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 1,
"name": "관리자",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignee": {
"id": 1,
"name": "관리자",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url": "https://gitlab.example.com/admin"
},
"source_project_id": 2,
"target_project_id": 3,
"labels": [
"커뮤니티 기여",
"관리"
],
"draft": false,
"work_in_progress": false,
"milestone": {
"id": 5,
"iid": 1,
"project_id": 3,
"title": "v2.0",
"description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
"state": "closed",
"created_at": "2015-02-02T19:49:26.013Z",
"updated_at": "2015-02-02T19:49:26.013Z",
"due_date": "2018-09-22",
"start_date": "2018-08-08",
"web_url": "https://gitlab.example.com/my-group/my-project/milestones/1"
},
"merge_when_pipeline_succeeds": true,
"merge_status": "can_be_merged",
"detailed_merge_status": "not_open",
"merge_error": null,
"sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null,
"squash_commit_sha": null,
"user_notes_count": 1,
"discussion_locked": null,
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"subscribed": false,
"changes_count": "1",
"merged_by": { // 더 이상 사용되지 않음, API v5에서 제거될 예정, 대신 `merge_user`를 사용하세요
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merge_user": {
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"merge_after": "2018-09-07T11:16:00.000Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
"latest_build_finished_at": "2018-09-07T08:07:06.012Z",
"first_deployed_to_production_at": null,
"pipeline": {
"id": 29626725,
"sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
"ref": "patch-28",
"status": "success",
"web_url": "https://gitlab.example.com/my-group/my-project/pipelines/29626725"
},
"diff_refs": {
"base_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00",
"head_sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
"start_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00"
},
"diverged_commits_count": 2,
"task_completion_status":{
"count":0,
"completed_count":0
}
}
응답 데이터에 대한 중요한 참고 사항은 단일 merge request 응답 노트를 참조하세요.
MR 업데이트
기존의 병합 요청을 업데이트합니다. 대상 브랜치, 제목을 변경하거나 MR을 닫을 수 있습니다.
PUT /projects/:id/merge_requests/:merge_request_iid
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL로 인코딩된 경로입니다. |
merge_request_iid |
정수 | 예 | 병합 요청의 ID입니다. |
add_labels |
문자열 | 아니오 | 병합 요청에 추가할 쉼표로 구분된 라벨 이름입니다. 레이블이 존재하지 않으면 새 프로젝트 레이블이 생성되어 병합 요청에 할당됩니다. |
allow_collaboration |
불리언 | 아니오 | 대상 브랜치에 병합할 수 있는 사용자로부터 커밋을 허용합니다. |
allow_maintainer_to_push |
불리언 | 아니오 |
allow_collaboration 의 별칭입니다. |
assignee_id |
정수 | 아니오 | 병합 요청에 할당할 사용자 ID입니다. 0 으로 설정하거나 빈 값을 제공하여 모든 할당자를 제거할 수 있습니다. |
assignee_ids |
정수 배열 | 아니오 | 병합 요청에 할당할 사용자 ID입니다. 0 으로 설정하거나 빈 값을 제공하여 모든 할당자를 제거할 수 있습니다. |
description |
문자열 | 아니오 | 병합 요청의 설명입니다. 최대 1,048,576자로 제한됩니다. |
discussion_locked |
불리언 | 아니오 | 병합 요청의 토론이 잠겨 있는지 여부를 나타내는 플래그입니다. 잠긴 토론에는 프로젝트 구성원만 댓글을 추가, 수정 또는 해결할 수 있습니다. |
labels |
문자열 | 아니오 | 병합 요청을 위한 쉼표로 구분된 라벨 이름입니다. 빈 문자열로 설정하여 모든 레이블을 제거할 수 있습니다. 레이블이 존재하지 않으면 새 프로젝트 레이블이 생성되어 병합 요청에 할당됩니다. |
milestone_id |
정수 | 아니오 | 병합 요청을 할당할 마일스톤의 전역 ID입니다. 0 으로 설정하거나 빈 값을 제공하여 마일스톤을 할당 해제할 수 있습니다. |
remove_labels |
문자열 | 아니오 | 병합 요청에서 제거할 쉼표로 구분된 라벨 이름입니다. |
remove_source_branch |
불리언 | 아니오 | 병합 시 병합 요청이 소스 브랜치를 제거해야 하는지 여부를 나타내는 플래그입니다. |
reviewer_ids |
정수 배열 | 아니오 | 병합 요청의 리뷰어로 설정할 사용자 ID입니다. 값을 0 으로 설정하거나 빈 값을 제공하여 모든 리뷰어 설정을 해제할 수 있습니다. |
squash |
불리언 | 아니오 |
true 인 경우, 병합 시 모든 커밋을 단일 커밋으로 압축합니다. 프로젝트 설정에서 이 값을 덮어쓸 수 있습니다. |
state_event |
문자열 | 아니오 | 새 상태 (close/reopen)입니다. |
target_branch |
문자열 | 아니오 | 대상 브랜치입니다. |
title |
문자열 | 아니오 | MR의 제목입니다. |
위의 필수 속성 중 하나 이상을 포함해야 합니다.
예시 응답:
{
"id": 1,
"iid": 1,
"project_id": 3,
"title": "test1",
"description": "로그인 페이지 CSS 패딩 수정",
"state": "merged",
"created_at": "2017-04-29T08:46:00Z",
"updated_at": "2017-04-29T08:46:00Z",
"target_branch": "main",
"source_branch": "test1",
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 1,
"name": "관리자",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignee": {
"id": 1,
"name": "관리자",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignees": [{
"name": "미스 몬세라트 베이어",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"reviewers": [{
"name": "미스 몬세라트 베이어",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"source_project_id": 2,
"target_project_id": 3,
"labels": [
"커뮤니티 기여",
"관리"
],
"draft": false,
"work_in_progress": false,
"milestone": {
"id": 5,
"iid": 1,
"project_id": 3,
"title": "v2.0",
"description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
"state": "closed",
"created_at": "2015-02-02T19:49:26.013Z",
"updated_at": "2015-02-02T19:49:26.013Z",
"due_date": "2018-09-22",
"start_date": "2018-08-08",
"web_url": "https://gitlab.example.com/my-group/my-project/milestones/1"
},
"merge_when_pipeline_succeeds": true,
"merge_status": "can_be_merged",
"detailed_merge_status": "not_open",
"merge_error": null,
"sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null,
"squash_commit_sha": null,
"user_notes_count": 1,
"discussion_locked": null,
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"subscribed": false,
"changes_count": "1",
"merged_by": { // Deprecated and will be removed in API v5, use `merge_user` instead
"id": 87854,
"name": "다우 웨 만",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merge_user": {
"id": 87854,
"name": "다우 웨 만",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"merge_after": "2018-09-07T11:16:00.000Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
"latest_build_finished_at": "2018-09-07T08:07:06.012Z",
"first_deployed_to_production_at": null,
"pipeline": {
"id": 29626725,
"sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
"ref": "patch-28",
"status": "success",
"web_url": "https://gitlab.example.com/my-group/my-project/pipelines/29626725"
},
"diff_refs": {
"base_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00",
"head_sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
"start_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00"
},
"diverged_commits_count": 2,
"task_completion_status":{
"count":0,
"completed_count":0
}
}
응답 데이터에 대한 중요한 참고 사항은 단일 병합 요청 응답 노트를 참조하세요.
병합 요청 삭제
관리자 및 프로젝트 소유자만 사용 가능합니다. 해당 병합 요청을 삭제합니다.
DELETE /projects/:id/merge_requests/:merge_request_iid
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID입니다. |
curl --request DELETE \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/4/merge_requests/85"
병합 요청 병합
이 API를 사용하여 병합 요청으로 제출된 변경 사항을 수락하고 병합합니다.
PUT /projects/:id/merge_requests/:merge_request_iid/merge
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID입니다. |
merge_commit_message |
문자열 | 아니오 | 사용자 정의 병합 커밋 메시지입니다. |
merge_when_pipeline_succeeds |
불리언 | 아니오 |
true 인 경우, 파이프라인이 성공할 때 병합 요청이 병합됩니다. |
sha |
문자열 | 아니오 | 존재하는 경우, 이 SHA는 소스 브랜치의 HEAD와 일치해야 하며, 그렇지 않으면 병합이 실패합니다. |
should_remove_source_branch |
불리언 | 아니오 |
true 인 경우, 소스 브랜치가 제거됩니다. |
squash_commit_message |
문자열 | 아니오 | 사용자 정의 스쿼시 커밋 메시지입니다. |
squash |
불리언 | 아니오 |
true 인 경우, 모든 커밋이 병합 시 단일 커밋으로 압축됩니다. |
이 API는 실패 시 특정 HTTP 상태 코드를 반환합니다:
HTTP 상태 | 메시지 | 이유 |
---|---|---|
401 |
401 Unauthorized |
이 사용자는 이 병합 요청을 수락할 권한이 없습니다. |
405 |
405 Method Not Allowed |
병합 요청이 병합될 수 없습니다. |
409 |
SHA does not match HEAD of source branch |
제공된 sha 매개변수가 소스의 HEAD와 일치하지 않습니다. |
422 |
Branch cannot be merged |
병합 요청이 병합에 실패했습니다. |
응답 데이터에 대한 중요한 정보는 단일 병합 요청 응답 노트를 참조하세요.
예시 응답:
{
"id": 1,
"iid": 1,
"project_id": 3,
"title": "test1",
"description": "로그인 페이지 CSS 패딩 수정",
"state": "merged",
"created_at": "2017-04-29T08:46:00Z",
"updated_at": "2017-04-29T08:46:00Z",
"target_branch": "main",
"source_branch": "test1",
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 1,
"name": "관리자",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url": "https://gitlab.example.com/admin"
},
"assignee": {
"id": 1,
"name": "관리자",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url": "https://gitlab.example.com/admin"
},
"assignees": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"reviewers": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"source_project_id": 2,
"target_project_id": 3,
"labels": [
"커뮤니티 기여",
"관리"
],
"draft": false,
"work_in_progress": false,
"milestone": {
"id": 5,
"iid": 1,
"project_id": 3,
"title": "v2.0",
"description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
"state": "closed",
"created_at": "2015-02-02T19:49:26.013Z",
"updated_at": "2015-02-02T19:49:26.013Z",
"due_date": "2018-09-22",
"start_date": "2018-08-08",
"web_url": "https://gitlab.example.com/my-group/my-project/milestones/1"
},
"merge_when_pipeline_succeeds": true,
"merge_status": "can_be_merged",
"detailed_merge_status": "not_open",
"merge_error": null,
"sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null,
"squash_commit_sha": null,
"user_notes_count": 1,
"discussion_locked": null,
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"subscribed": false,
"changes_count": "1",
"merged_by": { // Deprecated and will be removed in API v5, use `merge_user` instead
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merge_user": {
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"merge_after": "2018-09-07T11:16:00.000Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
"latest_build_finished_at": "2018-09-07T08:07:06.012Z",
"first_deployed_to_production_at": null,
"pipeline": {
"id": 29626725,
"sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
"ref": "patch-28",
"status": "success",
"web_url": "https://gitlab.example.com/my-group/my-project/pipelines/29626725"
},
"diff_refs": {
"base_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00",
"head_sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
"start_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00"
},
"diverged_commits_count": 2,
"task_completion_status": {
"count": 0,
"completed_count": 0
}
}
기본 병합 참조 경로로 병합
가능한 경우 병합 요청 소스와 대상 브랜치 간의 변경 내용을 refs/merge-requests/:iid/merge
대상 프로젝트 리포지토리의 참조로 병합합니다. 이 참조는 일반적인 병합 작업이 수행되었을 때
대상 브랜치가 가질 상태입니다.
이 작업은 정규 병합 작업이 아니므로, 병합 요청 대상 브랜치 상태를 어떤 식으로든 변경하지 않습니다.
이 참조(refs/merge-requests/:iid/merge
)는 이 API에 요청을 제출할 때 반드시 덮어쓰여지지 않지만, 가능한 최신 상태를 보장합니다.
GET /projects/:id/merge_requests/:merge_request_iid/merge_ref
지원하는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID입니다. |
이 API는 특정 HTTP 상태 코드를 반환합니다:
HTTP 상태 | 메시지 | 이유 |
---|---|---|
200 |
(없음) | 성공. refs/merge-requests/:iid/merge 의 HEAD 커밋을 반환합니다. |
400 |
병합 요청이 병합할 수 없습니다 |
병합 요청에 충돌이 있습니다. |
400 |
병합 참조를 업데이트할 수 없습니다 |
|
400 |
지원되지 않는 작업 |
GitLab 데이터베이스가 읽기 전용 모드입니다. |
예제 응답:
{
"commit_id": "854a3a7a17acbcc0bbbea170986df1eb60435f34"
}
파이프라인 성공 시 병합 취소
POST /projects/:id/merge_requests/:merge_request_iid/cancel_merge_when_pipeline_succeeds
지원하는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID입니다. |
이 API는 특정 HTTP 상태 코드를 반환합니다:
HTTP 상태 | 메시지 | 이유 |
---|---|---|
201 |
(없음) | 성공하거나 병합 요청이 이미 병합되었습니다. |
406 |
자동 병합을 취소할 수 없습니다 |
병합 요청이 닫혔습니다. |
응답 데이터에 대한 중요 사항은 단일 병합 요청 응답 노트를 참조하세요.
예제 응답:
{
"id": 1,
"iid": 1,
"project_id": 3,
"title": "test1",
"description": "로그인 페이지 CSS 패딩 수정",
"state": "병합됨",
"created_at": "2017-04-29T08:46:00Z",
"updated_at": "2017-04-29T08:46:00Z",
"target_branch": "main",
"source_branch": "test1",
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 1,
"name": "관리자",
"username": "admin",
"state": "활성",
"avatar_url": null,
"web_url": "https://gitlab.example.com/admin"
},
"assignee": {
"id": 1,
"name": "관리자",
"username": "admin",
"state": "활성",
"avatar_url": null,
"web_url": "https://gitlab.example.com/admin"
},
"assignees": [{
"name": "미스 몬세라트 비어",
"username": "axel.block",
"id": 12,
"state": "활성",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"reviewers": [{
"name": "미스 몬세라트 비어",
"username": "axel.block",
"id": 12,
"state": "활성",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"source_project_id": 2,
"target_project_id": 3,
"labels": [
"커뮤니티 기여",
"관리"
],
"draft": false,
"work_in_progress": false,
"milestone": {
"id": 5,
"iid": 1,
"project_id": 3,
"title": "v2.0",
"description": "수행해야 할 작업",
"state": "닫힘",
"created_at": "2015-02-02T19:49:26.013Z",
"updated_at": "2015-02-02T19:49:26.013Z",
"due_date": "2018-09-22",
"start_date": "2018-08-08",
"web_url": "https://gitlab.example.com/my-group/my-project/milestones/1"
},
"merge_when_pipeline_succeeds": false,
"merge_status": "병합 가능",
"detailed_merge_status": "열려 있지 않음",
"merge_error": null,
"sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null,
"squash_commit_sha": null,
"user_notes_count": 1,
"discussion_locked": null,
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"subscribed": false,
"changes_count": "1",
"merged_by": { // API v5에서 더 이상 사용되지 않으며 `merge_user`를 사용하세요.
"id": 87854,
"name": "도웨 만",
"username": "DouweM",
"state": "활성",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merge_user": {
"id": 87854,
"name": "도웨 만",
"username": "DouweM",
"state": "활성",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"merge_after": "2018-09-07T11:16:00.000Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
"latest_build_finished_at": "2018-09-07T08:07:06.012Z",
"first_deployed_to_production_at": null,
"pipeline": {
"id": 29626725,
"sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
"ref": "patch-28",
"status": "성공",
"web_url": "https://gitlab.example.com/my-group/my-project/pipelines/29626725"
},
"diff_refs": {
"base_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00",
"head_sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
"start_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00"
},
"diverged_commits_count": 2,
"task_completion_status":{
"count":0,
"completed_count":0
}
}
병합 요청 리베이스
병합 요청의 source_branch
를 해당 target_branch
에 자동으로 리베이스합니다.
PUT /projects/:id/merge_requests/:merge_request_iid/rebase
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL-인코딩된 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID. |
skip_ci |
불리언 | 아니오 | CI 파이프라인 생성 건너뛰기를 위해 true 로 설정합니다. |
curl --request PUT \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/76/merge_requests/1/rebase"
이 API는 특정 HTTP 상태 코드를 반환합니다:
HTTP 상태 | 메시지 | 이유 |
---|---|---|
202 |
(no message) | 성공적으로 대기열에 추가되었습니다. |
403 |
Cannot push to source branch |
병합 요청의 소스 브랜치에 푸시할 권한이 없습니다. |
403 |
Source branch does not exist |
병합 요청의 소스 브랜치에 푸시할 권한이 없습니다. |
403 |
Source branch is protected from force push |
병합 요청의 소스 브랜치에 푸시할 권한이 없습니다. |
409 |
Failed to enqueue the rebase operation |
긴 거래가 요청을 차단했을 수 있습니다. |
요청이 대기열에 성공적으로 추가되면 응답은 다음과 같습니다:
{
"rebase_in_progress": true
}
include_rebase_in_progress
매개 변수를 사용하여 단일 MR 가져오기 엔드포인트를 폴링하여 비동기 요청의 상태를 확인할 수 있습니다.
리베이스 작업이 진행 중인 경우 응답에는 다음이 포함됩니다:
{
"rebase_in_progress": true,
"merge_error": null
}
리베이스 작업이 성공적으로 완료된 후 응답에는 다음이 포함됩니다:
{
"rebase_in_progress": false,
"merge_error": null
}
리베이스 작업이 실패한 경우 응답에는 다음이 포함됩니다:
{
"rebase_in_progress": false,
"merge_error": "Rebase failed. Please rebase locally"
}
병합 요청에 대한 댓글
노트 리소스는 댓글을 생성합니다.
병합 시 닫히는 이슈 목록
제공된 병합 요청으로 닫힐 모든 이슈를 가져옵니다.
GET /projects/:id/merge_requests/:merge_request_iid/closes_issues
지원되는 속성들:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL-인코딩된 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID. |
성공하면 200 OK
를 반환하며, GitLab 이슈 트래커를 사용할 경우 다음 응답 속성을 포함합니다:
속성 | 유형 | 설명 |
---|---|---|
[].assignee |
객체 | 이슈의 첫 번째 담당자. |
[].assignees |
배열 | 이슈의 담당자들. |
[].author |
객체 | 이 이슈를 생성한 사용자. |
[].blocking_issues_count |
정수 | 이 이슈가 차단하는 이슈의 수. |
[].closed_at |
날짜시간 | 이슈가 닫힌 시점. |
[].closed_by |
객체 | 이 이슈를 닫은 사용자. |
[].confidential |
불리언 | 이슈가 기밀인지 여부. |
[].created_at |
날짜시간 | 이슈가 생성된 시점. |
[].description |
문자열 | 이슈의 설명. |
[].discussion_locked |
불리언 | 이슈에 대한 댓글이 회원 전용으로 잠겨 있는지 여부를 나타냅니다. |
[].downvotes |
정수 | 이슈가 받은 다운바코드 수. |
[].due_date |
날짜시간 | 이슈의 기한. |
[].id |
정수 | 이슈의 ID. |
[].iid |
정수 | 이슈의 내부 ID. |
[].issue_type |
문자열 | 이슈의 유형. issue , incident , test_case , requirement , task 중 하나입니다. |
[].labels |
배열 | 이슈의 레이블. |
[].merge_requests_count |
정수 | 병합으로 이슈를 닫는 병합 요청의 수. |
[].milestone |
객체 | 이슈의 마일스톤. |
[].project_id |
정수 | 이슈 프로젝트의 ID. |
[].state |
문자열 | 이슈의 상태. opened 또는 closed 중 하나입니다. |
[].task_completion_status |
객체 |
count 및 completed_count 를 포함합니다. |
[].time_stats |
객체 | 이슈에 대한 시간 통계. time_estimate , total_time_spent , human_time_estimate , human_total_time_spent 를 포함합니다. |
[].title |
문자열 | 이슈의 제목. |
[].type |
문자열 | 이슈의 유형. issue_type 와 동일하지만 대문자로 표기됩니다. |
[].updated_at |
날짜시간 | 이슈가 업데이트된 시점. |
[].upvotes |
정수 | 이슈가 받은 업바코드 수. |
[].user_notes_count |
정수 | 이슈의 사용자 노트 수. |
[].web_url |
문자열 | 이슈의 웹 URL. |
[].weight |
정수 | 이슈의 무게. |
성공하면 200 OK
를 반환하며, Jira와 같은 외부 이슈 트래커를 사용할 경우 다음 응답 속성을 포함합니다:
속성 | 유형 | 설명 |
---|---|---|
[].id |
정수 | 이슈의 ID. |
[].title |
문자열 | 이슈의 제목. |
예제 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/76/merge_requests/1/closes_issues"
GitLab 이슈 트래커를 사용할 때의 예제 응답:
[
{
"id": 76,
"iid": 6,
"project_id": 1,
"title": "Consequatur vero maxime deserunt laboriosam est voluptas dolorem.",
"description": "Ratione dolores corrupti mollitia soluta quia.",
"state": "opened",
"created_at": "2024-09-06T10:58:49.002Z",
"updated_at": "2024-09-06T11:01:40.710Z",
"closed_at": null,
"closed_by": null,
"labels": [
"label"
],
"milestone": {
"project_id": 1,
"description": "Ducimus nam enim ex consequatur cumque ratione.",
"state": "closed",
"due_date": null,
"iid": 2,
"created_at": "2016-01-04T15:31:39.996Z",
"title": "v4.0",
"id": 17,
"updated_at": "2016-01-04T15:31:39.996Z"
},
"assignees": [
{
"id": 1,
"username": "root",
"name": "Administrator",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "https://gitlab.example.com/root"
}
],
"author": {
"id": 18,
"username": "eileen.lowe",
"name": "Alexandra Bashirian",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "https://gitlab.example.com/eileen.lowe"
},
"type": "ISSUE",
"assignee": {
"id": 1,
"username": "root",
"name": "Administrator",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "https://gitlab.example.com/root"
},
"user_notes_count": 1,
"merge_requests_count": 1,
"upvotes": 0,
"downvotes": 0,
"due_date": null,
"confidential": false,
"discussion_locked": null,
"issue_type": "issue",
"web_url": "https://gitlab.example.com/my-group/my-project/-/issues/6",
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"task_completion_status": {
"count": 0,
"completed_count": 0
},
"weight": null,
"blocking_issues_count": 0
}
]
Jira와 같은 외부 이슈 트래커를 사용할 때의 예제 응답:
[
{
"id" : "PROJECT-123",
"title" : "Title of this issue"
}
]
병합 요청과 관련된 이슈 목록
제목, 설명, 커밋 메시지, 댓글, 병합 요청의 논의에서 모든 관련 이슈를 가져옵니다.
GET /projects/:id/merge_requests/:merge_request_iid/related_issues
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID. |
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/76/merge_requests/1/related_issues"
GitLab 이슈 트래커를 사용할 때의 예시 응답:
[
{
"state" : "opened",
"description" : "Ratione dolores corrupti mollitia soluta quia.",
"author" : {
"state" : "active",
"id" : 18,
"web_url" : "https://gitlab.example.com/eileen.lowe",
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"username" : "eileen.lowe"
},
"milestone" : {
"project_id" : 1,
"description" : "Ducimus nam enim ex consequatur cumque ratione.",
"state" : "closed",
"due_date" : null,
"iid" : 2,
"created_at" : "2016-01-04T15:31:39.996Z",
"title" : "v4.0",
"id" : 17,
"updated_at" : "2016-01-04T15:31:39.996Z"
},
"project_id" : 1,
"assignee" : {
"state" : "active",
"id" : 1,
"name" : "Administrator",
"web_url" : "https://gitlab.example.com/root",
"avatar_url" : null,
"username" : "root"
},
"updated_at" : "2016-01-04T15:31:51.081Z",
"id" : 76,
"title" : "Consequatur vero maxime deserunt laboriosam est voluptas dolorem.",
"created_at" : "2016-01-04T15:31:51.081Z",
"iid" : 6,
"labels" : [],
"user_notes_count": 1,
"changes_count": "1"
}
]
외부 이슈 트래커(예: Jira)를 사용할 때의 예시 응답:
[
{
"id" : "PROJECT-123",
"title" : "이 이슈의 제목"
}
]
병합 요청 구독하기
인증된 사용자를 병합 요청에 구독하여 알림을 받을 수 있습니다.
POST /projects/:id/merge_requests/:merge_request_iid/subscribe
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID. |
사용자가 이미 병합 요청에 구독되어 있는 경우, 엔드포인트는 상태 코드 HTTP 304 Not Modified
를 반환합니다.
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/5/merge_requests/17/subscribe"
예시 응답:
{
"id": 1,
"iid": 1,
"project_id": 3,
"title": "test1",
"description": "로그인 페이지 CSS 패딩 수정",
"state": "merged",
"created_at": "2017-04-29T08:46:00Z",
"updated_at": "2017-04-29T08:46:00Z",
"target_branch": "main",
"source_branch": "test1",
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 1,
"name": "Administrator",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignee": {
"id": 1,
"name": "Administrator",
"username": "admin",
"state": "active",
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignees": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"reviewers": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"source_project_id": 2,
"target_project_id": 3,
"labels": [
"커뮤니티 기여",
"관리"
],
"draft": false,
"work_in_progress": false,
"milestone": {
"id": 5,
"iid": 1,
"project_id": 3,
"title": "v2.0",
"description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
"state": "closed",
"created_at": "2015-02-02T19:49:26.013Z",
"updated_at": "2015-02-02T19:49:26.013Z",
"due_date": "2018-09-22",
"start_date": "2018-08-08",
"web_url": "https://gitlab.example.com/my-group/my-project/milestones/1"
},
"merge_when_pipeline_succeeds": true,
"merge_status": "can_be_merged",
"detailed_merge_status": "not_open",
"sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null,
"squash_commit_sha": null,
"user_notes_count": 1,
"discussion_locked": null,
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"subscribed": false,
"changes_count": "1",
"merged_by": { // API v5에서 제거될 예정이므로, 대신 `merge_user`를 사용하세요.
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merge_user": {
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "active",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"merge_after": "2018-09-07T11:16:00.000Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
"latest_build_finished_at": "2018-09-07T08:07:06.012Z",
"first_deployed_to_production_at": null,
"pipeline": {
"id": 29626725,
"sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
"ref": "patch-28",
"status": "success",
"web_url": "https://gitlab.example.com/my-group/my-project/pipelines/29626725"
},
"diff_refs": {
"base_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00",
"head_sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
"start_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00"
},
"diverged_commits_count": 2,
"task_completion_status":{
"count":0,
"completed_count":0
}
}
응답 데이터에 대한 중요한 참고 사항은 단일 병합 요청 응답 주석을 참조하십시오.
병합 요청에서 구독 해지
인증된 사용자가 병합 요청에서 구독을 해지하여 해당 병합 요청의 알림을 받지 않도록 합니다.
POST /projects/:id/merge_requests/:merge_request_iid/unsubscribe
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID. |
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/5/merge_requests/17/unsubscribe"
사용자가 병합 요청에 구독되어 있지 않은 경우, 엔드포인트는 상태 코드 HTTP 304 Not Modified
를 반환합니다.
예시 응답:
{
"id": 1,
"iid": 1,
"project_id": 3,
"title": "test1",
"description": "로그인 페이지 CSS 패딩 수정",
"state": "병합됨",
"created_at": "2017-04-29T08:46:00Z",
"updated_at": "2017-04-29T08:46:00Z",
"target_branch": "main",
"source_branch": "test1",
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 1,
"name": "관리자",
"username": "admin",
"state": "활동 중",
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignee": {
"id": 1,
"name": "관리자",
"username": "admin",
"state": "활동 중",
"avatar_url": null,
"web_url" : "https://gitlab.example.com/admin"
},
"assignees": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "활동 중",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"reviewers": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "활동 중",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"source_project_id": 2,
"target_project_id": 3,
"labels": [
"커뮤니티 기여",
"관리"
],
"draft": false,
"work_in_progress": false,
"milestone": {
"id": 5,
"iid": 1,
"project_id": 3,
"title": "v2.0",
"description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
"state": "종료됨",
"created_at": "2015-02-02T19:49:26.013Z",
"updated_at": "2015-02-02T19:49:26.013Z",
"due_date": "2018-09-22",
"start_date": "2018-08-08",
"web_url": "https://gitlab.example.com/my-group/my-project/milestones/1"
},
"merge_when_pipeline_succeeds": true,
"merge_status": "병합 가능",
"detailed_merge_status": "열리지 않음",
"sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null,
"squash_commit_sha": null,
"user_notes_count": 1,
"discussion_locked": null,
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"subscribed": false,
"changes_count": "1",
"merged_by": { // Deprecated and will be removed in API v5, use `merge_user` instead
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "활동 중",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merge_user": {
"id": 87854,
"name": "Douwe Maan",
"username": "DouweM",
"state": "활동 중",
"avatar_url": "https://gitlab.example.com/uploads/-/system/user/avatar/87854/avatar.png",
"web_url": "https://gitlab.com/DouweM"
},
"merged_at": "2018-09-07T11:16:17.520Z",
"merge_after": "2018-09-07T11:16:00.000Z",
"prepared_at": "2018-09-04T11:16:17.520Z",
"closed_by": null,
"closed_at": null,
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
"latest_build_finished_at": "2018-09-07T08:07:06.012Z",
"first_deployed_to_production_at": null,
"pipeline": {
"id": 29626725,
"sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
"ref": "patch-28",
"status": "성공",
"web_url": "https://gitlab.example.com/my-group/my-project/pipelines/29626725"
},
"diff_refs": {
"base_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00",
"head_sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
"start_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00"
},
"diverged_commits_count": 2,
"task_completion_status": {
"count": 0,
"completed_count": 0
}
}
응답 데이터에 대한 중요한 노트는 단일 병합 요청 응답 노트를 참조하세요.
할 일 항목 생성
현재 사용자의 병합 요청에 대해 수동으로 할 일 항목을 생성합니다.
해당 병합 요청에 대해 사용자의 할 일 항목이 이미 존재하는 경우, 이 엔드포인트는 상태 코드 HTTP 304 Not Modified
를 반환합니다.
POST /projects/:id/merge_requests/:merge_request_iid/todo
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로입니다. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID입니다. |
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/5/merge_requests/27/todo"
예시 응답:
{
"id": 113,
"project": {
"id": 3,
"name": "GitLab CI/CD",
"name_with_namespace": "GitLab Org / GitLab CI/CD",
"path": "gitlab-ci",
"path_with_namespace": "gitlab-org/gitlab-ci"
},
"author": {
"name": "관리자",
"username": "root",
"id": 1,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
"web_url": "https://gitlab.example.com/root"
},
"action_name": "표시됨",
"target_type": "MergeRequest",
"target": {
"id": 27,
"iid": 7,
"project_id": 3,
"title": "Et voluptas laudantium minus nihil recusandae ut accusamus earum aut non.",
"description": "Veniam sunt nihil modi earum cumque illum delectus. Nihil ad quis distinctio quia. Autem eligendi at quibusdam repellendus.",
"state": "merged",
"created_at": "2016-06-17T07:48:04.330Z",
"updated_at": "2016-07-01T11:14:15.537Z",
"target_branch": "allow_regex_for_project_skip_ref",
"source_branch": "backup",
"upvotes": 0,
"downvotes": 0,
"author": {
"name": "Jarret O'Keefe",
"username": "francisca",
"id": 14,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/a7fa515d53450023c83d62986d0658a8?s=80&d=identicon",
"web_url": "https://gitlab.example.com/francisca",
"discussion_locked": false
},
"assignee": {
"name": "Dr. Gabrielle Strosin",
"username": "barrett.krajcik",
"id": 4,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/733005fcd7e6df12d2d8580171ccb966?s=80&d=identicon",
"web_url": "https://gitlab.example.com/barrett.krajcik"
},
"assignees": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"reviewers": [{
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
"web_url": "https://gitlab.example.com/axel.block"
}],
"source_project_id": 3,
"target_project_id": 3,
"labels": [],
"draft": false,
"work_in_progress": false,
"milestone": {
"id": 27,
"iid": 2,
"project_id": 3,
"title": "v1.0",
"description": "Quis ea accusantium animi hic fuga assumenda.",
"state": "active",
"created_at": "2016-06-17T07:47:33.840Z",
"updated_at": "2016-06-17T07:47:33.840Z",
"due_date": null
},
"merge_when_pipeline_succeeds": false,
"merge_status": "unchecked",
"detailed_merge_status": "not_open",
"subscribed": true,
"sha": "8888888888888888888888888888888888888888",
"merge_commit_sha": null,
"squash_commit_sha": null,
"user_notes_count": 7,
"changes_count": "1",
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"squash": false,
"web_url": "http://example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
}
},
"target_url": "https://gitlab.example.com/gitlab-org/gitlab-ci/merge_requests/7",
"body": "Et voluptas laudantium minus nihil recusandae ut accusamus earum aut non.",
"state": "pending",
"created_at": "2016-07-01T11:14:15.530Z"
}
병합 요청 차이 버전 가져오기
병합 요청 차이 버전의 목록을 가져옵니다.
GET /projects/:id/merge_requests/:merge_request_iid/versions
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
String | 예 | 프로젝트의 ID입니다. |
merge_request_iid |
integer | 예 | 병합 요청의 내부 ID입니다. |
응답에서의 SHAs에 대한 설명은 API 응답에서의 SHAs를 참조하세요.
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/merge_requests/1/versions"
예시 응답:
[{
"id": 110,
"head_commit_sha": "33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30",
"base_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
"start_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
"created_at": "2016-07-26T14:44:48.926Z",
"merge_request_id": 105,
"state": "collected",
"real_size": "1",
"patch_id_sha": "d504412d5b6e6739647e752aff8e468dde093f2f"
}, {
"id": 108,
"head_commit_sha": "3eed087b29835c48015768f839d76e5ea8f07a24",
"base_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
"start_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
"created_at": "2016-07-25T14:21:33.028Z",
"merge_request_id": 105,
"state": "collected",
"real_size": "1",
"patch_id_sha": "72c30d1f0115fc1d2bb0b29b24dc2982cbcdfd32"
}]
API 응답에서의 SHAs
SHA 필드 | 목적 |
---|---|
base_commit_sha |
소스 브랜치와 타겟 브랜치 사이의 병합 기반 커밋 SHA입니다. |
head_commit_sha |
소스 브랜치의 HEAD 커밋입니다. |
start_commit_sha |
이 버전의 차이가 생성된 타겟 브랜치의 HEAD 커밋 SHA입니다. |
단일 병합 요청 차이 버전 가져오기
단일 병합 요청 차이 버전을 가져옵니다.
GET /projects/:id/merge_requests/:merge_request_iid/versions/:version_id
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
String | 예 | 프로젝트의 ID입니다. |
merge_request_iid |
integer | 예 | 병합 요청의 내부 ID입니다. |
version_id |
integer | 예 | 병합 요청 차이 버전의 ID입니다. |
unidiff |
boolean | 아니오 | 통합 차이 형식으로 차이를 표시합니다. 기본값은 false입니다. 추가됨 GitLab 16.5에서 도입됨. |
성공적일 경우 200 OK
를 반환하며, 다음 응답 속성을 포함합니다:
속성 | 유형 | 설명 |
---|---|---|
id |
integer | 병합 요청 차이 버전의 ID입니다. |
base_commit_sha |
string | 소스 브랜치와 타겟 브랜치 사이의 병합 기반 커밋 SHA입니다. |
commits |
객체 배열 | 병합 요청 차이의 커밋 목록입니다. |
commits[].id |
string | 커밋의 ID입니다. |
commits[].short_id |
string | 커밋의 짧은 ID입니다. |
commits[].created_at |
datetime |
committed_date 필드와 동일합니다. |
commits[].parent_ids |
배열 | 부모 커밋의 ID입니다. |
commits[].title |
string | 커밋 제목입니다. |
commits[].message |
string | 커밋 메시지입니다. |
commits[].author_name |
string | 커밋 작성자의 이름입니다. |
commits[].author_email |
string | 커밋 작성자의 이메일 주소입니다. |
commits[].authored_date |
datetime | 커밋 작성 날짜입니다. |
commits[].committer_name |
string | 커밋 생성자의 이름입니다. |
commits[].committer_email |
string | 커밋 생성자의 이메일 주소입니다. |
commits[].committed_date |
datetime | 커밋 날짜입니다. |
commits[].trailers |
객체 | 커밋에 대해 파싱된 Git 트레일러입니다. 중복 키는 마지막 값만 포함됩니다. |
commits[].extended_trailers |
객체 | 커밋에 대해 파싱된 Git 트레일러입니다. |
commits[].web_url |
string | 병합 요청의 웹 URL입니다. |
created_at |
datetime | 병합 요청의 생성 날짜 및 시간입니다. |
diffs |
객체 배열 | 병합 요청 차이 버전의 차이 목록입니다. |
diffs[].diff |
string | 차이의 내용입니다. |
diffs[].new_path |
string | 파일의 새로운 경로입니다. |
diffs[].old_path |
string | 파일의 이전 경로입니다. |
diffs[].a_mode |
string | 파일의 이전 파일 모드입니다. |
diffs[].b_mode |
string | 파일의 새로운 파일 모드입니다. |
diffs[].new_file |
boolean | 추가된 파일을 나타냅니다. |
diffs[].renamed_file |
boolean | 이름이 변경된 파일을 나타냅니다. |
diffs[].deleted_file |
boolean | 제거된 파일을 나타냅니다. |
diffs[].generated_file |
boolean | 파일이 생성된 것으로 표시됨인지 나타냅니다. 추가됨 GitLab 16.9에서 도입됨. |
head_commit_sha |
string | 소스 브랜치의 HEAD 커밋입니다. |
merge_request_id |
integer | 병합 요청의 ID입니다. |
patch_id_sha |
string | 병합 요청 차이에 대한 패치 ID입니다. |
real_size |
string | 병합 요청 차이의 변경 수입니다. |
start_commit_sha |
string | 이 버전의 차이가 생성된 타겟 브랜치의 HEAD 커밋 SHA입니다. |
state |
string | 병합 요청 차이의 상태입니다. collected , overflow , without_files 일 수 있습니다. 사용 중단된 값: timeout , overflow_commits_safe_size , overflow_diff_files_limit , overflow_diff_lines_limit . |
예시 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/merge_requests/1/versions/1"
예시 응답:
{
"id": 110,
"head_commit_sha": "33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30",
"base_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
"start_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
"created_at": "2016-07-26T14:44:48.926Z",
"merge_request_id": 105,
"state": "collected",
"real_size": "1",
"patch_id_sha": "d504412d5b6e6739647e752aff8e468dde093f2f",
"commits": [{
"id": "33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30",
"short_id": "33e2ee85",
"parent_ids": [],
"title": "Change year to 2018",
"author_name": "Administrator",
"author_email": "admin@example.com",
"authored_date": "2016-07-26T17:44:29.000+03:00",
"committer_name": "Administrator",
"committer_email": "admin@example.com",
"committed_date": "2016-07-26T17:44:29.000+03:00",
"created_at": "2016-07-26T17:44:29.000+03:00",
"message": "Change year to 2018",
"trailers": {},
"extended_trailers": {},
"web_url": "https://gitlab.example.com/project/-/commit/33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30"
}, {
"id": "aa24655de48b36335556ac8a3cd8bb521f977cbd",
"short_id": "aa24655d",
"parent_ids": [],
"title": "Update LICENSE",
"author_name": "Administrator",
"author_email": "admin@example.com",
"authored_date": "2016-07-25T17:21:53.000+03:00",
"committer_name": "Administrator",
"committer_email": "admin@example.com",
"committed_date": "2016-07-25T17:21:53.000+03:00",
"created_at": "2016-07-25T17:21:53.000+03:00",
"message": "Update LICENSE",
"trailers": {},
"extended_trailers": {},
"web_url": "https://gitlab.example.com/project/-/commit/aa24655de48b36335556ac8a3cd8bb521f977cbd"
}, {
"id": "3eed087b29835c48015768f839d76e5ea8f07a24",
"short_id": "3eed087b",
"parent_ids": [],
"title": "Add license",
"author_name": "Administrator",
"author_email": "admin@example.com",
"authored_date": "2016-07-25T17:21:20.000+03:00",
"committer_name": "Administrator",
"committer_email": "admin@example.com",
"committed_date": "2016-07-25T17:21:20.000+03:00",
"created_at": "2016-07-25T17:21:20.000+03:00",
"message": "Add license",
"trailers": {},
"extended_trailers": {},
"web_url": "https://gitlab.example.com/project/-/commit/3eed087b29835c48015768f839d76e5ea8f07a24"
}],
"diffs": [{
"old_path": "LICENSE",
"new_path": "LICENSE",
"a_mode": "0",
"b_mode": "100644",
"diff": "@@ -0,0 +1,21 @@\n+The MIT License (MIT)\n+\n+Copyright (c) 2018 Administrator\n+\n+Permission is hereby granted, free of charge, to any person obtaining a copy\n+of this software and associated documentation files (the \"Software\"), to deal\n+in the Software without restriction, including without limitation the rights\n+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+copies of the Software, and to permit persons to whom the Software is\n+furnished to do so, subject to the following conditions:\n+\n+The above copyright notice and this permission notice shall be included in all\n+copies or substantial portions of the Software.\n+\n+THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+SOFTWARE.\n",
"new_file": true,
"renamed_file": false,
"deleted_file": false,
"generated_file": false
}]
}
병합 요청에 대한 시간 추정 설정
이 병합 요청에 대한 작업 예상 시간을 설정합니다.
POST /projects/:id/merge_requests/:merge_request_iid/time_estimate
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로입니다. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID입니다. |
duration |
문자열 | 예 |
3h30m 과 같은 사람 형식의 기간입니다. |
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/5/merge_requests/93/time_estimate?duration=3h30m"
예시 응답:
{
"human_time_estimate": "3h 30m",
"human_total_time_spent": null,
"time_estimate": 12600,
"total_time_spent": 0
}
병합 요청에 대한 시간 추정 초기화
이 병합 요청에 대한 예상 시간을 0초로 초기화합니다.
POST /projects/:id/merge_requests/:merge_request_iid/reset_time_estimate
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로입니다. |
merge_request_iid |
정수 | 예 | 프로젝트의 병합 요청 내부 ID입니다. |
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/5/merge_requests/93/reset_time_estimate"
예시 응답:
{
"human_time_estimate": null,
"human_total_time_spent": null,
"time_estimate": 0,
"total_time_spent": 0
}
병합 요청에 대한 소요 시간 추가
이 병합 요청에 대한 소요 시간을 추가합니다.
POST /projects/:id/merge_requests/:merge_request_iid/add_spent_time
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로입니다. |
merge_request_iid |
정수 | 예 | 병합 요청의 내부 ID입니다. |
duration |
문자열 | 예 |
3h30m 과 같은 사람 형식의 기간입니다. |
summary |
문자열 | 아니오 | 시간을 어떻게 보냈는지에 대한 요약입니다. |
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/5/merge_requests/93/add_spent_time?duration=1h"
예시 응답:
{
"human_time_estimate": null,
"human_total_time_spent": "1h",
"time_estimate": 0,
"total_time_spent": 3600
}
Merge Request의 소요 시간 재설정
이 Merge Request의 총 소요 시간을 0초로 재설정합니다.
POST /projects/:id/merge_requests/:merge_request_iid/reset_spent_time
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
integer or string | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로입니다. |
merge_request_iid |
integer | 예 | 프로젝트의 Merge Request의 내부 ID입니다. |
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/5/merge_requests/93/reset_spent_time"
예시 응답:
{
"human_time_estimate": null,
"human_total_time_spent": null,
"time_estimate": 0,
"total_time_spent": 0
}
시간 추적 통계 가져오기
GET /projects/:id/merge_requests/:merge_request_iid/time_stats
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
integer or string | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로입니다. |
merge_request_iid |
integer | 예 | Merge Request의 내부 ID입니다. |
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/5/merge_requests/93/time_stats"
예시 응답:
{
"human_time_estimate": "2h",
"human_total_time_spent": "1h",
"time_estimate": 7200,
"total_time_spent": 3600
}
승인
승인에 대해서는 Merge Request 승인을 참조하십시오.
Merge Request 상태 이벤트 목록
어떤 상태가 설정되었는지, 누가 했는지, 언제 발생했는지 추적하려면 자원 상태 이벤트 API를 확인하세요.
문제 해결
새로운 Merge Request에 대한 빈 API 필드
Merge Request를 생성할 때 diff_refs
와 changes_count
필드는 처음에 비어 있습니다. 이러한 필드는 Merge Request를 생성한 후 비동기적으로 채워집니다. 자세한 내용은 문제 386562과 GitLab 포럼의 관련 토론을 참조하세요.