merge_pull_request
Merge approved pull requests in Pagure git forges to integrate changes into projects. Specify project, pull request ID, and optional namespace to complete merges.
Instructions
Merge an approved pull request.
Args: project: Project name pr_id: Pull request ID number to merge namespace: Project namespace (default: rpms)
Returns: JSON string with merge result
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| pr_id | Yes | ||
| namespace | No | rpms |
Implementation Reference
- src/pagure/client.py:250-271 (handler)The core implementation of the merge_pull_request method that makes the API request to the Pagure server.
async def merge_pull_request( self, project: str, pr_id: int, namespace: str = "rpms", ) -> Dict[str, Any]: """Merge a pull request. Args: project: Project name pr_id: Pull request ID namespace: Project namespace Returns: Merge result """ response = await self.client.post( f"{self.api_base}/{namespace}/{project}/pull-request/{pr_id}/merge", headers=self._get_headers(), ) response.raise_for_status() return response.json() - src/pagure/server.py:211-230 (handler)The wrapper function for the merge_pull_request tool that calls the client's merge_pull_request method.
async def merge_pull_request( project: str, pr_id: int, namespace: str = "rpms", ) -> str: """Merge an approved pull request. Args: project: Project name pr_id: Pull request ID number to merge namespace: Project namespace (default: rpms) Returns: JSON string with merge result """ client = get_client() result = await client.merge_pull_request(project, pr_id, namespace) import json return json.dumps(result, indent=2)