metatype icon indicating copy to clipboard operation
metatype copied to clipboard

fix(gate): Improve logging and responses

Open Natoandro opened this issue 1 year ago • 2 comments

  • Logging before and after each faillible operation
    • Runtimes: foreign resolvers
  • Always log before reporting error: HTTP response
  • Fix error code in artifact_service
  • Add BaseError class for structured messages in responses

Summary by CodeRabbit

  • New Features

    • Updated Docker image and dependency versions to v0.4.1-0 for better stability and performance.
  • Improvements

    • Enhanced error handling with specific error classes for better debugging and user feedback.
    • Added comprehensive logging across various modules for improved monitoring and troubleshooting.
    • Refined error messages and response handling for more informative user interactions.
  • Refactor

    • Replaced generic errors with specific error classes to enhance error specificity and debugging capabilities.
  • Chores

    • Version bumps across multiple configuration files to maintain consistency with the latest release.

Natoandro avatar May 10 '24 12:05 Natoandro

Walkthrough

The recent changes encompass updating version numbers across various configuration files to maintain consistency and compatibility with the new version 0.4.1-0. Notably, enhancements in error handling within the typegate project introduce specific error classes for improved error management and logging. Detailed logging improvements have been implemented across multiple runtime classes to offer more informative log messages.

Changes

Files Change Summary
.ghjk/lock.json, dev/lock.yml, ghjk.ts, meta-cli/Cargo.toml, ... Updated various version declarations to 0.4.1-0.
Cargo.toml, libs/common/Cargo.toml, libs/metagen/tests/mat_rust/Cargo.toml, ... Version updated from 0.4.0 to 0.4.1-0.
examples/templates/deno/compose.yml, examples/templates/node/compose.yml, ... Docker image version for typegate service updated to v0.4.1-0 from v0.4.0.
libs/metagen/Cargo.toml, libs/metagen/src/lib.rs, libs/metagen/src/tests/mod.rs Added color-eyre dependency, switched error handling from anyhow to color_eyre.
meta-cli/Cargo.toml, meta-cli/src/cli/upgrade.rs, meta-cli/src/cli/deploy.rs, ... Significant refactoring, restructuring, and logging improvements in various modules within meta-cli.
meta-cli/src/cli/typegate.rs, meta-cli/src/cli/serialize.rs, meta-cli/src/cli/ui/mod.rs, ... Refactored imports, error handling, and logging in different modules within meta-cli.
typegate/src/engine/computation_engine.ts, typegate/src/errors.ts, typegate/src/libs/jsonpath.ts, ... Introduced specific error classes for improved error management and logging within typegate.
typegate/src/runtimes/graphql.ts, typegate/src/runtimes/prisma/migration.ts, ... Enhanced logging with detailed statements and error handling improvements in various runtime classes.
typegate/src/services/artifact_service.ts, typegate/src/tests/rest/rest_test.ts, ... Improved error handling, logging, and error message updates in service modules and test cases within typegate.

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?

Share
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 @coderabbitai in 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 @coderabbitai in 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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to 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.yaml file 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.

coderabbitai[bot] avatar May 14 '24 20:05 coderabbitai[bot]

Codecov Report

Attention: Patch coverage is 48.49138% with 239 lines in your changes are missing coverage. Please review.

Project coverage is 73.52%. Comparing base (bbdfd35) to head (9775e44). Report is 1 commits behind head on main.

Files Patch % Lines
typegate/src/runtimes/s3.ts 0.00% 36 Missing :warning:
typegate/src/runtimes/temporal.ts 0.00% 23 Missing :warning:
typegate/src/errors.ts 80.35% 22 Missing :warning:
typegate/src/runtimes/python.ts 0.00% 19 Missing :warning:
typegate/src/runtimes/wasm_wire.ts 0.00% 15 Missing :warning:
typegate/src/engine/query_engine.ts 58.82% 14 Missing :warning:
typegate/src/runtimes/prisma/migration.ts 31.57% 13 Missing :warning:
typegate/src/libs/jsonpath.ts 60.00% 12 Missing :warning:
typegate/src/services/artifact_service.ts 20.00% 12 Missing :warning:
typegate/src/typegate/artifacts/mod.ts 33.33% 12 Missing :warning:
... and 12 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #714      +/-   ##
==========================================
- Coverage   74.05%   73.52%   -0.53%     
==========================================
  Files         120      120              
  Lines       13777    14142     +365     
  Branches     1407     1416       +9     
==========================================
+ Hits        10202    10398     +196     
- Misses       3549     3717     +168     
- Partials       26       27       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 17 '24 03:05 codecov[bot]