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

fix: type definitions in .tailcallrc.graphql #1689

Merged
merged 38 commits into from
Apr 18, 2024

Conversation

mobley-trent
Copy link
Contributor

@mobley-trent mobley-trent commented Apr 10, 2024

Summary:
Updates to the autogen graphql schema
Converting type definitions to optional.

Issue Reference(s):
closes #1655
/claim #1655

Build & Testing:

  • I ran cargo test successfully.
  • I have run ./lint.sh --mode=fix to fix all linting issues raised by ./lint.sh --mode=check.

Checklist:

  • I have added relevant unit & integration tests.
  • I have updated the documentation accordingly.
  • I have performed a self-review of my code.
  • PR follows the naming convention of <type>(<optional scope>): <title>

Summary by CodeRabbit

  • New Features
    • Enhanced flexibility in data input by allowing optional fields and null values in GraphQL schemas and configurations.
  • Bug Fixes
    • Improved handling of optional values in various data loaders and configurations to prevent errors and improve data processing efficiency.
  • Documentation
    • Updated internal test documentation to include skip markers for more precise testing control.

@github-actions github-actions bot added the type: fix Iterations on existing features or infrastructure. label Apr 10, 2024
Copy link

codecov bot commented Apr 11, 2024

Codecov Report

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

Project coverage is 86.93%. Comparing base (b5fa454) to head (e976623).
Report is 4 commits behind head on main.

❗ Current head e976623 differs from pull request most recent head e05da9d. Consider uploading reports for the commit e05da9d to get more accurate results

Files Patch % Lines
src/cli/server/server_config.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1689      +/-   ##
==========================================
- Coverage   86.93%   86.93%   -0.01%     
==========================================
  Files         155      155              
  Lines       15540    15535       -5     
==========================================
- Hits        13510    13505       -5     
  Misses       2030     2030              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mobley-trent mobley-trent marked this pull request as ready for review April 12, 2024 14:01
Copy link
Contributor

coderabbitai bot commented Apr 12, 2024

Walkthrough

Walkthrough

The changes aim to enhance flexibility in data handling by making specific fields optional in configurations and schemas. Additionally, adjustments were made to manage default values effectively across various data loaders and configuration settings, improving the system's adaptability to different user requirements.

Changes

File Path Change Summary
generated/.tailcallrc.graphql Modified required fields in Apollo and Batch input types to be optional.
generated/.tailcallrc.schema.json Modified type field to allow null values for specific properties.
src/blueprint/upstream.rs Adjusted handling of optional values in Upstream struct and functions.
src/cli/server/server_config.rs Cloning and default handling for apollo.platform and apollo.version.
src/config/apollo.rs Fields in Apollo struct changed to Option<String>; updated serialization attributes.
src/config/upstream.rs Batch struct now uses Option<usize> for max_size; updated default implementation.
src/.../data_loader.rs (all) Adjusted max_batch_size method to include a default value if batch.max_size is None.
tests/execution/ (all) Added skip markers and directives in various test schemas.

Assessment against linked issues

Objective Addressed Explanation
Optional fields in input types marked as required (#1655, #1212)
Correctly handle wrapper types for vec outputs (#1212) No changes related to handling of wrapper types like Vec were mentioned.
Generate enum fields in types with a mix of scalar and enum fields (#1212) No changes related to the generation of enum fields were mentioned.

Possibly related issues


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 36ba802 and e05da9d.
Files selected for processing (1)
  • src/config/upstream.rs (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/config/upstream.rs

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.

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

src/config/apollo.rs Show resolved Hide resolved
src/cli/server/server_config.rs Outdated Show resolved Hide resolved
src/config/upstream.rs Outdated Show resolved Hide resolved
src/config/upstream.rs Outdated Show resolved Hide resolved
@mobley-trent mobley-trent requested a review from tusharmath April 12, 2024 15:51
Copy link

Action required: PR inactive for 2 days.
Status update or closure in 5 days.

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Apr 14, 2024
@github-actions github-actions bot removed the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Apr 15, 2024
@tusharmath tusharmath added the ci: lint Automatically fix the linters issues and make a commit label Apr 15, 2024
@tusharmath tusharmath enabled auto-merge (squash) April 15, 2024 08:07
@ssddOnTop ssddOnTop removed the ci: lint Automatically fix the linters issues and make a commit label Apr 15, 2024
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: 2

@mobley-trent mobley-trent requested a review from tusharmath April 15, 2024 18:12
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

mobley-trent and others added 2 commits April 16, 2024 11:10
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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

tests/execution/grpc-batch.md Outdated Show resolved Hide resolved
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: 2

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

tests/execution/batching-default.md Outdated Show resolved Hide resolved
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

tests/execution/batching-default.md Outdated Show resolved Hide resolved
tests/execution/graphql-dataloader-batch-request.md Outdated Show resolved Hide resolved
tests/execution/grpc-batch.md Outdated Show resolved Hide resolved
@mobley-trent mobley-trent requested a review from tusharmath April 16, 2024 13:55
.clone()
.unwrap_or_default()
.max_size
.unwrap_or(100)
Copy link
Contributor

Choose a reason for hiding this comment

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

Move 100 to a const and use at both the places.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need a clone either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tusharmath I opted to go for batch.as_ref.map_or(...)

@mobley-trent mobley-trent requested a review from tusharmath April 16, 2024 15:22
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

src/config/upstream.rs Outdated Show resolved Hide resolved
@tusharmath tusharmath enabled auto-merge (squash) April 18, 2024 11:14
@tusharmath tusharmath disabled auto-merge April 18, 2024 11:15
@tusharmath tusharmath merged commit 4a1920e into tailcallhq:main Apr 18, 2024
36 of 37 checks passed
ssddOnTop pushed a commit that referenced this pull request May 2, 2024
Co-authored-by: Tushar Mathur <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 Bounty claim type: fix Iterations on existing features or infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(rc): fix .tailcallrc.graphql
3 participants