{"info":{"_postman_id":"6c664b90-f137-41a9-a476-71688a7338bf","name":"GitHub PR Review System – API Documentation","description":"<html><head></head><body><h4 id=\"this-documentation-provides-a-complete-overview-of-the-restful-and-ninja-based-apis-used-in-the-github-pr-review-system-the-system-enables-automated-code-analysis-for-github-pull-requests-using-an-llm-streamlining-the-review-process-by-identifying-potential-issues-and-offering-improvement-suggestions\">This documentation provides a complete overview of the <em>RESTful</em> <em>and</em> <em>Ninja-based APIs</em> used in the <em><strong>GitHub PR Review System</strong></em>. The system enables <em>automated code analysis for GitHub pull requests using an</em> <em>LLM</em>, streamlining the review process by identifying potential issues and offering improvement suggestions.</h4>\n<h2 id=\"key-features-include\">Key features include:</h2>\n<ul>\n<li><p><strong>GitHub PR integration for fetching code files.</strong></p>\n</li>\n<li><p><strong>Background task handling via Celery and Redis.</strong></p>\n</li>\n<li><p><strong>LLM-powered code review responses.</strong></p>\n</li>\n<li><p><strong>Secure endpoints for triggering and retrieving review results.</strong></p>\n</li>\n</ul>\n<h4 id=\"use-this-guide-to-understand-the-available-endpoints-requestresponse-formats-and-authentication-requirements\">Use this guide to understand the available endpoints, request/response formats, and authentication requirements.</h4>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"32119544","collectionId":"6c664b90-f137-41a9-a476-71688a7338bf","publishedId":"2sB2cUB3Vs","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2025-04-05T11:02:46.000Z"},"item":[{"name":"Successful Request To Analyze PR's Code","item":[{"name":"Successful Request To Analyze PR Of Public Repository","id":"b804439c-99e6-4c46-bf23-abc1a517c1d1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"repo_url\": \"https://github.com/Gaurav-714/Notes-API\",\n    \"pr_branch\": \"feature-branch\",\n    \"pr_number\": 1,\n    \"github_token\": \"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\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:8000/api/analyze-pr/","description":"<h3 id=\"field-descriptions\">Field Descriptions:</h3>\n<ul>\n<li><p><strong><code>repo_url</code></strong> <em>(string)</em>: Full URL of the GitHub repository containing the pull request.</p>\n</li>\n<li><p><strong><code>pr_branch</code></strong> <em>(string)</em>: The name of the branch associated with the pull request.</p>\n</li>\n<li><p><strong><code>pr_number</code></strong> <em>(integer)</em>: The pull request number (as shown on GitHub).</p>\n</li>\n<li><p><strong><code>github_token</code></strong> <em>(string)</em>: Not mandatory for public repositories.</p>\n</li>\n</ul>\n","urlObject":{"protocol":"http","port":"8000","path":["api","analyze-pr",""],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"ef99d2e7-fb37-4e7e-94c3-d4bc58520e4e","name":"PR Review Request Without GitHub Token For Public Repository","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"repo_url\": \"https://github.com/Gaurav-714/Notes-API\",\n    \"pr_branch\": \"feature-branch\",\n    \"pr_number\": 1,\n    \"github_token\": null\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:8000/api/analyze-pr/e"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 31 Mar 2025 05:14:22 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.12.9"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"188"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Vary","value":"origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"You can check the results using analysis id.\",\n    \"details\": {\n        \"success\": true,\n        \"analysis_id\": \"0ce20579-713a-40dc-94ea-1d596280fcad\",\n        \"status\": \"Started Analyzing Pull Request\"\n    }\n}"}],"_postman_id":"b804439c-99e6-4c46-bf23-abc1a517c1d1"},{"name":"Successful Request To Analyze PR Of Private Repository","id":"f1e057d4-6940-4d64-8071-59d30d31e68b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"repo_url\": \"https://github.com/Gaurav-714/Notes-API\",\n    \"pr_branch\": \"feature-branch\",\n    \"pr_number\": 1,\n    \"github_token\": \"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\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:8000/api/analyze-pr/","description":"<h3 id=\"field-descriptions\">Field Descriptions:</h3>\n<ul>\n<li><p><strong><code>repo_url</code></strong> <em>(string)</em>: Full URL of the GitHub repository containing the pull request.</p>\n</li>\n<li><p><strong><code>pr_branch</code></strong> <em>(string)</em>: The name of the branch associated with the pull request.</p>\n</li>\n<li><p><strong><code>pr_number</code></strong> <em>(integer)</em>: The pull request number (as shown on GitHub).</p>\n</li>\n<li><p><strong><code>github_token</code></strong> <em>(string)</em>: A valid GitHub personal access token with appropriate permissions to access the private repository and pull request files.</p>\n</li>\n</ul>\n<h4 id=\"⚠️-note-make-sure-your-github-token-has-repo-scope-for-private-repositories\">⚠️ <strong>Note:</strong> Make sure your GitHub token has <code>repo</code> scope for private repositories.</h4>\n","urlObject":{"protocol":"http","port":"8000","path":["api","analyze-pr",""],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"920372ec-d45d-44fe-86e1-c9e7399be968","name":"PR Review Request With GitHub Token For Private Repository","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"repo_url\": \"https://github.com/Gaurav-714/Notes-API\",\n    \"pr_branch\": \"feature-branch\",\n    \"pr_number\": 1,\n    \"github_token\": \"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\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:8000/api/analyze-pr/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 31 Mar 2025 05:42:07 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.12.9"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"188"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Vary","value":"origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"You can check the results using analysis id.\",\n    \"details\": {\n        \"success\": true,\n        \"analysis_id\": \"b00a839e-0942-4efe-a011-969ace888c2c\",\n        \"status\": \"Started Analyzing Pull Request\"\n    }\n}"}],"_postman_id":"f1e057d4-6940-4d64-8071-59d30d31e68b"}],"id":"2ead6393-abfb-4556-86b3-ebb7c24d91a3","description":"<p>This folder contains example request bodies used to initiate pull request analysis. These examples demonstrate the correct structure and values required to trigger the code review process.</p>\n<ul>\n<li><p>Request includes: <code>repo_url</code>, <code>pr_branch</code>, <code>pr_number</code>, and <code>github_token.</code></p>\n</li>\n<li><p>On successful request, an <code>analysis_id</code> is returned.</p>\n</li>\n<li><p>The code analysis is then processed asynchronously in the background.</p>\n</li>\n</ul>\n","_postman_id":"2ead6393-abfb-4556-86b3-ebb7c24d91a3"},{"name":"Successful Result Response Of PR Analysis","item":[{"name":"Successful PR's Analysis Result For Public Repository","id":"420afa63-71e8-446f-bc38-541ceebde6b2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/937b64d0-983d-4721-8351-626a9a075d1f/","description":"<h4 id=\"use-analysis_id-in-a-result-endpoint-to-fetch-the-completed-analysis-report\"><strong>Use</strong> <code>analysis_id</code> in a result endpoint to <strong>fetch the completed analysis report.</strong></h4>\n","urlObject":{"protocol":"http","port":"8000","path":["api","view-status","937b64d0-983d-4721-8351-626a9a075d1f",""],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"60ce1f8d-54f0-42dc-a236-600daefd574f","name":"Successful Analysis Result For Public Repository","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/0ce20579-713a-40dc-94ea-1d596280fcad/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 31 Mar 2025 05:15:07 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.12.9"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"5691"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Vary","value":"origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"analysis_id\": \"0ce20579-713a-40dc-94ea-1d596280fcad\",\n    \"status\": \"SUCCESS\",\n    \"result\": {\n        \"analysis_id\": \"7b6c1807-4db3-48c0-9faf-1f024f55a52d\",\n        \"status\": \"SUCCESS\",\n        \"result\": [\n            {\n                \"file_name\": \"core/.gitignore\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 0,\n                            \"description\": \"No code provided in the pull request\",\n                            \"suggestion\": \"Please provide the actual code for review\"\n                        }\n                    ]\n                }\n            },\n            {\n                \"file_name\": \"core/Dockerfile\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"performance\",\n                            \"line\": 0,\n                            \"description\": \"Using pip3 instead of pip can be slower and less efficient. Consider using pip instead.\",\n                            \"suggestion\": \"Replace pip3 with pip\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The Dockerfile does not specify a Docker image tag. This can lead to unexpected behavior and make it difficult to manage different versions of the application.\",\n                            \"suggestion\": \"Specify a Docker image tag, for example, 'latest'\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The Dockerfile does not specify a Docker image author. This information is useful for tracking and managing different versions of the application.\",\n                            \"suggestion\": \"Specify a Docker image author, for example, 'Your Name <your.name@example.com>'\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The Dockerfile does not specify a Docker image maintainer. This information is useful for tracking and managing different versions of the application.\",\n                            \"suggestion\": \"Specify a Docker image maintainer, for example, 'Your Name <your.name@example.com>'\"\n                        }\n                    ]\n                }\n            },\n            {\n                \"file_name\": \"core/core/settings.py\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"security\",\n                            \"line\": 0,\n                            \"description\": \"Hardcoded secret key is a security risk. Consider using environment variables or a secrets manager.\",\n                            \"suggestion\": \"Replace the hardcoded secret key with an environment variable or a secrets manager.\"\n                        },\n                        {\n                            \"type\": \"security\",\n                            \"line\": 0,\n                            \"description\": \"Debug mode should not be enabled in production. Consider using environment variables to control debug mode.\",\n                            \"suggestion\": \"Use environment variables to control debug mode, e.g., DEBUG = os.environ.get('DEBUG', False)\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The database configuration is commented out. Consider removing the commented configuration or providing a clear explanation for its presence.\",\n                            \"suggestion\": \"Remove the commented configuration or provide a clear explanation for its presence.\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The project structure and dependencies can be improved for maintainability and scalability. Consider using a consistent naming convention and organizing dependencies by category.\",\n                            \"suggestion\": \"Use a consistent naming convention and organize dependencies by category for better maintainability and scalability.\"\n                        }\n                    ]\n                }\n            },\n            {\n                \"file_name\": \"core/docker-compose.yml\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"File name should not be a version number\",\n                            \"suggestion\": \"Rename the file to a more descriptive name, e.g., docker-compose.yml\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"Missing header or description in the file\",\n                            \"suggestion\": \"Add a header or description to explain the purpose and configuration of the Docker Compose file\"\n                        },\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 5,\n                            \"description\": \"Inconsistent indentation\",\n                            \"suggestion\": \"Use consistent indentation throughout the file (4 spaces)\"\n                        },\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 9,\n                            \"description\": \"Redundant code\",\n                            \"suggestion\": \"Remove redundant `python manage.py` commands and simplify the build command\"\n                        },\n                        {\n                            \"type\": \"security\",\n                            \"line\": 0,\n                            \"description\": \"Missing Docker Compose version specification\",\n                            \"suggestion\": \"Specify the Docker Compose version to ensure compatibility and avoid potential security vulnerabilities\"\n                        }\n                    ]\n                }\n            },\n            {\n                \"file_name\": \"core/home/urls.py\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"This file does not follow PEP8 naming conventions. Consider renaming it to something like 'core_home_urls.py'.\",\n                            \"suggestion\": \"Rename the file to follow PEP8 naming conventions.\"\n                        },\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 0,\n                            \"description\": \"There are no comments or docstrings in this file to explain its purpose or functionality.\",\n                            \"suggestion\": \"Add comments or docstrings to explain the purpose and functionality of this file.\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"This file is too small and simple. Consider breaking it down into smaller modules or functions.\",\n                            \"suggestion\": \"Break down this file into smaller modules or functions to improve modularity and maintainability.\"\n                        }\n                    ]\n                }\n            },\n            {\n                \"file_name\": \"core/home/views.py\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 1,\n                            \"description\": \"Missing import statement for Note model should be from .models import Note\",\n                            \"suggestion\": \"Correct import statement\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 5,\n                            \"description\": \"Missing docstring for NotesList class\",\n                            \"suggestion\": \"Add a docstring to describe the class functionality\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 11,\n                            \"description\": \"Missing docstring for NotesDetail class\",\n                            \"suggestion\": \"Add a docstring to describe the class functionality\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 17,\n                            \"description\": \"Function 'home' should be a method of a class\",\n                            \"suggestion\": \"Move function 'home' to a class\"\n                        },\n                        {\n                            \"type\": \"security\",\n                            \"line\": 0,\n                            \"description\": \"Home view does not require authentication\",\n                            \"suggestion\": \"Add authentication to the home view\"\n                        }\n                    ]\n                }\n            },\n            {\n                \"file_name\": \"core/requirements.txt\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 0,\n                            \"description\": \"File does not contain any code, it's a requirements file\",\n                            \"suggestion\": \"This file should be ignored by the code analysis tool\"\n                        }\n                    ]\n                }\n            }\n        ]\n    }\n}"}],"_postman_id":"420afa63-71e8-446f-bc38-541ceebde6b2"},{"name":"Successful PR's Analysis Result For Private Repository","id":"26d7da8d-53de-4570-aed1-5d56b97b028f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/937b64d0-983d-4721-8351-626a9a075d1f/","description":"<h4 id=\"use-analysis_id-in-a-result-endpoint-to-fetch-the-completed-analysis-report\"><strong>Use</strong> <code>analysis_id</code> in a result endpoint to <strong>fetch the completed analysis report.</strong></h4>\n","urlObject":{"protocol":"http","port":"8000","path":["api","view-status","937b64d0-983d-4721-8351-626a9a075d1f",""],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"6d7c9ff0-271b-43ae-9423-fd40e85af04d","name":"Successful Analysis Result For Private Repository","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/35713949-53ad-4983-9d9b-d5671051983e/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 31 Mar 2025 06:00:58 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.12.9"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"7743"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Vary","value":"origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"analysis_id\": \"35713949-53ad-4983-9d9b-d5671051983e\",\n    \"status\": \"SUCCESS\",\n    \"result\": {\n        \"analysis_id\": \"67a95d41-3593-43c2-8679-5c0f9e0d07fe\",\n        \"status\": \"SUCCESS\",\n        \"result\": [\n            {\n                \"file_name\": \"core/.gitignore\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"No issues detected in this file. However, it's a good practice to include a comment explaining the purpose of the .gitignore file.\",\n                            \"suggestion\": \"Add a comment to explain the purpose of the .gitignore file.\"\n                        },\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 0,\n                            \"description\": \"This file is empty. It's a good practice to include at least one line of code or a comment to make it clear that the file is intentionally left empty.\",\n                            \"suggestion\": \"Add a comment or a line of code to indicate that the file is intentionally left empty.\"\n                        }\n                    ]\n                }\n            },\n            {\n                \"file_name\": \"core/Dockerfile\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"Dockerfile should be in the root of the project\",\n                            \"suggestion\": \"Move Dockerfile to the root directory\"\n                        },\n                        {\n                            \"type\": \"performance\",\n                            \"line\": 0,\n                            \"description\": \"The Docker image is based on an older version of Python\",\n                            \"suggestion\": \"Consider using a more recent version of Python, e.g., 3.12\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The Dockerfile does not include a FROM instruction with a specific tag\",\n                            \"suggestion\": \"Use a specific version of the base image, e.g., FROM python:3.12.0\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The Dockerfile does not include any instructions to set the working directory\",\n                            \"suggestion\": \"Use the WORKDIR instruction to set the working directory to /app\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The Dockerfile does not include any instructions to copy the application code\",\n                            \"suggestion\": \"Use the COPY instruction to copy the application code into the working directory\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The Dockerfile does not include any instructions to set the environment variables\",\n                            \"suggestion\": \"Use the ENV instruction to set any required environment variables\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The Dockerfile does not include any instructions to set the command to run\",\n                            \"suggestion\": \"Use the CMD instruction to set the command to run the application\"\n                        }\n                    ]\n                }\n            },\n            {\n                \"file_name\": \"core/core/settings.py\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"security\",\n                            \"line\": 0,\n                            \"description\": \"Hardcoded secret key is a security risk. Consider using environment variables or a secrets manager.\",\n                            \"suggestion\": \"Replace hardcoded secret key with environment variable or secrets manager.\"\n                        },\n                        {\n                            \"type\": \"security\",\n                            \"line\": 0,\n                            \"description\": \"Hardcoded database credentials are a security risk. Consider using environment variables or a secrets manager.\",\n                            \"suggestion\": \"Replace hardcoded database credentials with environment variable or secrets manager.\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The debug mode is set to True in production. This is a security risk. Consider setting it to False in production.\",\n                            \"suggestion\": \"Set DEBUG to False in production settings.\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The database configuration is commented out. This can cause issues when switching between different database configurations.\",\n                            \"suggestion\": \"Remove commented out database configuration or use a configuration management tool.\"\n                        }\n                    ]\n                }\n            },\n            {\n                \"file_name\": \"core/docker-compose.yml\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 0,\n                            \"description\": \"Inconsistent indentation in YAML file\",\n                            \"suggestion\": \"Use consistent 2-space indentation throughout the file\"\n                        },\n                        {\n                            \"type\": \"performance\",\n                            \"line\": 7,\n                            \"description\": \"Redundant command execution in Docker Compose\",\n                            \"suggestion\": \"Merge commands into a single 'run' command\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"Lack of documentation in Docker Compose file\",\n                            \"suggestion\": \"Add comments to explain the purpose of each service\"\n                        },\n                        {\n                            \"type\": \"security\",\n                            \"line\": 0,\n                            \"description\": \"Potential security risk: hardcoded container name\",\n                            \"suggestion\": \"Use an environment variable or a more secure naming convention\"\n                        }\n                    ]\n                }\n            },\n            {\n                \"file_name\": \"core/home/urls.py\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"File should have a docstring describing its purpose and functionality\",\n                            \"suggestion\": \"Add a docstring at the top of the file to explain its purpose and functionality\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"Consider using a more descriptive filename instead of 'urls.py'\",\n                            \"suggestion\": \"Rename the file to something more descriptive, such as 'note_urls.py' or 'note_routing.py'\"\n                        },\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 0,\n                            \"description\": \"The import statement can be moved to the top of the file to improve readability\",\n                            \"suggestion\": \"Move the import statement to the top of the file\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 5,\n                            \"description\": \"Variable name 'urlpatterns' can be more descriptive\",\n                            \"suggestion\": \"Rename 'urlpatterns' to something more descriptive, such as 'note_routes' or 'note_url_config'\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 6,\n                            \"description\": \"Consider using a more descriptive variable name instead of 'home'\",\n                            \"suggestion\": \"Rename 'home' to something more descriptive, such as 'note_index' or 'note_homepage'\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 8,\n                            \"description\": \"Consider using a more descriptive variable name instead of 'NotesList'\",\n                            \"suggestion\": \"Rename 'NotesList' to something more descriptive, such as 'NoteList' or 'NoteListView'\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 10,\n                            \"description\": \"Consider using a more descriptive variable name instead of 'NotesDetail'\",\n                            \"suggestion\": \"Rename 'NotesDetail' to something more descriptive, such as 'NoteDetail' or 'NoteDetailView'\"\n                        }\n                    ]\n                }\n            },\n            {\n                \"file_name\": \"core/home/views.py\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 0,\n                            \"description\": \"Unused import statement\",\n                            \"suggestion\": \"Remove unused import statement from django.http\"\n                        },\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 0,\n                            \"description\": \"Missing docstring for the class\",\n                            \"suggestion\": \"Add a docstring to describe the purpose of the class\"\n                        },\n                        {\n                            \"type\": \"bug\",\n                            \"line\": 0,\n                            \"description\": \"Missing permission classes for the views\",\n                            \"suggestion\": \"Add permission classes to restrict access to the views\"\n                        },\n                        {\n                            \"type\": \"performance\",\n                            \"line\": 0,\n                            \"description\": \"Using generic views without any custom logic\",\n                            \"suggestion\": \"Consider using custom views to improve performance and readability\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"Missing try-except block for potential exceptions\",\n                            \"suggestion\": \"Add try-except blocks to handle potential exceptions\"\n                        },\n                        {\n                            \"type\": \"security\",\n                            \"line\": 0,\n                            \"description\": \"No authentication or authorization mechanism in place\",\n                            \"suggestion\": \"Implement authentication and authorization mechanisms to secure the API\"\n                        },\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 6,\n                            \"description\": \"Unused import statement\",\n                            \"suggestion\": \"Remove unused import statement from .serializers\"\n                        },\n                        {\n                            \"type\": \"code_quality\",\n                            \"line\": 0,\n                            \"description\": \"Unused function\",\n                            \"suggestion\": \"Remove unused function 'home'\"\n                        }\n                    ]\n                }\n            },\n            {\n                \"file_name\": \"core/requirements.txt\",\n                \"analysis\": {\n                    \"issues\": [\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"The file core/requirements.txt does not contain any code, but rather a list of dependencies. This should be analyzed as a dependencies file, not a code file.\",\n                            \"suggestion\": \"No code to review, but consider analyzing the dependencies for potential issues.\"\n                        },\n                        {\n                            \"type\": \"best_practice\",\n                            \"line\": 0,\n                            \"description\": \"There is no code to review in this file. Consider checking the code in other files or the repository's root directory.\",\n                            \"suggestion\": \"Check the code in other files or the repository's root directory.\"\n                        }\n                    ]\n                }\n            }\n        ]\n    }\n}"}],"_postman_id":"26d7da8d-53de-4570-aed1-5d56b97b028f"},{"name":"Result Processing In Background","id":"98454c93-426f-4a27-a7d7-b315c6d8ee77","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/937b64d0-983d-4721-8351-626a9a075d1f/","description":"<h4 id=\"use-analysis_id-in-a-result-endpoint-to-fetch-the-completed-analysis-report\"><strong>Use</strong> <code>analysis_id</code> in a result endpoint to <strong>fetch the completed analysis report.</strong></h4>\n","urlObject":{"protocol":"http","port":"8000","path":["api","view-status","937b64d0-983d-4721-8351-626a9a075d1f",""],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"7203d6bd-389b-41f2-ba47-c08abfca7ffd","name":"Result Processing In Background","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/8cd82ca5-a5e5-44a7-8268-50080ab7e79a/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 31 Mar 2025 05:27:44 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.12.9"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"76"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Vary","value":"origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"analysis_id\": \"8cd82ca5-a5e5-44a7-8268-50080ab7e79a\",\n    \"status\": \"PENDING\"\n}"}],"_postman_id":"98454c93-426f-4a27-a7d7-b315c6d8ee77"}],"id":"64d78b88-40d6-4c0e-b4dd-1a828d7cb5d4","description":"<h4 id=\"this-folder-contains-example-responses-returned-after-the-analysis-is-completed-these-examples-show-the-kind-of-insights-issues-and-suggestions-generated-by-the-llm\">This folder contains example responses returned after the analysis is completed. These examples show the kind of insights, issues, and suggestions generated by the LLM.</h4>\n<ul>\n<li><p>To view the results, users must send a <strong>GET</strong> request to a different endpoint with the <code>analysis_id.</code></p>\n</li>\n<li><p>The response will include code review suggestions, issues detected, and improvement recommendations.</p>\n</li>\n</ul>\n","_postman_id":"64d78b88-40d6-4c0e-b4dd-1a828d7cb5d4"},{"name":"Invalid Request – Missing Required Fields","item":[{"name":"Request To Access PR And Analyze Code","id":"562dd4c3-9102-456b-93a2-0d8e1b7c43ee","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"repo_url\": \"https://github.com/Gaurav-714/Notes-API\",\n    \"pr_branch\": \"feature-branch\",\n    \"pr_number\": 1,\n    \"github_token\": \"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\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:8000/api/analyze-pr/","description":"<h3 id=\"explanation\">Explanation:</h3>\n<ul>\n<li><p><code>type</code><strong>: Indicates the type of error (</strong><code>missing</code> field in this case).</p>\n</li>\n<li><p><code>loc</code><strong>: Shows where the error occurred (<strong><strong><code>body &gt; analysis_request</code></strong></strong>).</strong></p>\n</li>\n<li><p><code>msg</code><strong>: Human-readable message explaining the issue (<strong><strong><code>Field required</code></strong></strong>).</strong></p>\n</li>\n</ul>\n","urlObject":{"protocol":"http","port":"8000","path":["api","analyze-pr",""],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"29b55327-c200-4d22-a6e9-6cef72cc9011","name":"Required Fields Error","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:8000/api/analyze-pr/"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 31 Mar 2025 05:19:54 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.12.9"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"95"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Vary","value":"origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"detail\": [\n        {\n            \"type\": \"missing\",\n            \"loc\": [\n                \"body\",\n                \"analysis_request\"\n            ],\n            \"msg\": \"Field required\"\n        }\n    ]\n}"}],"_postman_id":"562dd4c3-9102-456b-93a2-0d8e1b7c43ee"}],"id":"12c0ea48-4083-4825-b4d5-af5a38199551","description":"<h4 id=\"if-the-request-body-is-missing-required-fields-or-is-improperly-structured-the-api-will-respond-with-a-400-bad-request-or-422-unprocessable-entity-error-along-with-a-descriptive-message-indicating-what-went-wrong\">If the request body is missing required fields or is improperly structured, the API will respond with a <strong>400 Bad Request</strong> or <strong>422 Unprocessable Entity</strong> error along with a descriptive message indicating what went wrong.</h4>\n<h4 id=\"ensure-all-required-fields-repo_url-pr_branch-pr_number-github_token-are-included-in-the-request-body-to-avoid-this-error\">Ensure all required fields (<code>repo_url</code>, <code>pr_branch</code>, <code>pr_number</code>, <code>github_token</code>) are included in the request body to avoid this error.</h4>\n","_postman_id":"12c0ea48-4083-4825-b4d5-af5a38199551"},{"name":"Errors While Analyzing PR – Analysis Failures","item":[{"name":"Files Content Not Found (Invalid Branch or Missing Files)","id":"1111065c-b6c3-4720-981d-81bf3605b5b7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/937b64d0-983d-4721-8351-626a9a075d1f/","description":"<p><strong>This error occurs when the system is unable to fetch file contents from the specified branch of the repository. Common reasons include:</strong></p>\n<ul>\n<li><p>Invalid or misspelled branch name.</p>\n</li>\n<li><p>The specified files do not exist in the branch.</p>\n</li>\n<li><p>The repository is private and an invalid or missing GitHub token was used.</p>\n</li>\n</ul>\n<p><strong>The system attempts to fetch each file and logs detailed messages indicating which ones failed and why.</strong></p>\n","urlObject":{"protocol":"http","port":"8000","path":["api","view-status","937b64d0-983d-4721-8351-626a9a075d1f",""],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"4df741a9-649b-447c-8ca9-8259d898df70","name":"File Content Not Found Error (Invalid Branch)","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/3a526a2f-25a0-4559-b111-9bb25808f207/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 31 Mar 2025 05:18:28 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.12.9"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"1558"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Vary","value":"origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"analysis_id\": \"3a526a2f-25a0-4559-b111-9bb25808f207\",\n    \"status\": \"FAILED\",\n    \"error\": \"All files failed to process.\",\n    \"details\": [\n        \"Skipping core/.gitignore: File content not found: core/.gitignore in branch feature. Check if the repository is private, you provided a valid token, or if there's an issue with the branch name.\",\n        \"Skipping core/Dockerfile: File content not found: core/Dockerfile in branch feature. Check if the repository is private, you provided a valid token, or if there's an issue with the branch name.\",\n        \"Skipping core/core/settings.py: File content not found: core/core/settings.py in branch feature. Check if the repository is private, you provided a valid token, or if there's an issue with the branch name.\",\n        \"Skipping core/docker-compose.yml: File content not found: core/docker-compose.yml in branch feature. Check if the repository is private, you provided a valid token, or if there's an issue with the branch name.\",\n        \"Skipping core/home/urls.py: File content not found: core/home/urls.py in branch feature. Check if the repository is private, you provided a valid token, or if there's an issue with the branch name.\",\n        \"Skipping core/home/views.py: File content not found: core/home/views.py in branch feature. Check if the repository is private, you provided a valid token, or if there's an issue with the branch name.\",\n        \"Skipping core/requirements.txt: File content not found: core/requirements.txt in branch feature. Check if the repository is private, you provided a valid token, or if there's an issue with the branch name.\"\n    ]\n}"}],"_postman_id":"1111065c-b6c3-4720-981d-81bf3605b5b7"},{"name":"Invalid Data Provided in the Request","id":"3b5a622c-3873-4943-b159-ed4abe447a46","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/3a526a2f-25a0-4559-b111-9bb25808f207/","description":"<h4 id=\"if-the-repository-url-pr-number-or-branch-name-is-incorrect-or-if-the-pull-request-doesnt-exist-the-system-fails-to-locate-the-necessary-resources-this-results-in-an-error-stating-that-the-repository-pr-or-file-could-not-be-found\">If the repository URL, PR number, or branch name is incorrect, or if the pull request doesn't exist, the system fails to locate the necessary resources. This results in an error stating that the repository, PR, or file could not be found.</h4>\n","urlObject":{"protocol":"http","port":"8000","path":["api","view-status","3a526a2f-25a0-4559-b111-9bb25808f207",""],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"e2421f72-d23f-4f8e-a152-43c5cf5a32c5","name":"Provided Invalid Data In The Request","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/1a06d0e5-c2af-4cd2-9ed4-2ca11f067733/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 31 Mar 2025 05:20:51 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.12.9"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"205"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Vary","value":"origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"analysis_id\": \"1a06d0e5-c2af-4cd2-9ed4-2ca11f067733\",\n    \"status\": \"FAILED\",\n    \"error\": \"Error: Repository, PR, or file not found. Check if the repo is private and you provided a valid token.\",\n    \"details\": []\n}"}],"_postman_id":"3b5a622c-3873-4943-b159-ed4abe447a46"},{"name":"Accessing Private Repository Without Valid GitHub Token","id":"f156d39f-d29e-41f9-82e6-2f2690211795","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/3a526a2f-25a0-4559-b111-9bb25808f207/","description":"<p><strong>If the GitHub repository is private and the provided token is missing, expired, or does not have sufficient permissions, the system cannot access the pull request or its files. A generic failure message is returned, advising the user to check the token and repo visibility.</strong></p>\n","urlObject":{"protocol":"http","port":"8000","path":["api","view-status","3a526a2f-25a0-4559-b111-9bb25808f207",""],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"5e6c3d21-40e9-49d1-b8a5-f53faea67a00","name":"Cannot Access Private Repo Without Valid GiitHub Token","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/e712c6f3-686e-4c82-961b-9ebcaebe42d2/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 31 Mar 2025 05:26:00 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.12.9"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"205"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Vary","value":"origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"analysis_id\": \"e712c6f3-686e-4c82-961b-9ebcaebe42d2\",\n    \"status\": \"FAILED\",\n    \"error\": \"Error: Repository, PR, or file not found. Check if the repo is private and you provided a valid token.\",\n    \"details\": []\n}"}],"_postman_id":"f156d39f-d29e-41f9-82e6-2f2690211795"},{"name":"Not Found Error Occurred Due To Invalid Request Data","id":"4cedb410-5e60-4a85-8177-9f258a6887f8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/3a526a2f-25a0-4559-b111-9bb25808f207/","description":"<h4 id=\"this-is-a-catch-all-failure-response-for-scenarios-where-either-the-repository-pull-request-or-associated-files-cannot-be-found-due-to-incorrect-or-malformed-request-data-its-often-caused-by-typos-in-the-url-pr-number-or-missing-values-in-the-request\">This is a catch-all failure response for scenarios where either the repository, pull request, or associated files cannot be found due to incorrect or malformed request data. It's often caused by typos in the URL, PR number, or missing values in the request.</h4>\n","urlObject":{"protocol":"http","port":"8000","path":["api","view-status","3a526a2f-25a0-4559-b111-9bb25808f207",""],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"6df192b5-88af-497c-a274-0d450a1679c8","name":"Not Found Error Invalid Request Data","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/api/view-status/937b64d0-983d-4721-8351-626a9a075d1f/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 31 Mar 2025 05:31:33 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.12.9"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Length","value":"205"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Vary","value":"origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"analysis_id\": \"937b64d0-983d-4721-8351-626a9a075d1f\",\n    \"status\": \"FAILED\",\n    \"error\": \"Error: Repository, PR, or file not found. Check if the repo is private and you provided a valid token.\",\n    \"details\": []\n}"}],"_postman_id":"4cedb410-5e60-4a85-8177-9f258a6887f8"}],"id":"2d3605d9-305a-4cc0-83d0-d1c64b5b8041","description":"<h4 id=\"during-the-pr-code-analysis-process-various-types-of-errors-may-occur-due-to-invalid-inputs-or-access-issues-below-are-examples-of-common-failure-scenarios\">During the PR code analysis process, various types of errors may occur due to invalid inputs or access issues. Below are examples of common failure scenarios.</h4>\n","_postman_id":"2d3605d9-305a-4cc0-83d0-d1c64b5b8041"}]}