Skip to content

Conversation

@SkArchon
Copy link
Contributor

@SkArchon SkArchon commented Jul 10, 2025

This fixes
go-github.com/go-chi/chi/v5 <= 5.2.1/GHSA-vrw8-fxc6-2r93 (cosmo)
go-github.com/go-viper/mapstructure/v2 < 2.3.0/GHSA-fv92-fjc5-jj9h (cosmo): This affects demo and router-tests

(After merging, I will update the router test dependencies)

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/cosmo-docs.
  • I have read the Contributors Guide.

Summary by CodeRabbit

  • Chores
    • Updated multiple dependencies to newer versions for improved stability and compatibility.
    • Enhanced JSON support for various enum types across multiple modules, enabling seamless serialization and deserialization.

@SkArchon SkArchon requested a review from Aenimus July 10, 2025 21:22
@coderabbitai
Copy link

coderabbitai bot commented Jul 10, 2025

Walkthrough

Dependency versions were updated across three Go modules. The demo and router-tests modules upgraded several direct and indirect dependencies, including gqlgen, gqlparser, and others. The router module updated the github.com/go-chi/chi/v5 dependency to a newer patch version. Additionally, multiple generated resolver files updated their gqlgen version comment headers from v0.17.63 to v0.17.76. Several enum types across various subgraphs were extended with JSON marshaling and unmarshaling methods, enabling JSON encoding/decoding consistent with their GraphQL marshal/unmarshal logic. No changes were made to public APIs beyond these additions.

Changes

Files Change Summary
demo/go.mod, router-tests/go.mod Updated versions for multiple dependencies: gqlgen, gqlparser, google.golang.org/protobuf, mapstructure, go-md2man, levenshtein, go-colorable, urfave/cli, and others.
router/go.mod Bumped github.com/go-chi/chi/v5 from v5.2.1 to v5.2.2.
demo/pkg/subgraphs//subgraph/entity.resolvers.go, demo/pkg/subgraphs//subgraph/schema.resolvers.go Updated gqlgen code generation comment headers from v0.17.63 to v0.17.76 in multiple resolver files.
demo/pkg/subgraphs/*/subgraph/model/models_gen.go Added JSON MarshalJSON and UnmarshalJSON methods to enum types in subgraphs: availability, countries, employees, family, hobbies, mood, products, products_fg, test1. Imported bytes package to support these methods. No other logic changes.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 36ae39e and 4be389c.

⛔ Files ignored due to path filters (12)
  • demo/go.sum is excluded by !**/*.sum
  • demo/pkg/subgraphs/availability/subgraph/generated/generated.go is excluded by !**/generated/**
  • demo/pkg/subgraphs/countries/subgraph/generated/generated.go is excluded by !**/generated/**
  • demo/pkg/subgraphs/employees/subgraph/generated/generated.go is excluded by !**/generated/**
  • demo/pkg/subgraphs/family/subgraph/generated/generated.go is excluded by !**/generated/**
  • demo/pkg/subgraphs/hobbies/subgraph/generated/generated.go is excluded by !**/generated/**
  • demo/pkg/subgraphs/mood/subgraph/generated/generated.go is excluded by !**/generated/**
  • demo/pkg/subgraphs/products/subgraph/generated/generated.go is excluded by !**/generated/**
  • demo/pkg/subgraphs/products_fg/subgraph/generated/generated.go is excluded by !**/generated/**
  • demo/pkg/subgraphs/test1/subgraph/generated/generated.go is excluded by !**/generated/**
  • router-tests/go.sum is excluded by !**/*.sum
  • router/go.sum is excluded by !**/*.sum
📒 Files selected for processing (27)
  • demo/go.mod (7 hunks)
  • demo/pkg/subgraphs/availability/subgraph/entity.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/availability/subgraph/schema.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/countries/subgraph/entity.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/employees/subgraph/entity.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/employees/subgraph/model/models_gen.go (5 hunks)
  • demo/pkg/subgraphs/employees/subgraph/schema.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/family/subgraph/entity.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/family/subgraph/model/models_gen.go (7 hunks)
  • demo/pkg/subgraphs/family/subgraph/schema.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/hobbies/subgraph/entity.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/hobbies/subgraph/model/models_gen.go (4 hunks)
  • demo/pkg/subgraphs/hobbies/subgraph/schema.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/mood/subgraph/entity.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/mood/subgraph/model/models_gen.go (2 hunks)
  • demo/pkg/subgraphs/mood/subgraph/schema.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/products/subgraph/entity.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/products/subgraph/model/models_gen.go (3 hunks)
  • demo/pkg/subgraphs/products/subgraph/schema.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/products_fg/subgraph/entity.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/products_fg/subgraph/model/models_gen.go (3 hunks)
  • demo/pkg/subgraphs/products_fg/subgraph/schema.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/test1/subgraph/entity.resolvers.go (1 hunks)
  • demo/pkg/subgraphs/test1/subgraph/model/models_gen.go (2 hunks)
  • demo/pkg/subgraphs/test1/subgraph/schema.resolvers.go (1 hunks)
  • router-tests/go.mod (5 hunks)
  • router/go.mod (1 hunks)
✅ Files skipped from review due to trivial changes (18)
  • demo/pkg/subgraphs/employees/subgraph/entity.resolvers.go
  • demo/pkg/subgraphs/countries/subgraph/entity.resolvers.go
  • demo/pkg/subgraphs/products_fg/subgraph/schema.resolvers.go
  • demo/pkg/subgraphs/availability/subgraph/entity.resolvers.go
  • demo/pkg/subgraphs/products_fg/subgraph/entity.resolvers.go
  • demo/pkg/subgraphs/test1/subgraph/schema.resolvers.go
  • demo/pkg/subgraphs/mood/subgraph/entity.resolvers.go
  • demo/pkg/subgraphs/availability/subgraph/schema.resolvers.go
  • demo/pkg/subgraphs/employees/subgraph/schema.resolvers.go
  • demo/pkg/subgraphs/products/subgraph/schema.resolvers.go
  • demo/pkg/subgraphs/mood/subgraph/schema.resolvers.go
  • demo/pkg/subgraphs/hobbies/subgraph/schema.resolvers.go
  • demo/pkg/subgraphs/hobbies/subgraph/entity.resolvers.go
  • demo/pkg/subgraphs/family/subgraph/entity.resolvers.go
  • demo/pkg/subgraphs/test1/subgraph/entity.resolvers.go
  • demo/pkg/subgraphs/family/subgraph/schema.resolvers.go
  • demo/pkg/subgraphs/products/subgraph/entity.resolvers.go
  • router-tests/go.mod
🚧 Files skipped from review as they are similar to previous changes (2)
  • router/go.mod
  • demo/go.mod
🧰 Additional context used
🧬 Code Graph Analysis (2)
demo/pkg/subgraphs/products_fg/subgraph/model/models_gen.go (1)
demo/pkg/subgraphs/products/subgraph/model/models_gen.go (2)
  • ProductName (102-102)
  • TopSecretFactType (167-167)
demo/pkg/subgraphs/products/subgraph/model/models_gen.go (1)
demo/pkg/subgraphs/products_fg/subgraph/model/models_gen.go (2)
  • ProductName (99-99)
  • TopSecretFactType (164-164)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: integration_test (./telemetry)
  • GitHub Check: build_test
  • GitHub Check: integration_test (./events)
  • GitHub Check: integration_test (./. ./fuzzquery ./lifecycle ./modules)
🔇 Additional comments (16)
demo/pkg/subgraphs/mood/subgraph/model/models_gen.go (1)

6-80: LGTM! Generated code follows correct patterns.

The added JSON marshaling/unmarshaling methods for the Mood enum are well-implemented, properly delegating to existing GraphQL methods to ensure consistency. The import of the bytes package is appropriate for the buffer usage in MarshalJSON.

demo/pkg/subgraphs/test1/subgraph/model/models_gen.go (1)

6-962: LGTM! Consistent implementation of JSON marshaling methods.

The JSON marshaling/unmarshaling methods for EnumType follow the same correct pattern as other files, ensuring consistency between JSON and GraphQL serialization. The implementation properly handles error cases and delegates to existing validation logic.

demo/pkg/subgraphs/products_fg/subgraph/model/models_gen.go (1)

6-219: LGTM! Proper JSON support added for both enum types.

The JSON marshaling/unmarshaling methods for ProductName and TopSecretFactType enums are correctly implemented, following the established pattern of delegating to existing GraphQL methods. This ensures consistency across serialization formats.

demo/pkg/subgraphs/products/subgraph/model/models_gen.go (1)

6-222: LGTM! Consistent JSON marshaling implementation.

The JSON marshaling/unmarshaling methods for ProductName and TopSecretFactType enums are well-implemented, maintaining consistency with the GraphQL serialization logic. The code generation has produced correct and safe implementations.

demo/pkg/subgraphs/employees/subgraph/model/models_gen.go (1)

6-502: LGTM! Comprehensive JSON marshaling support added.

The JSON marshaling/unmarshaling methods for all four enum types (Department, EngineerType, Mood, and OperationType) are correctly implemented, following the established pattern of delegating to existing GraphQL methods. This ensures consistency and proper validation across all serialization formats.

demo/pkg/subgraphs/hobbies/subgraph/model/models_gen.go (4)

6-6: LGTM: bytes import added for JSON marshaling support.

The bytes package import is correctly added to support buffer usage in the new JSON marshaling methods.


208-220: LGTM: JSON marshaling methods correctly implemented for ExerciseType enum.

The generated JSON marshaling methods properly delegate to existing GQL methods and follow the standard pattern for enum serialization.


275-287: LGTM: JSON marshaling methods correctly implemented for GameGenre enum.

The generated JSON marshaling methods properly delegate to existing GQL methods and follow the standard pattern for enum serialization.


334-346: LGTM: JSON marshaling methods correctly implemented for ProgrammingLanguage enum.

The generated JSON marshaling methods properly delegate to existing GQL methods and follow the standard pattern for enum serialization.

demo/pkg/subgraphs/family/subgraph/model/models_gen.go (7)

6-6: LGTM: bytes import added for JSON marshaling support.

The bytes package import is correctly added to support buffer usage in the new JSON marshaling methods.


167-179: LGTM: JSON marshaling methods correctly implemented for CatType enum.

The generated JSON marshaling methods properly delegate to existing GQL methods and follow the standard pattern for enum serialization.


224-236: LGTM: JSON marshaling methods correctly implemented for Class enum.

The generated JSON marshaling methods properly delegate to existing GQL methods and follow the standard pattern for enum serialization.


283-295: LGTM: JSON marshaling methods correctly implemented for DogBreed enum.

The generated JSON marshaling methods properly delegate to existing GQL methods and follow the standard pattern for enum serialization.


340-352: LGTM: JSON marshaling methods correctly implemented for Gender enum.

The generated JSON marshaling methods properly delegate to existing GQL methods and follow the standard pattern for enum serialization.


395-407: LGTM: JSON marshaling methods correctly implemented for MaritalStatus enum.

The generated JSON marshaling methods properly delegate to existing GQL methods and follow the standard pattern for enum serialization.


460-472: LGTM: JSON marshaling methods correctly implemented for Nationality enum.

The generated JSON marshaling methods properly delegate to existing GQL methods and follow the standard pattern for enum serialization.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 using 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@github-actions
Copy link

github-actions bot commented Jul 10, 2025

Router image scan passed

✅ No security vulnerabilities found in image:

ghcr.io/wundergraph/cosmo/router:sha-f863f27816a9a0ae5b60f01cfc12d3970b4f4f45

@SkArchon SkArchon marked this pull request as draft July 10, 2025 21:46
Copy link
Contributor

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

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

LGTM

@SkArchon SkArchon force-pushed the milinda/security-upgrades branch from 36ae39e to 4be389c Compare July 15, 2025 10:36
@SkArchon SkArchon marked this pull request as ready for review July 15, 2025 10:42
@SkArchon SkArchon merged commit 10f2e5f into main Jul 15, 2025
26 checks passed
@SkArchon SkArchon deleted the milinda/security-upgrades branch July 15, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants