-
Notifications
You must be signed in to change notification settings - Fork 0
Update Linear examples with latest types and Modal patterns #130
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?
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 modernizes the Linear webhook and ticket-to-PR examples by migrating to the latest SDK types with robust type checks, introducing a catch-all event handler, updating Modal deployment patterns, enriching documentation and setup workflows, and upgrading dependencies and project configurations. Sequence Diagram for Linear Webhook Event HandlingsequenceDiagram
participant Linear
participant ModalApp as Modal App (LinearEventHandlers)
Linear-->>ModalApp: Webhook (Issue Event: LinearEvent)
ModalApp->>ModalApp: handle_issue(LinearEvent)
Note right of ModalApp: Process LinearIssue data
ModalApp-->>Linear: HTTP Response (status, message)
Linear-->>ModalApp: Webhook (Comment Event: LinearEvent)
ModalApp->>ModalApp: handle_comment(LinearEvent)
Note right of ModalApp: Process LinearComment data
ModalApp-->>Linear: HTTP Response (status, message)
Linear-->>ModalApp: Webhook (Other Event Type: LinearEvent)
ModalApp->>ModalApp: handle_generic(LinearEvent)
Note right of ModalApp: Process generic event data
ModalApp-->>Linear: HTTP Response (status, message)
Class Diagram for Core Linear TypesclassDiagram
class LinearEvent {
+type: string
+action: string
+data: Object (LinearIssue, LinearComment, etc.)
}
class LinearIssue {
+id: string
+title: string
+description: string
+identifier: string
+issue_url: string
}
class LinearComment {
+id: string
+body: string
+user: LinearUser
}
class LinearUser {
+name: string
}
LinearEvent o-- "data" LinearIssue : can be
LinearEvent o-- "data" LinearComment : can be
LinearComment *-- "1" LinearUser : has a
Class Diagram for LinearEventHandlers (linear_webhooks)classDiagram
class LinearEventHandlers {
+CodegenApp app
+enter()
+exit()
+handle_issue(event: LinearEvent)
+handle_comment(event: LinearEvent)
+handle_generic(event: LinearEvent)
}
LinearEventHandlers ..> LinearEvent : uses
LinearEventHandlers ..> LinearIssue : uses (via event.data)
LinearEventHandlers ..> LinearComment : uses (via event.data)
note for LinearEventHandlers "Handles Linear webhook events within a Modal app.\nUpdated to use specific Linear types and added generic handler."
Class Diagram for LinearApp (ticket-to-pr)classDiagram
class LinearApp {
+CodegenApp app
+Codebase codebase
+run_this_on_container_startup()
+run_this_on_container_exit()
+handle_webhook(event: LinearEvent, request: Request)
}
class CodeAgent {
+Codebase codebase
+run(query: string)
}
class LinearClient {
+comment_on_issue(issue_id: string, comment: string)
}
class Codebase {
+reset()
}
LinearApp ..> LinearEvent : uses
LinearApp ..> CodeAgent : uses
LinearApp ..> LinearClient : uses
LinearApp ..> Codebase : uses
note for LinearApp "Handles Linear issue events to trigger PR creation.\nUpdated to use LinearEvent type."
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 pre-commit checks in PR #130. I've addressed the formatting issues that were causing the checks to fail:
The changes have been pushed to the PR branch in this commit. 💻 View my work • React 👍 or 👎 |
I see a check failed - I'm on it! 🫡 |
✅ Fixed the failing mypy checks in PR #130. I've addressed the type errors in the ticket-to-pr example:
The changes have been pushed to the PR branch in this commit. 💻 View my work • React 👍 or 👎 |
This PR updates all example codebase files related to Linear webhooks and PR creation to use the latest LinearEvent, LinearIssue, LinearComment, and LinearUser types, and ensures they're using up-to-date Modal patterns.
Changes:
Linear Webhooks Example:
Ticket-to-PR Example:
These updates ensure that all Linear-related examples are consistent with the latest implementation in the codegen codebase and follow best practices for Modal applications.
💻 View my work • About Codegen
Summary by Sourcery
Update Linear webhook and ticket-to-PR examples to use the latest LinearEvent types and Modal deployment patterns with codegen v0.26.3
New Features:
Enhancements:
Build:
CI:
Documentation: