xia_engine_gitlab.engine_merge_request.GitlabMergeRequestEngineClient
- class xia_engine_gitlab.engine_merge_request.GitlabMergeRequestEngineClient(api_host: str, api_token: str, **kwargs)
Bases:
GitlabEngineClient
- __init__(api_host: str, api_token: str, **kwargs)
Methods
__init__
(api_host, api_token, **kwargs)check_file_exists
(project_id, branch, path)check_response
(response)commit_file
(project_id, branch, path, ...[, ...])create_branch
(project_id, branch_name, ref)create_merge_request
(project_id, title, ...)delete_branch
(project_id, branch_name)delete_merge_request
(project_name, ...)extract_errors
(pipeline_text)Extract Errors
get_branch_info
(project_id, branch_name)get_default_branch_from_name
(api_endpoint, ...)Get default branch name from the given name
get_file_content
(project_id, branch, path[, ...])Get file content
get_group_id_from_name
(api_endpoint, ...)get_issue_branch_name
(issue_name, issue_iid)get_issue_commit_name
(issue_name, issue_iid)get_issue_iid_from_name
(api_endpoint, ...)get_issue_mr_name
(issue_name, issue_iid)get_merge_request
(project_name, ...)Get Merge Request
get_merge_request_commits
(project_id, title)get_milestone_branch_name
(milestone_name)get_milestone_id_from_name
(api_endpoint, ...)get_milestone_info_from_issue
(api_endpoint, ...)get_milestone_mr_name
(milestone_name)get_mr_iid_from_branch
(api_endpoint, ...[, ...])get_mr_iid_from_name
(api_endpoint, ...)get_mr_iid_from_title
(api_endpoint, ...)get_pipeline_error
(project_name, pipeline_id)get_project_id_from_name
(api_endpoint, ...)merge_merge_request
(project_id, title[, ...])new_merge_request
(project_name, ...)parse_commands
(section_text, command_splitter)parse_section
(pipeline_text)Parse Pipeline errors
pipeline_exists
(api_endpoint, api_token, ...)rebase_merge_request
(project_id, title)split_header_body
(full_content)update_merge_request
(project_name, ...)- classmethod extract_errors(pipeline_text: str)
Extract Errors
- Parameters
pipeline_text – Trace of pipeline
- Returns
Error Message
- classmethod get_default_branch_from_name(api_endpoint: str, api_token: str, project_id: int) str
Get default branch name from the given name
- Parameters
api_endpoint –
api_token –
project_id –
Returns:
- get_file_content(project_id, branch: str, path: str, with_encoding: bool = False)
Get file content
- Returns
when with_encoding is true and the content is binary, will return base64 string instead binary result
- get_merge_request(project_name: str, milestone_name: str, issue_name: str) dict
Get Merge Request
- Parameters
project_name – Project name which holds the merge request
milestone_name – Milestone name
issue_name – Issue name
- Returns
merge request details
- classmethod parse_section(pipeline_text: str)
Parse Pipeline errors
- Parameters
pipeline_text – Pipeline result text
- Returns
a dictionary of impacted file list and essential error message