Draft Notes API

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-Managed형, GitLab Dedicated

Draft notes는 Merge Request에 대한 보류 중이며 발행되지 않은 의견입니다. 이들은 토론을 시작하거나 기존 토론에 답변으로 연결될 수 있습니다. 발행되기 전까지는 작성자만 볼 수 있습니다.

모든 Merge Request의 드래프트 노트 나열

단일 Merge Request에 대한 모든 드래프트 노트의 디렉터리을 얻습니다.

GET /projects/:id/merge_requests/:merge_request_iid/draft_notes
속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로
merge_request_iid 정수 프로젝트 Merge Request의 IID
[{
  id: 5,
  author_id: 23,
  merge_request_id: 11,
  resolve_discussion: false,
  discussion_id: nil,
  note: "예시 제목",
  commit_id: nil,
  line_code: nil,
  position:
  {
    base_sha: nil,
    start_sha: nil,
    head_sha: nil,
    old_path: nil,
    new_path: nil,
    position_type: "text",
    old_line: nil,
    new_line: nil,
    line_range: nil
  }
}]
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/14/merge_requests/11/draft_notes"

단일 드래프트 노트 얻기

특정 Merge Request에 대한 단일 드래프트 노트를 반환합니다.

GET /projects/:id/merge_requests/:merge_request_iid/draft_notes/:draft_note_id
속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
draft_note_id 정수 드래프트 노트의 ID.
merge_request_iid 정수 프로젝트 Merge Request의 IID.
{
  id: 5,
  author_id: 23,
  merge_request_id: 11,
  resolve_discussion: false,
  discussion_id: nil,
  note: "예시 제목",
  commit_id: nil,
  line_code: nil,
  position:
  {
    base_sha: nil,
    start_sha: nil,
    head_sha: nil,
    old_path: nil,
    new_path: nil,
    position_type: "text",
    old_line: nil,
    new_line: nil,
    line_range: nil
  }
}
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/14/merge_requests/11/draft_notes/5"

드래프트 노트 생성

특정 Merge Request에 대한 드래프트 노트를 생성합니다.

POST /projects/:id/merge_requests/:merge_request_iid/draft_notes
속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
merge_request_iid 정수 프로젝트 Merge Request의 IID.
note 문자열 노트 내용.
commit_id 문자열 아니요 드래프트 노트를 연결할 커밋의 SHA.
in_reply_to_discussion_id 문자열 아니요 드래프트 노트가 응답하는 토론의 ID.
resolve_discussion 부울 아니요 관련된 토론을 해결해야 함.
position[base_sha] 문자열 소스 브랜치의 베이스 커밋 SHA.
position[head_sha] 문자열 Merge Request의 HEAD를 참조하는 SHA.
position[start_sha] 문자열 대상 브랜치에서 커밋을 참조하는 SHA.
position[new_path] 문자열 예 (position 타입이 text인 경우) 변경 후 파일 경로.
position[old_path] 문자열 예 (position 타입이 text인 경우) 변경 전 파일 경로.
position[position_type] 문자열 위치 참조의 유형. 허용된 값: text 또는 image.
position 해시 아니요 차이 노트를 생성할 때 위치.
position[new_line] 정수 아니요 text 차이 노트의 경우 변경 후 라인 번호.
position[old_line] 정수 아니요 text 차이 노트의 경우 변경 전 라인 번호.
position[line_range] 해시 아니요 다중 라인 차이 노트의 라인 범위.
position[width] 정수 아니요 image 차이 노트의 이미지 폭.
position[height] 정수 아니요 image 차이 노트의 이미지 높이.
position[x] 부동 소수 아니요 image 차이 노트의 X 좌표.
position[y] 부동 소수 아니요 image 차이 노트의 Y 좌표.
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/14/merge_requests/11/draft_notes?note=note"

기존 드래프트 노트 수정

특정 Merge Request에 대한 드래프트 노트를 수정합니다.

PUT /projects/:id/merge_requests/:merge_request_iid/draft_notes/:draft_note_id
속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
draft_note_id 정수 드래프트 노트의 ID.
merge_request_iid 정수 프로젝트 Merge Request의 IID.
note 문자열 아니요 노트 내용.
position[base_sha] 문자열 소스 브랜치의 베이스 커밋 SHA.
position[head_sha] 문자열 Merge Request의 HEAD를 참조하는 SHA.
position[start_sha] 문자열 대상 브랜치에서 커밋을 참조하는 SHA.
position[new_path] 문자열 예 (position 타입이 text인 경우) 변경 후 파일 경로.
position[old_path] 문자열 예 (position 타입이 text인 경우) 변경 전 파일 경로.
position[position_type] 문자열 위치 참조의 유형. 허용된 값: text 또는 image.
position 해시 아니요 차이 노트를 생성할 때 위치.
position[new_line] 정수 아니요 text 차이 노트의 경우 변경 후 라인 번호.
position[old_line] 정수 아니요 text 차이 노트의 경우 변경 전 라인 번호.
position[line_range] 해시 아니요 다중 라인 차이 노트의 라인 범위.
position[width] 정수 아니요 image 차이 노트의 이미지 폭.
position[height] 정수 아니요 image 차이 노트의 이미지 높이.
position[x] 부동 소수 아니요 image 차이 노트의 X 좌표.
position[y] 부동 소수 아니요 image 차이 노트의 Y 좌표.
curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/14/merge_requests/11/draft_notes/5"

드래프트 노트 삭제

지정된 Merge Request에 대한 기존 드래프트 노트를 삭제합니다.

DELETE /projects/:id/merge_requests/:merge_request_iid/draft_notes/:draft_note_id
속성 유형 필수 여부 설명
draft_note_id 정수 드래프트 노트의 ID입니다.
id 정수 또는 문자열 프로젝트의 ID 또는 URL-인코딩된 경로입니다.
merge_request_iid 정수 프로젝트 Merge Request의 IID입니다.
curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/14/merge_requests/11/draft_notes/5"

드래프트 노트 게시

지정된 Merge Request에 대한 기존 드래프트 노트를 게시합니다.

PUT /projects/:id/merge_requests/:merge_request_iid/draft_notes/:draft_note_id/publish
속성 유형 필수 여부 설명
draft_note_id 정수 드래프트 노트의 ID입니다.
id 정수 또는 문자열 프로젝트의 ID 또는 URL-인코딩된 경로입니다.
merge_request_iid 정수 프로젝트 Merge Request의 IID입니다.
curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/14/merge_requests/11/draft_notes/5/publish"

대기 중인 모든 드래프트 노트 게시

사용자에 속한 지정된 Merge Request에 대한 모든 기존 드래프트 노트를 일괄 게시합니다.

POST /projects/:id/merge_requests/:merge_request_iid/draft_notes/bulk_publish
속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL-인코딩된 경로입니다.
merge_request_iid 정수 프로젝트 Merge Request의 IID입니다.
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/14/merge_requests/11/draft_notes/bulk_publish"