Skip to content
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

refactor(docs): add how to test typegraphs doc #798

Merged
merged 17 commits into from
Aug 4, 2024

Conversation

destifo
Copy link
Contributor

@destifo destifo commented Jul 24, 2024

How to test your typegraphs documentation

  • add python doc
  • add ts doc
  • upgrade bitnami/minIo image to 2024?

Migration notes

No Migrations Needed

  • The change comes 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

    • Updated the Minio service to the latest version for improved performance and potential new features.
    • Introduced comprehensive documentation for testing typegraphs in both TypeScript and Python, enhancing developer experience.
  • Documentation

    • Enhanced readability of the Meta CLI upgrade instructions.
    • Reformatted installation instructions for the typegraph package for better clarity.
  • Chores

    • Updated dependency management configuration for improved compatibility and performance across different platforms.

@destifo destifo changed the title docs: add python typegraph test how-to doc refactor(docs): add how to test typegraphs doc Jul 24, 2024
@destifo destifo self-assigned this Jul 24, 2024
@destifo
Copy link
Contributor Author

destifo commented Jul 24, 2024

@zifeo should I include the bitnami/minIo upgrade from 2022 to 2024 in this PR?

Copy link
Member

@zifeo zifeo left a comment

Choose a reason for hiding this comment

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

Good progress! Yes, you can bump the docker images :)

website/docs/guides/test-your-typegraph/index.mdx Outdated Show resolved Hide resolved
website/docs/guides/test-your-typegraph/index.mdx Outdated Show resolved Hide resolved
website/docs/guides/test-your-typegraph/index.mdx Outdated Show resolved Hide resolved
@destifo
Copy link
Contributor Author

destifo commented Jul 26, 2024

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Jul 26, 2024

Walkthrough

This update includes a version upgrade for the Minio service in the Docker Compose configuration to enhance its capabilities. A comprehensive guide for testing typegraphs within the Metatype SDK has been introduced, with setup instructions for both TypeScript and Python. Additionally, minor formatting adjustments across various documentation files improve clarity and readability without impacting functionality.

Changes

Files Change Summary
dev/envs/compose.base.yml Updated Minio image version from bitnami/minio:2022 to bitnami/minio:2024, indicating an upgrade to the latest release.
website/docs/guides/test-your-typegraph/index.mdx Introduced new documentation for testing typegraphs in TypeScript and Python, detailing setup, naming conventions, and providing sample test cases.
website/shared/install/meta-cli.mdx Added a blank line for improved readability before the command example for upgrading Meta CLI.
website/shared/install/typegraph.mdx Reformatted installation command blocks for the typegraph package using pip and poetry for better clarity and consistent indentation.
.ghjk/lock.json Changed platform from x86_64-linux to aarch64-darwin, added new dependencies, modified existing entries, and optimized the development environment.

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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

@destifo
Copy link
Contributor Author

destifo commented Jul 28, 2024

@afmika @Natoandro is there a way for a user to start a typegate instance programmatically, without shell commands?

@destifo destifo marked this pull request as ready for review July 29, 2024 08:13
@destifo
Copy link
Contributor Author

destifo commented Jul 29, 2024

@coderabbitai review

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Outside diff range, codebase verification and nitpick comments (2)
website/docs/guides/test-your-typegraph/index.mdx (2)

99-120: Ensure typegraph is properly initialized.

The test cases use tg directly, but the initialization of tg is not shown in the provided code. Ensure that tg is properly initialized before running the tests.

  • Initialization of tg is missing in the provided code snippet.
Analysis chain

Ensure typegraph is properly initialized.

The test cases use tg directly, but the initialization of tg is not shown in the provided code. Ensure that tg is properly initialized before running the tests.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the initialization of `tg` in the provided code.

# Test: Search for the initialization of `tg`. Expect: Initialization code for `tg`.
rg --type python -A 5 $'tg = '

Length of output: 62


Script:

#!/bin/bash
# Description: Verify the initialization of `tg` in the provided code.

# Test: Search for the initialization of `tg`. Expect: Initialization code for `tg`.
rg --type typescript -A 5 $'tg = '

Length of output: 70


Script:

#!/bin/bash
# Description: Verify the initialization of `tg` in the provided code.

# Test: Search for the initialization of `tg`. Expect: Initialization code for `tg`.
rg --glob '*.ts' -A 5 $'tg = '

Length of output: 18693


163-227: Ensure typegate is properly launched.

The TODO comment indicates that the typegate should be launched programmatically. However, there is no implementation for this in the code. Please ensure that the typegate is properly launched before running the tests.

  • File: website/docs/guides/test-your-typegraph/index.mdx
  • Lines: 163-227
Analysis chain

Ensure typegate is properly launched.

The TODO comment indicates that the typegate should be launched programmatically. Ensure that the typegate is properly launched before running the tests.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the launching of the typegate in the provided code.

# Test: Search for the launching of the typegate. Expect: Code to launch the typegate programmatically.
rg --type python -A 5 $'launch typegate'

Length of output: 72


Script:

#!/bin/bash
# Description: Verify the launching of the typegate in the provided code.

# Test: Search for the launching of the typegate. Expect: Code to launch the typegate programmatically.
rg --type typescript -A 5 'launch typegate'

Length of output: 80


Script:

#!/bin/bash
# Description: Verify the launching of the typegate in the provided code.

# Test: Search for the launching of the typegate. Expect: Code to launch the typegate programmatically.
rg -A 5 'launch typegate'

Length of output: 509

website/docs/guides/test-your-typegraph/index.mdx Outdated Show resolved Hide resolved
website/docs/guides/test-your-typegraph/index.mdx Outdated Show resolved Hide resolved
website/docs/guides/test-your-typegraph/index.mdx Outdated Show resolved Hide resolved
@zifeo
Copy link
Member

zifeo commented Jul 30, 2024

👍 worth taking coderrabbit's feedback into account

@destifo
Copy link
Contributor Author

destifo commented Aug 1, 2024

@coderabbitai review

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (2)
website/docs/guides/test-your-typegraph/index.mdx (2)

19-23: Clarify the installation step.

The installation step should explicitly mention that it is for the TypeScript SDK.

- To test typegraphs in the _typescript_ SDK, you first need to add _vitest_ as a dev dependency to your metatype project.
+ To test typegraphs in the _TypeScript_ SDK, you first need to add _vitest_ as a dev dependency to your Metatype project.

122-122: Clarify the purpose of the tests.

The description should clarify that the tests are for validating the typegraph's functionality.

- The above were simple tests you can execute against the output of the typegraph function. You can also do a serialization test to check if the typegraph is serialized successfully.
+ The above are simple tests to validate the functionality of your typegraph. You can also perform a serialization test to ensure the typegraph is serialized successfully.

website/docs/guides/test-your-typegraph/index.mdx Outdated Show resolved Hide resolved
@destifo destifo requested review from Yohe-Am and zifeo August 4, 2024 08:21
Yohe-Am
Yohe-Am previously approved these changes Aug 4, 2024
@destifo destifo merged commit fd612f7 into main Aug 4, 2024
9 checks passed
@destifo destifo deleted the docs/how-to-test-typegraph branch August 4, 2024 16:51
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.

3 participants