-
Notifications
You must be signed in to change notification settings - Fork 0
Update examples with deployment scripts and interactive deployer #138
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
Update examples with deployment scripts and interactive deployer #138
Conversation
Reviewer's GuideThis PR introduces a unified, interactive deployment workflow for all codegen examples by adding a root-level Deployer script, provisioning per-example deploy scripts with robust environment checks, standardizing and enriching documentation across each example, refactoring Python example apps for improved lifecycle, event handling, and logging, and updating project metadata and dependency declarations for consistency. Sequence Diagram for linear_webhooks Lifecycle and Event HandlingsequenceDiagram
participant ModalPlatform as "Modal Platform"
participant LW_Handlers as "LinearEventHandlers Instance"
participant CG_Linear as "CodegenApp.linear (SDK component)"
participant LinearService as "Linear Service"
participant Logger
ModalPlatform ->> LW_Handlers: Instantiate & Invoke @modal.enter()
activate LW_Handlers
LW_Handlers ->> CG_Linear: subscribe_all_handlers()
CG_Linear -->> LW_Handlers: Ack
deactivate LW_Handlers
note over ModalPlatform, Logger: Application is live, awaiting Linear events
LinearService ->> LW_Handlers: POST /webhook (LinearEvent: type="Issue")
activate LW_Handlers
LW_Handlers ->> LW_Handlers: handle_issue(event)
LW_Handlers ->> Logger: info("Received Linear Issue event...")
LW_Handlers -->> LinearService: JSON Response
deactivate LW_Handlers
LinearService ->> LW_Handlers: POST /webhook (LinearEvent: type="Comment")
activate LW_Handlers
LW_Handlers ->> LW_Handlers: handle_comment(event)
LW_Handlers ->> Logger: info("Received Linear Comment event...")
LW_Handlers -->> LinearService: JSON Response
deactivate LW_Handlers
note over ModalPlatform, Logger: ... other events (e.g., generic) can be handled similarly ...
ModalPlatform ->> LW_Handlers: Invoke @modal.exit()
activate LW_Handlers
LW_Handlers ->> CG_Linear: unsubscribe_all_handlers()
CG_Linear -->> LW_Handlers: Ack
deactivate LW_Handlers
ModalPlatform ->> LW_Handlers: Destroy instance
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! 🫡 |
|
I'm looking into both failing checks on PR #138 - the pre-commit check and the Mypy check. I'll examine the logs and fix the issues. |
|
I'm now looking at the Build & Release check failure (38721669646) on PR #138. I'll examine the logs and fix the issues. |
|
✅ Fixed failing mypy check in this commit. The issue was type errors in the |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
User description
This PR updates all examples in the
codegen-examples/examplesfolder to correspond to up-to-date modal deployments:Summary of Changes
Root-level Deployer Script
Deployer.shin the examples root folder that:Individual Example Deploy Scripts
Added
deploy.shscripts to the following examples:linear_webhooks: Updated with proper environment validation and deployment commandsticket-to-pr: Added comprehensive deployment script with environment checksgithub_checks: Created new deployment script with GitHub token validationswebench_agent_run: Enhanced existing script with better error handlingai_impact_analysis: Added new deployment script for the backend APImodal_repo_analytics: Created deployment script for the analytics APIsnapshot_event_handler: Added deployment script for GitHub event handlingDocumentation Updates
Deployment Workflow
The new deployment workflow is:
./Deployer.shto see all available examplesThis PR makes it much easier for users to deploy and manage multiple Modal examples.
💻 View my work • About Codegen
Summary by Sourcery
Provide a unified, interactive deployment workflow and modernize all codegen example projects to use up-to-date Modal and Codegen SDKs.
New Features:
Enhancements:
Build:
Documentation:
PR Type
Enhancement, Documentation
Description
Add interactive root-level deployment script for all examples
Deployer.shfor concurrent, menu-driven deploymentsAdd and standardize
deploy.shscripts for each example.envfiles/templates with credential instructionsModernize and refactor Linear and Ticket-to-PR example code
Overhaul and expand example documentation
.env.templatefiles for clarity and completenessChanges walkthrough 📝
23 files
Add interactive root-level deployment script for all examplesAdd deploy.sh script for AI Impact Analysis exampleAdd deploy.sh script for Codegen MCP Server exampleAdd deploy.sh script for Codegen App exampleAdd deploy.sh script for Cyclomatic Complexity exampleAdd deploy.sh script for Deep Code Research exampleAdd deploy.sh script for Dead Code Deletion exampleAdd deploy.sh script for Document Functions exampleAdd deploy.sh script for GitHub Checks exampleAdd deploy.sh script for Linear Webhooks exampleAdd deploy.sh script for Modal Repo Analytics exampleAdd deploy.sh script for PR Review Bot exampleAdd deploy.sh script for Repo Analytics exampleAdd deploy.sh script for Slack Chatbot exampleAdd deploy.sh script for Snapshot Event Handler exampleRewrite and enhance deploy.sh for SWEBench Agent RunAdd deploy.sh script for Ticket-to-PR exampleRefactor and modernize Linear webhook event handlingRefactor Ticket-to-PR app for updated SDK and ModalUpdate LinearIssueUpdateEvent model for clarityRefactor helpers for event processing and codebase creationUpdate dependencies and add dev extras for Linear WebhooksUpdate dependencies and add dev extras for Ticket-to-PR7 files
Add comprehensive README for Linear Webhooks exampleUpdate .env.template for Linear Webhooks with clearer instructionsAdd and expand README for Ticket-to-PR exampleUpdate .env.template for Ticket-to-PR with clearer instructionsRewrite and expand README for GitHub Checks exampleRewrite and expand README for Modal Repo Analytics exampleRewrite and expand README for Snapshot Event Handler example1 files