Skip to content

Conversation

@NiveditJain
Copy link
Member

  • Introduced a new CronTrigger model in models.py to handle cron expressions.
  • Updated the StateManager's upsert_graph method to accept a list of CronTrigger instances.
  • Added CronTrigger to the all exports in init.py.
  • Bumped version to 0.0.3b1 in _version.py.

- Introduced a new CronTrigger model in models.py to handle cron expressions.
- Updated the StateManager's upsert_graph method to accept a list of CronTrigger instances.
- Added CronTrigger to the __all__ exports in __init__.py.
- Bumped version to 0.0.3b1 in _version.py.
@safedep
Copy link

safedep bot commented Sep 29, 2025

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

Package Details
Package Malware Vulnerability Risky License Report

This report is generated by SafeDep Github App.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added CronTrigger to the SDK’s public API for easy import and use.
    • Added support for cron-based triggers when creating or updating graphs; provided triggers are serialized and sent automatically.
  • Chores

    • Bumped SDK version to 0.0.3b1.

Walkthrough

Adds a CronTrigger Pydantic model and exposes it in the package public API; extends StateManager.upsert_graph to accept and serialize optional cron triggers into the upsert request; bumps SDK version from 0.0.3b0 to 0.0.3b1.

Changes

Cohort / File(s) Summary of Changes
Model & public export
python-sdk/exospherehost/models.py, python-sdk/exospherehost/__init__.py, python-sdk/tests/test_package_init.py
Added CronTrigger(BaseModel) with expression: str. Imported and added CronTrigger to package __all__; test updated to expect the export.
State manager: trigger support
python-sdk/exospherehost/statemanager.py
upsert_graph signature extended with `triggers: list[CronTrigger]
Version bump
python-sdk/exospherehost/_version.py
Bumped version from "0.0.3b0" to "0.0.3b1".

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Client
    participant StateManager
    participant API
    Note over StateManager: upsert_graph(..., triggers?)
    Client->>StateManager: upsert_graph(graph_name, graph_nodes, secrets, triggers?)
    StateManager->>StateManager: validate inputs
    alt triggers provided
        StateManager->>StateManager: map triggers -> [{type:"CRON", expression:expr}, ...]
        StateManager->>StateManager: add triggers to request body
    end
    StateManager->>API: POST /graphs (body with nodes, secrets, optional triggers)
    API-->>StateManager: response
    StateManager-->>Client: return result / raise on error
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • v 0.0.7b5 #169 — Also updates python-sdk/exospherehost/_version.py (version bump), likely related to release/version upkeep.

Poem

A rabbit nudges clocks to sing,
I weave small cronstrings on the wing.
Graphs awake when stars align,
A tiny bump, a version fine.
🐇⏰

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title concisely and accurately summarizes the primary changes introduced in this pull request, namely the addition of the CronTrigger model and the bump to version 0.0.3b1, providing clear context without extraneous detail.
Description Check ✅ Passed The pull request description clearly outlines the key modifications—introducing the CronTrigger model, updating StateManager.upsert_graph to accept CronTrigger instances, exporting CronTrigger in all, and bumping the package version—which directly aligns with the actual code changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e4bec7 and b4bf654.

📒 Files selected for processing (1)
  • python-sdk/tests/test_package_init.py (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @NiveditJain, 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 enhances the system's scheduling capabilities by introducing a dedicated CronTrigger model. This model allows for the definition of cron-based schedules, which can now be associated with graph definitions through an updated StateManager method. The change enables users to schedule the execution of their graphs using standard cron expressions.

Highlights

  • New Model Introduction: A new CronTrigger Pydantic model has been introduced in models.py to represent cron expressions for scheduling.
  • StateManager Update: The StateManager's upsert_graph method now accepts an optional list of CronTrigger instances, allowing graphs to be configured with scheduled triggers.
  • Module Export: The CronTrigger model has been added to the __all__ export list in __init__.py for broader accessibility within the package.
  • Version Bump: The project version has been updated from 0.0.3b0 to 0.0.3b1 in _version.py.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for cron-based triggers by adding a CronTrigger model and updating the StateManager to handle it. The changes are well-structured. My feedback includes suggestions to improve robustness by adding validation to the new CronTrigger model and to enhance code clarity and consistency in the StateManager by simplifying the new logic. I've also pointed out a minor style issue.

- Simplified the logic for processing triggers in the StateManager's upsert_graph method by directly constructing the triggers list.
- Removed the previous loop and validation for CronTrigger instances, streamlining the code and improving readability.
- Added 'CronTrigger' to the list of expected exports in the test for __all__ in the package initialization file, ensuring that the new model is properly tested for inclusion.
@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
python-sdk/exospherehost/statemanager.py 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@NiveditJain NiveditJain merged commit a6547b7 into exospherehost:main Sep 29, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant