metatype
metatype copied to clipboard
feat(SDK): add `globs` and `dir` support for artifact deps.
- [x] Include glob and dir support for
PythonRuntimedeps. - [x] Include glob and dir support for
DenoRuntimedeps.
The change includes support for declaring artifact dependencies through globs and dirs
Migration notes
In the deps parameter for python.import(...) and deno.import(...), globs and dirs can be passed in addition to files.
- [ ] The change come with new or modified tests
- [ ] Hard-to-understand functions have explanatory comments
- [ ] End-user documentation is updated to reflect the change
Summary by CodeRabbit
-
New Features
- Introduced functionality for defining and deploying Typegraphs for Deno and Python runtimes.
- Added support for defining a Deno runtime dependency graph with policies for test scenarios.
-
Bug Fixes
- Corrected the structure of the
Deno.servecall in theservefunction.
- Corrected the structure of the
-
Refactor
- Enhanced method chaining for better readability in the
MetaTestclass.
- Enhanced method chaining for better readability in the
-
Tests
- Updated test coverage reporting to include new Deno runtime test files.
- Commented out and removed outdated test cases in Deno runtime tests.
-
Chores
- Updated platform specification in configuration files.
@CodiumAI-Agent /review
PR Review 🔍
| ⏱️ Estimated effort to review [1-5] |
4, due to the extensive changes across multiple files and languages, including TypeScript and Python, which involve complex features like glob pattern handling and directory management in dependency resolution. The PR also modifies core utility functions and introduces new test cases, requiring careful consideration of both functionality and potential side effects. |
| 🧪 Relevant tests |
No |
| ⚡ Possible issues |
Possible Bug: The use of |
|
Performance Concern: The | |
| 🔒 Security concerns |
No |
Code feedback:
| relevant file | typegraph/core/src/utils/fs_host.rs |
| suggestion |
Consider optimizing the |
| relevant line | pub fn get_matching_files(glob_pattern: &str) -> Result |
| relevant file | typegraph/core/src/utils/fs_host.rs |
| suggestion |
Implement additional checks or a more robust pattern matching mechanism in the |
| relevant line | pub fn is_glob(path: &str) -> bool { |
| relevant file | typegraph/core/src/utils/postprocess/deno_rt.rs |
| suggestion |
Ensure that error handling is robust in |
| relevant line | let resolved_deps = resolve_globs_dirs(deps)?; |
| relevant file | typegraph/core/src/utils/postprocess/python_rt.rs |
| suggestion |
Similar to the Deno runtime, add comprehensive error handling around the use of |
| relevant line | let resolved_deps = resolve_globs_dirs(deps)?; |
Walkthrough
The changes introduce new functionality and modifications across multiple files to support Deno and Python runtimes in the Typegraph framework. This includes adding new test files, modifying test coverage reporting, and updating dependency management. Additionally, significant updates have been made to utility functions and the core processing logic to handle glob patterns and directory resolutions for dependencies.
Changes
| File Path | Change Summary |
|---|---|
.ghjk/lock.json |
Changed platform from "x86_64-linux" to "aarch64-darwin" and removed a specific entry. |
.github/workflows/tests.yml |
Added a new test file for Deno runtime coverage reporting. |
typegate/tests/runtimes/deno/deno_dep.ts |
Introduced functionality for defining a Deno runtime dependency graph for addition operations. |
typegate/tests/runtimes/deno/deno_globs.py |
Introduced functionality for defining and deploying a Typegraph for Deno runtime. |
typegate/tests/runtimes/deno/deno_test.ts |
Commented out and removed significant portions of code related to Deno runtime test cases. |
typegate/tests/runtimes/python/python_globs.ts |
Introduced functionality for defining and exposing Python functions using TypeGraph. |
typegate/tests/utils/test.ts |
Modified serve function, updated MetaTest class, and added logging for serialized data. |
typegraph/core/Cargo.toml |
Added glob = "0.3" dependency. |
typegraph/core/src/utils/fs_host.rs |
Added functions for handling glob patterns and directory resolutions. |
typegraph/core/src/utils/postprocess/deno_rt.rs |
Updated DenoProcessor to handle glob and directory resolutions for dependencies. |
typegraph/core/src/utils/postprocess/python_rt.rs |
Updated dependency resolution logic to use resolve_globs_dirs. |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai generate interesting stats about this repository and render them as a table.@coderabbitai show all the console.log statements in this repository.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
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 as PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto full the review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Codecov Report
Attention: Patch coverage is 15.38462% with 33 lines in your changes are missing coverage. Please review.
Project coverage is 73.00%. Comparing base (
8bf253b) to head (32278cf).
| Files | Patch % | Lines |
|---|---|---|
| typegate/tests/utils/s3.ts | 2.94% | 33 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #698 +/- ##
==========================================
- Coverage 73.14% 73.00% -0.15%
==========================================
Files 117 117
Lines 14141 14171 +30
Branches 1415 1415
==========================================
+ Hits 10343 10345 +2
- Misses 3771 3799 +28
Partials 27 27
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.