Conversation
yasandu0505
commented
Mar 6, 2026
- Refactored the code
- Removed unnecessary code snippets
- used enums when necessary
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors and updates the API endpoints related to organizational data, specifically for generating cabinet flow visualizations. It introduces a new, dedicated endpoint for this functionality, centralizing the complex data processing logic within the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the Sankey chart endpoint, moving it to the organisation_router and implementing the service logic in organisation_service, including new asynchronous logic to process data for the cabinet flow. A critical Denial of Service (DoS) vulnerability has been identified in the new endpoint /v1/organisation/cabinet-flow/{president_id}. The code uses unbounded concurrency via asyncio.gather to process multiple dates and ministers, which could be exploited by providing a large list of dates, leading to resource exhaustion and a flood of requests to the internal OpenGIN service. It is highly recommended to implement input validation to limit the number of dates and use a semaphore to control the maximum number of concurrent outgoing requests. Additionally, the review suggests improvements in code style, correctness, and documentation, such as using list comprehensions for conciseness, correcting parameter naming to follow PEP-8, updating docstrings, and addressing a potentially redundant error check.
There was a problem hiding this comment.
update the API Contract with this API endpoint
There was a problem hiding this comment.
@ChanukaUOJ , and there is an issue with the organisation api contract , some syntax error ,can you check it ?
There was a problem hiding this comment.
@ChanukaUOJ check the line no. 756, there is an issue