-
Notifications
You must be signed in to change notification settings - Fork 0
Test and Update API Client Module #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Test and Update API Client Module #126
Conversation
# Motivation The **Codegen on OSS** package provides a pipeline that: - **Collects repository URLs** from different sources (e.g., CSV files or GitHub searches). - **Parses repositories** using the codegen tool. - **Profiles performance** and logs metrics for each parsing run. - **Logs errors** to help pinpoint parsing failures or performance bottlenecks. <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> see [codegen-on-oss/README.md](https://github.com/codegen-sh/codegen-sdk/blob/acfe3dc07b65670af33b977fa1e7bc8627fd714e/codegen-on-oss/README.md) # Testing <!-- How was the change tested? --> `uv run modal run modal_run.py` No unit tests yet 😿 # Please check the following before marking your PR as ready for review - [ ] I have added tests for my changes - [x] I have updated the documentation or added new documentation as needed
Original commit by Tawsif Kamal: Revert "Revert "Adding Schema for Tool Outputs"" (codegen-sh#894) Reverts codegen-sh#892 --------- Co-authored-by: Rushil Patel <[email protected]> Co-authored-by: rushilpatel0 <[email protected]>
Original commit by Ellen Agarwal: fix: Workaround for relace not adding newlines (codegen-sh#907)
Reviewer's GuideThis PR expands the API client modules with a full test harness, hardens configuration by switching to HTTPS and environment‐driven API keys while improving auth and error handling, adds usage documentation for both the CLI and OpenAPI clients, and updates package.json for release management. Sequence Diagram: Retrieving Authentication Settings for API CallssequenceDiagram
title Sequence Diagram: Retrieving Authentication Settings for API Calls
participant ApiClient as API Client Component
participant ConfigInstance as Configuration Instance
ApiClient->>ConfigInstance: auth_settings()
activate ConfigInstance
alt "Authorization" key exists in ConfigInstance.api_key
ConfigInstance->>ConfigInstance: get_api_key_with_prefix("Authorization")
activate ConfigInstance
Note right of ConfigInstance: Returns "Bearer <key_value>" if key_value is non-empty, <br/>"Bearer " if key_value is empty, <br/>or "" if 'Authorization' key is missing in api_key_prefix.
ConfigInstance-->>ConfigInstance: prefixed_api_key
deactivate ConfigInstance
ConfigInstance->>ConfigInstance: Create AuthSettings entry for "Authorization" using prefixed_api_key
else "Authorization" key does not exist in ConfigInstance.api_key
Note over ConfigInstance: No "Authorization" entry added to AuthSettings dictionary by this check.
end
ConfigInstance-->>ApiClient: auth_settings_dict
deactivate ConfigInstance
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
I see a check failed - I'm on it! 🫡 |
✅ Fixed the failing mypy checks in PR #126. The issue was in the The main fixes included:
I've pushed these changes to the PR branch. The mypy checks should now pass. 💻 View my work • React 👍 or 👎 |
Overview
This PR implements comprehensive tests and updates for the API Client module as part of the ZAM-411 issue.
Changes
Added Comprehensive Test Suite:
Improved Configuration:
Added Documentation:
Fixed Issues:
Testing
The PR includes a comprehensive test suite that covers:
Related Issues
💻 View my work • About Codegen
Note
I'm currently writing a description for your pull request. I should be done shortly (<1 minute). Please don't edit the description field until I'm finished, or we may overwrite each other. If I find nothing to write about, I'll delete this message.
Summary by Sourcery
Add extensive test coverage for both OpenAPI and CLI API client modules and update the API client configuration to use secure defaults and environment-based API key management
New Features:
Bug Fixes:
Enhancements:
Build:
Documentation:
Tests: