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

Winston Logger Adapter #622

Merged
merged 7 commits into from
Feb 13, 2025
Merged

Winston Logger Adapter #622

merged 7 commits into from
Feb 13, 2025

Conversation

ardatan
Copy link
Member

@ardatan ardatan commented Feb 10, 2025

Winston Adapter

Now you can integrate Winston into Hive Gateway on Node.js

import { createLogger, format, transports } from 'winston'
import { createLoggerFromWinston } from '@graphql-hive/winston'

// Create a Winston logger
const winstonLogger = createLogger({
    level: 'info',
    format: format.combine(
        format.timestamp(),
        format.json()
    ),
    transports: [
        new transports.Console()
    ]
})

export const gatewayConfig = defineConfig({
    // Create an adapter for Winston
    logging: createLoggerFromWinston(winstonLogger)
})

In order to try it now, install the alpha of @graphql-hive/gateway and @graphql-hive/winston below; #622 (comment)

Related GW-163

Copy link

coderabbitai bot commented Feb 10, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Introduced a Winston logging adapter and a new logging package that enables enhanced, structured log output in Node.js applications.
  • Refactor

    • Streamlined logging practices across execution requests, fetch operations, and subgraph operations for clearer and more consistent log outputs.
    • Simplified logger metadata management by removing redundant parameters.
  • Documentation

    • Added guidance and configuration examples for integrating the Winston logging adapter.
  • Chores

    • Updated dependency versions to align with the new logging adapter package.

Walkthrough

The changes integrate a Winston logging adapter into the Hive Gateway for Node.js applications. This includes the introduction of a new package with its metadata, the implementation of the logging adapter, and associated unit tests. Additionally, documentation is updated with a section on the "Winston Adapter" that features a TypeScript example, and the dependency version for @graphql-hive/logger-winston is updated. The TypeScript configuration is also modified to include a new path mapping for the adapter package.

Changes

File Path(s) Change Summary
.changeset/wild-balloons-repair.md Added "Winston Adapter" section with integration guidance, a TypeScript example, and updated the dependency version for @graphql-hive/logger-winston.
packages/logger-winston/package.json
packages/logger-winston/src/index.ts
packages/logger-winston/tests/winston.spec.ts
Introduced a new package for the Winston logging adapter including package metadata, implementation of WinstonLoggerAdapter (with logging methods, child logger, and disposable interface), and unit tests validating logging functionality via Vitest.
tsconfig.json Added a new path mapping for the "@graphql-hive/logger-winston" module pointing to its source index file.
packages/fusion-runtime/src/utils.ts Modified logging functionality in wrapExecutorWithHooks to enhance log structure by wrapping subgraphName in an object for child logger creation.
packages/runtime/src/plugins/useFetchDebug.ts Updated onFetch method to remove requestId from parameters, simplifying logger creation.
packages/runtime/src/plugins/useSubgraphExecuteDebug.ts Updated onSubgraphExecute method to remove requestId from parameters, simplifying logger creation.

Suggested reviewers

  • dotansimha
  • enisdenjo

Poem

I hopped into code with a skip and a cheer,
Logging my steps with Winston so clear.
A new adapter was born in a flash,
Unit tests confirmed it—no bug did they stash.
Celebrations abound in each line I relay,
A rabbit's delight in every commit today!
🐰✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4703c15 and a3b872e.

📒 Files selected for processing (3)
  • packages/fusion-runtime/src/utils.ts (1 hunks)
  • packages/runtime/src/plugins/useFetchDebug.ts (1 hunks)
  • packages/runtime/src/plugins/useSubgraphExecuteDebug.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`packages/**`: In this directory we keep all packages releva...

packages/**: In this directory we keep all packages relevant to the gateway.

In most cases, when changes are made to the source code / dependencies in these directories, we also require to have a corresponding changeset file, created using yarn changeset with a full description on the changes with an example.
Also, when new features are added the packages, the changeset file should mention minor semver change. When a bug is fixed, patch needs to be used. The major bump is used for a PR that has breaking changes.

  • packages/fusion-runtime/src/utils.ts
  • packages/runtime/src/plugins/useFetchDebug.ts
  • packages/runtime/src/plugins/useSubgraphExecuteDebug.ts
`**`: For all PRs, we would like to verify that a Linear iss...

**: For all PRs, we would like to verify that a Linear issue is linked. Check if there's a mention for "GW-*" in the PR description, and the us know when it's missing.

In most cases, when a PR adds a new functionality, we would like to make sure it has documentation in the corresponding console project.
Use the global knowledge feature to search for PRs in graphql-hive/console repository that adds documentation. Suggest to create a follow up issue to add the missing documentation.

  • packages/fusion-runtime/src/utils.ts
  • packages/runtime/src/plugins/useFetchDebug.ts
  • packages/runtime/src/plugins/useSubgraphExecuteDebug.ts
⏰ Context from checks skipped due to timeout of 90000ms (25)
  • GitHub Check: Unit / Node v23
  • GitHub Check: Unit / Bun
  • GitHub Check: Leaks / Node v23
  • GitHub Check: E2E / Bun Docker on Ubuntu
  • GitHub Check: Leaks / Node v22
  • GitHub Check: E2E / Bun on Ubuntu
  • GitHub Check: Leaks / Node v20
  • GitHub Check: E2E / Node Binary on Windows
  • GitHub Check: Leaks / Node v18
  • GitHub Check: E2E / Node Binary on Ubuntu
  • GitHub Check: Benchmark / bun / 1000 items
  • GitHub Check: E2E / Node Docker on Ubuntu
  • GitHub Check: Benchmark / bun / 100 items
  • GitHub Check: Snapshot / snapshot
  • GitHub Check: Benchmark / bun / 10 items
  • GitHub Check: E2E / Node 23 on Ubuntu
  • GitHub Check: E2E / Node 22 on Ubuntu
  • GitHub Check: Benchmark / node / 1000 items
  • GitHub Check: E2E / Node 20 on Ubuntu
  • GitHub Check: Benchmark / node / 100 items
  • GitHub Check: Build
  • GitHub Check: E2E / Node 18 on Ubuntu
  • GitHub Check: Benchmark / node / 10 items
  • GitHub Check: Bundle
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
packages/runtime/src/plugins/useFetchDebug.ts (2)

13-13: LGTM! Simplified method signature.

The removal of requestId parameter streamlines the logging interface while maintaining tracking capability through fetchId.


15-17: LGTM! Simplified logger metadata.

The logger creation is streamlined while maintaining essential tracking through fetchId.

packages/runtime/src/plugins/useSubgraphExecuteDebug.ts (2)

14-14: LGTM! Simplified method signature.

The removal of requestId parameter streamlines the logging interface while maintaining tracking capability through subgraphExecuteId.


16-18: LGTM! Simplified logger metadata.

The logger creation is streamlined while maintaining essential tracking through subgraphExecuteId.

packages/fusion-runtime/src/utils.ts (1)

294-294: LGTM! Improved log structure.

The change enhances log clarity by using a named property subgraph instead of passing the subgraph name directly. This structured approach aligns with production logging requirements and makes logs more readable and parseable.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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>, please review it.
    • 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 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 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 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. (Beta)
  • @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.

Copy link

@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: 7

🔭 Outside diff range comments (1)
packages/winston/package.json (1)

60-62: Side Effects Flag and Trailing Line Check

The "sideEffects": false flag is correctly set, indicating that the package is side-effect free for optimal bundling. Also, please verify that no extraneous content (such as a stray line corresponding to "62") is present in the actual file, as such content could lead to issues.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between bf41711 and e8d806a.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • .changeset/wild-balloons-repair.md (1 hunks)
  • packages/winston/package.json (1 hunks)
  • packages/winston/src/index.ts (1 hunks)
  • packages/winston/tests/winston.spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`packages/**`: In this directory we keep all packages releva...

packages/**: In this directory we keep all packages relevant to the gateway.

In most cases, when changes are made to the source code / dependencies in these directories, we also require to have a corresponding changeset file, created using yarn changeset with a full description on the changes with an example.
Also, when new features are added the packages, the changeset file should mention minor semver change. When a bug is fixed, patch needs to be used. The major bump is used for a PR that has breaking changes.

  • packages/winston/tests/winston.spec.ts
  • packages/winston/src/index.ts
  • packages/winston/package.json
`**`: For all PRs, we would like to verify that a Linear iss...

**: For all PRs, we would like to verify that a Linear issue is linked. Check if there's a mention for "GW-*" in the PR description, and the us know when it's missing.

In most cases, when a PR adds a new functionality, we would like to make sure it has documentation in the corresponding console project.
Use the global knowledge feature to search for PRs in graphql-hive/console repository that adds documentation. Suggest to create a follow up issue to add the missing documentation.

  • packages/winston/tests/winston.spec.ts
  • packages/winston/src/index.ts
  • packages/winston/package.json
🪛 Biome (1.9.4)
packages/winston/tests/winston.spec.ts

[error] 1-1: A Node.js builtin module should be imported with the node: protocol.

Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.

(lint/style/useNodejsImportProtocol)


[error] 7-7: This type annotation is trivially inferred from its initialization.

Safe fix: Remove the type annotation.

(lint/style/noInferrableTypes)

packages/winston/src/index.ts

[error] 10-10: Use Number.POSITIVE_INFINITY instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.POSITIVE_INFINITY instead.

(lint/style/useNumberNamespace)


[error] 14-14: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)

⏰ Context from checks skipped due to timeout of 90000ms (29)
  • GitHub Check: Leaks / Node v23
  • GitHub Check: Leaks / Node v22
  • GitHub Check: Leaks / Node v20
  • GitHub Check: Unit / Bun
  • GitHub Check: Leaks / Node v18
  • GitHub Check: E2E / Bun Docker on Ubuntu
  • GitHub Check: E2E / Bun on Ubuntu
  • GitHub Check: E2E / Node Binary on Windows
  • GitHub Check: E2E / Node Binary on Ubuntu
  • GitHub Check: E2E / Node Docker on Ubuntu
  • GitHub Check: E2E / Node 23 on Ubuntu
  • GitHub Check: E2E / Node 22 on Ubuntu
  • GitHub Check: Snapshot / snapshot
  • GitHub Check: E2E / Node 20 on Ubuntu
  • GitHub Check: Benchmark / bun / 1000 items
  • GitHub Check: E2E / Node 18 on Ubuntu
  • GitHub Check: Bundle
  • GitHub Check: Unit / Node v23
  • GitHub Check: Benchmark / bun / 100 items
  • GitHub Check: Build
  • GitHub Check: Benchmark / bun / 10 items
  • GitHub Check: Unit / Node v22
  • GitHub Check: Unit / Node v20
  • GitHub Check: Benchmark / node / 1000 items
  • GitHub Check: Format
  • GitHub Check: Benchmark / node / 100 items
  • GitHub Check: Unit / Node v18
  • GitHub Check: Benchmark / node / 10 items
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (14)
packages/winston/src/index.ts (1)

67-71: Implementation looks good.
The function seamlessly creates a logger adapter from an existing Winston logger.

packages/winston/tests/winston.spec.ts (1)

2-180: Great test coverage.
These tests are comprehensive and cover a variety of input scenarios, including nested loggers.

🧰 Tools
🪛 Biome (1.9.4)

[error] 7-7: This type annotation is trivially inferred from its initialization.

Safe fix: Remove the type annotation.

(lint/style/noInferrableTypes)

.changeset/wild-balloons-repair.md (2)

2-2: Verify the necessity for a major version bump.
The guidelines indicate that major bumps are typically reserved for breaking changes. If this addition is a new feature, consider a minor bump instead.


1-6: Linear issue reference missing.
Per the guidelines, please ensure a "GW-*" issue is linked in the PR description or clarify if it's not relevant.

packages/winston/package.json (10)

5-9: Repository Metadata Configuration

The repository field correctly references the Git repository URL and specifies the monorepo directory "packages/winston". Ensure that this accurately reflects your repository structure.


10-15: Homepage and Author Details

The homepage URL and author metadata (name, email, URL) are clearly defined, providing transparent project information.


16-20: License, Engines, and Main Entry

The license (MIT), Node.js engine requirement (>=18.0.0), and the main entry file ("./dist/index.js") are all correctly specified.


34-34: Type Definitions Reference

The "types" field correctly points to "./dist/index.d.ts", ensuring TypeScript consumers receive the necessary type definitions.


35-37: Whitelisting Published Files

The "files" array is properly configured to restrict the published package contents to the dist directory, which is a best practice for clean package distribution.


38-41: Build and Prepack Scripts

The defined scripts—using "pkgroll --clean-dist" for the build and "yarn build" for the prepack step—are correctly set up to ensure the package is built before it’s published.


42-45: Peer Dependencies Specification

The peer dependencies for "graphql" and "winston" are specified with version ranges that seem appropriate. This ensures that consumers of the package install compatible versions.


46-50: Optional Peer Dependency Metadata

The use of "peerDependenciesMeta" to mark "@parcel/watcher" as optional is correctly implemented, providing flexibility for users who might not need that dependency.


51-54: Runtime Dependencies

The runtime dependencies, "@graphql-mesh/types" and "tslib", are included with appropriate version constraints. Everything appears standard and well-configured.


55-59: Development Dependencies

The devDependencies list the required packages for development and testing, including "graphql", "pkgroll", and "winston". Including "winston" here, even though it’s already in peerDependencies, helps ensure consistent behavior during development.

packages/winston/src/index.ts Outdated Show resolved Hide resolved
packages/winston/src/index.ts Outdated Show resolved Hide resolved
packages/winston/src/index.ts Outdated Show resolved Hide resolved
packages/winston/tests/winston.spec.ts Outdated Show resolved Hide resolved
packages/winston/tests/winston.spec.ts Outdated Show resolved Hide resolved
packages/winston/package.json Outdated Show resolved Hide resolved
@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 10, 2025

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-tools/batch-delegate 9.0.30-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-tools/batch-execute 9.0.12-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-tools/delegate 10.2.12-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-tools/executor-common 0.0.2-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-tools/executor-graphql-ws 2.0.2-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-tools/executor-http 1.2.7-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-tools/federation 3.1.2-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-mesh/fusion-runtime 0.11.0-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-hive/gateway 1.10.0-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-hive/importer 1.0.1-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-hive/logger-json 0.0.1-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-hive/logger-winston 1.0.0-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-mesh/hmac-upstream-signature 1.2.20-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-opentelemetry 1.3.41-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-prometheus 1.3.29-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-runtime 1.4.13-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-tools/stitch 9.4.17-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-tools/stitching-directives 3.1.27-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-common 0.7.29-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-http 0.6.33-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-http-callback 0.5.20-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-mesh/transport-ws 1.0.3-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎
@graphql-tools/wrap 10.0.30-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f npm ↗︎ unpkg ↗︎

Copy link

@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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e8d806a and 774a9fe.

📒 Files selected for processing (1)
  • .changeset/wild-balloons-repair.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (30)
  • GitHub Check: Examples / Convert openapi-javascript-wiki
  • GitHub Check: Examples / Convert federation-subscriptions-passthrough
  • GitHub Check: Examples / Convert file-upload
  • GitHub Check: Examples / Convert federation-mixed
  • GitHub Check: Examples / Convert federation-example
  • GitHub Check: Examples / Convert extra-fields
  • GitHub Check: Binary built on windows-latest
  • GitHub Check: Binary built on macos-14
  • GitHub Check: Bun Docker image
  • GitHub Check: Node Docker image
  • GitHub Check: Binary built on ubuntu-latest
  • GitHub Check: E2E / Bun Docker on Ubuntu
  • GitHub Check: E2E / Bun on Ubuntu
  • GitHub Check: E2E / Node Binary on Windows
  • GitHub Check: E2E / Node Binary on Ubuntu
  • GitHub Check: E2E / Node Docker on Ubuntu
  • GitHub Check: E2E / Node 23 on Ubuntu
  • GitHub Check: E2E / Node 22 on Ubuntu
  • GitHub Check: Leaks / Node v23
  • GitHub Check: Benchmark / bun / 1000 items
  • GitHub Check: Benchmark / bun / 100 items
  • GitHub Check: E2E / Node 20 on Ubuntu
  • GitHub Check: Benchmark / bun / 10 items
  • GitHub Check: Leaks / Node v22
  • GitHub Check: Benchmark / node / 1000 items
  • GitHub Check: Benchmark / node / 100 items
  • GitHub Check: E2E / Node 18 on Ubuntu
  • GitHub Check: Benchmark / node / 10 items
  • GitHub Check: Leaks / Node v20
  • GitHub Check: Leaks / Node v18
🔇 Additional comments (3)
.changeset/wild-balloons-repair.md (3)

5-7: Clear Heading and Description
The "Winston Adapter" section title and the accompanying description clearly communicate the integration of the Winston logging library into Hive Gateway for Node.js. This makes the purpose of the changeset immediately obvious to users.


9-11: Import Statements for Logger Functions
The imports from 'winston' and @graphql-hive/winston are correctly declared, ensuring that the necessary functions (createLogger, format, transports, and createLoggerFromWinston) are available for use in the snippet.


13-23: Winston Logger Setup
The code for creating the Winston logger is well-structured. It uses format.combine to include both a timestamp and JSON formatting, and initializes a console transport correctly. This adheres to common best practices for configuring a Winston logger.

.changeset/wild-balloons-repair.md Outdated Show resolved Hide resolved
.changeset/wild-balloons-repair.md Show resolved Hide resolved
@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 10, 2025

🚀 Snapshot Release (Binary for Linux-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 10, 2025

🚀 Snapshot Release (Binary for macOS-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 10, 2025

🚀 Snapshot Release (Bun Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:1.10.0-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f-bun

@ardatan ardatan marked this pull request as ready for review February 10, 2025 15:41
@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 10, 2025

🚀 Snapshot Release (Node Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:1.10.0-alpha-a3b872e50dfd5c5a4bde6078744593b850e80b1f

Copy link

@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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 774a9fe and 8d12b25.

📒 Files selected for processing (2)
  • .changeset/wild-balloons-repair.md (1 hunks)
  • packages/winston/tests/winston.spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`packages/**`: In this directory we keep all packages releva...

packages/**: In this directory we keep all packages relevant to the gateway.

In most cases, when changes are made to the source code / dependencies in these directories, we also require to have a corresponding changeset file, created using yarn changeset with a full description on the changes with an example.
Also, when new features are added the packages, the changeset file should mention minor semver change. When a bug is fixed, patch needs to be used. The major bump is used for a PR that has breaking changes.

  • packages/winston/tests/winston.spec.ts
`**`: For all PRs, we would like to verify that a Linear iss...

**: For all PRs, we would like to verify that a Linear issue is linked. Check if there's a mention for "GW-*" in the PR description, and the us know when it's missing.

In most cases, when a PR adds a new functionality, we would like to make sure it has documentation in the corresponding console project.
Use the global knowledge feature to search for PRs in graphql-hive/console repository that adds documentation. Suggest to create a follow up issue to add the missing documentation.

  • packages/winston/tests/winston.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (28)
  • GitHub Check: E2E / Bun Docker on Ubuntu
  • GitHub Check: E2E / Bun on Ubuntu
  • GitHub Check: E2E / Node Binary on Windows
  • GitHub Check: E2E / Node Binary on Ubuntu
  • GitHub Check: E2E / Node Docker on Ubuntu
  • GitHub Check: E2E / Node 23 on Ubuntu
  • GitHub Check: E2E / Node 22 on Ubuntu
  • GitHub Check: E2E / Node 20 on Ubuntu
  • GitHub Check: E2E / Node 18 on Ubuntu
  • GitHub Check: Unit / Node v23
  • GitHub Check: Leaks / Node v23
  • GitHub Check: Unit / Node v22
  • GitHub Check: Leaks / Node v22
  • GitHub Check: Leaks / Node v20
  • GitHub Check: Unit / Node v20
  • GitHub Check: Leaks / Node v18
  • GitHub Check: Unit / Node v18
  • GitHub Check: Unit / Bun
  • GitHub Check: Benchmark / bun / 1000 items
  • GitHub Check: Benchmark / bun / 100 items
  • GitHub Check: Bundle
  • GitHub Check: Snapshot / snapshot
  • GitHub Check: Benchmark / bun / 10 items
  • GitHub Check: Build
  • GitHub Check: Benchmark / node / 1000 items
  • GitHub Check: Benchmark / node / 100 items
  • GitHub Check: Benchmark / node / 10 items
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
packages/winston/tests/winston.spec.ts (1)

15-178: LGTM! Comprehensive test coverage.

The test suite thoroughly covers:

  • All log levels (error, warn, info, debug)
  • Basic logging functionality
  • Child logger behavior
  • Name deduplication
  • Nested logger scenarios
.changeset/wild-balloons-repair.md (1)

1-31: Documentation and issue tracking requirements.

The changeset looks good but there are a few requirements to address:

  1. No Linear issue (GW-*) is mentioned in the PR description
  2. Documentation in the console project might be needed for this new feature

Let me check if there's any documentation PR in the console repository:

Please:

  1. Add the Linear issue reference (GW-*) to the PR description
  2. Create a follow-up issue to add documentation in the console project if none exists
❌ Verification inconclusive

🏁 Script executed:

#!/bin/bash
# Search for documentation PRs in graphql-hive/console repository
gh search prs --repo graphql-hive/console --state open --json title,body,url \
  | jq '.[] | select(.title | test("winston|logger"; "i")) | {title, url}'

Length of output: 151


Missing Issue Reference & Documentation Follow-Up

The changeset correctly implements the Winston adapter integration, but:

  • The PR description is missing a reference to a Linear issue (GW-*).
  • No open documentation PR was found in the console repository for this new feature. Please add the Linear issue reference to the PR description and, if needed, create a follow-up issue for updating the console documentation.

packages/winston/tests/winston.spec.ts Outdated Show resolved Hide resolved
packages/winston/tests/winston.spec.ts Outdated Show resolved Hide resolved
.changeset/wild-balloons-repair.md Show resolved Hide resolved
@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 10, 2025

🚀 Snapshot Release (Binary for Windows-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 10, 2025

🚀 Snapshot Release (Binary for macOS-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

Copy link

@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 comments (1)
packages/winston/package.json (1)

1-62: Ensure Changeset and Linear Issue Association

Since this new package introduces the Winston Logger Adapter functionality, please confirm that a corresponding changeset file has been created with the appropriate semver bump (typically a minor change for new features). Moreover, ensure that a related Linear issue (using the "GW-*" pattern) is referenced in the PR description to provide context and traceability.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8d12b25 and 5bf435c.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • .changeset/wild-balloons-repair.md (1 hunks)
  • packages/winston/package.json (1 hunks)
  • packages/winston/src/index.ts (1 hunks)
  • packages/winston/tests/winston.spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`packages/**`: In this directory we keep all packages releva...

packages/**: In this directory we keep all packages relevant to the gateway.

In most cases, when changes are made to the source code / dependencies in these directories, we also require to have a corresponding changeset file, created using yarn changeset with a full description on the changes with an example.
Also, when new features are added the packages, the changeset file should mention minor semver change. When a bug is fixed, patch needs to be used. The major bump is used for a PR that has breaking changes.

  • packages/winston/src/index.ts
  • packages/winston/package.json
  • packages/winston/tests/winston.spec.ts
`**`: For all PRs, we would like to verify that a Linear iss...

**: For all PRs, we would like to verify that a Linear issue is linked. Check if there's a mention for "GW-*" in the PR description, and the us know when it's missing.

In most cases, when a PR adds a new functionality, we would like to make sure it has documentation in the corresponding console project.
Use the global knowledge feature to search for PRs in graphql-hive/console repository that adds documentation. Suggest to create a follow up issue to add the missing documentation.

  • packages/winston/src/index.ts
  • packages/winston/package.json
  • packages/winston/tests/winston.spec.ts
🪛 Biome (1.9.4)
packages/winston/src/index.ts

[error] 10-10: Use Number.POSITIVE_INFINITY instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.POSITIVE_INFINITY instead.

(lint/style/useNumberNamespace)


[error] 14-14: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)

⏰ Context from checks skipped due to timeout of 90000ms (29)
  • GitHub Check: Unit / Node v23
  • GitHub Check: Unit / Bun
  • GitHub Check: Leaks / Node v23
  • GitHub Check: Unit / Node v22
  • GitHub Check: Leaks / Node v22
  • GitHub Check: Unit / Node v20
  • GitHub Check: Leaks / Node v20
  • GitHub Check: Unit / Node v18
  • GitHub Check: E2E / Bun Docker on Ubuntu
  • GitHub Check: Leaks / Node v18
  • GitHub Check: E2E / Bun on Ubuntu
  • GitHub Check: E2E / Node Binary on Windows
  • GitHub Check: E2E / Node Binary on Ubuntu
  • GitHub Check: Missing peer deps
  • GitHub Check: E2E / Node Docker on Ubuntu
  • GitHub Check: Snapshot / snapshot
  • GitHub Check: Benchmark / bun / 1000 items
  • GitHub Check: E2E / Node 23 on Ubuntu
  • GitHub Check: Benchmark / bun / 100 items
  • GitHub Check: E2E / Node 22 on Ubuntu
  • GitHub Check: Benchmark / bun / 10 items
  • GitHub Check: E2E / Node 20 on Ubuntu
  • GitHub Check: Benchmark / node / 1000 items
  • GitHub Check: Bundle
  • GitHub Check: Benchmark / node / 100 items
  • GitHub Check: E2E / Node 18 on Ubuntu
  • GitHub Check: Build
  • GitHub Check: Benchmark / node / 10 items
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (16)
packages/winston/src/index.ts (3)

10-10: Use Number.POSITIVE_INFINITY instead of Infinity.

ES2015 and subsequent standards moved some globals into the Number namespace for clarity.

-    .flat(Infinity)
+    .flat(Number.POSITIVE_INFINITY)
🧰 Tools
🪛 Biome (1.9.4)

[error] 10-10: Use Number.POSITIVE_INFINITY instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.POSITIVE_INFINITY instead.

(lint/style/useNumberNamespace)


14-14: Avoid reassigning function parameters.

Reassigning arg may confuse readers. Use a local variable instead.

-          arg = JSON.parse(arg);
+          const parsedArg = JSON.parse(arg);
+          return parsedArg;
🧰 Tools
🪛 Biome (1.9.4)

[error] 14-14: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)


27-65: Consider supporting Winston's additional log levels.

Winston provides extra log levels like verbose and silly. If extended logging is desired, consider adding them.

packages/winston/tests/winston.spec.ts (1)

8-14: Use a more robust callback tracking mechanism.

Storing the last callback with lastCallback could be fragile in concurrent or async scenarios. Use a more dependable approach, such as a queue of callbacks or a promise-based method.

.changeset/wild-balloons-repair.md (3)

1-3: Verify whether a major version bump is necessary.

There's an existing comment about ensuring the major version is correct for @graphql-hive/winston. Please confirm that this reflects a breaking change or adopt a minor/patch version if it doesn't.


1-1: Missing Linear issue reference.

No "GW-" issue is mentioned in the PR description. If this PR is part of a Linear board task, please link the corresponding "GW-" issue here.


9-30: Consider adding an error handling example.

An example of a logged error would showcase best practices for diagnosing and reporting failures.

packages/winston/package.json (9)

5-10: Repository and Homepage Accuracy

The "repository" field and "homepage" URL are correctly specified. Please verify that the homepage URL directs users to the appropriate documentation for the new Winston Logger Adapter. This can help ensure consistency with your project’s branding and documentation.


11-15: Author Information is Clear

The author details are well defined and consistent with the project’s branding. No adjustments are needed here.


16-19: License and Node Engine Requirements

The license and Node.js engine requirements are appropriately set. Ensure that the engine version (>=18.0.0) aligns with the rest of your packages.


20-33: Dual Module Support in the Exports Field

The "exports" field is structured to support both CommonJS and ES module systems, including type definitions. Please confirm that using the custom type declaration file ("./dist/index.d.cts") for CommonJS usage is intentional and fully supported by your toolchain.


34-37: Types and Files Configuration

The configuration for "types" and the "files" array is correct and will help ensure that only the necessary distribution files are included. This setup is appropriate for clean package distribution.


38-41: Build and Prepack Scripts

The build and prepack scripts (using pkgroll --clean-dist and yarn build) follow common practices for preparing a package. Verify that the output in the dist folder is as expected.


42-50: Peer Dependencies and Optional Meta

The "peerDependencies" field correctly defines the required external packages, and "peerDependenciesMeta" appropriately marks @parcel/watcher as optional. This is in line with best practices.


51-59: Dependencies Consistency

The versions for "dependencies" and "devDependencies" are specified with appropriate version ranges. One point to verify is that the version of graphql in the dev dependencies (i.e., "16.10.0") aligns well with the range defined in the peer dependencies ("^15.9.0 || ^16.9.0"). Ensure there’s no unintended version mismatch during development.


60-60: Side Effects Flag

Marking "sideEffects" as false is a good practice for tree shaking and indicates that the module does not produce side effects upon import. This configuration is correct.

packages/winston/package.json Outdated Show resolved Hide resolved
@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 10, 2025

🚀 Snapshot Release (Binary for Linux-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

Copy link

@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 comments (1)
packages/winston/package.json (1)

1-62: 🧹 Nitpick (assertive)

Consider Adding a Package Description
While optional, including a "description" field in the package metadata can improve discoverability on registries like npm. A brief summary of the package functionality could be valuable for users.

♻️ Duplicate comments (1)
packages/winston/package.json (1)

1-3: 🛠️ Refactor suggestion

Update Package Version for Alpha Release
The current version is set to "0.0.0", which does not reflect the alpha release status described in the PR. Please update this to an appropriate pre-release identifier (for example, "1.0.0-alpha-8d12b253f742b70368d12b7fd35b718a3d8aa17a") to clearly signal its pre-release state.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5bf435c and 78ee389.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • .changeset/wild-balloons-repair.md (1 hunks)
  • packages/winston/package.json (1 hunks)
  • packages/winston/src/index.ts (1 hunks)
  • packages/winston/tests/winston.spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`packages/**`: In this directory we keep all packages releva...

packages/**: In this directory we keep all packages relevant to the gateway.

In most cases, when changes are made to the source code / dependencies in these directories, we also require to have a corresponding changeset file, created using yarn changeset with a full description on the changes with an example.
Also, when new features are added the packages, the changeset file should mention minor semver change. When a bug is fixed, patch needs to be used. The major bump is used for a PR that has breaking changes.

  • packages/winston/tests/winston.spec.ts
  • packages/winston/package.json
  • packages/winston/src/index.ts
`**`: For all PRs, we would like to verify that a Linear iss...

**: For all PRs, we would like to verify that a Linear issue is linked. Check if there's a mention for "GW-*" in the PR description, and the us know when it's missing.

In most cases, when a PR adds a new functionality, we would like to make sure it has documentation in the corresponding console project.
Use the global knowledge feature to search for PRs in graphql-hive/console repository that adds documentation. Suggest to create a follow up issue to add the missing documentation.

  • packages/winston/tests/winston.spec.ts
  • packages/winston/package.json
  • packages/winston/src/index.ts
🪛 Biome (1.9.4)
packages/winston/src/index.ts

[error] 10-10: Use Number.POSITIVE_INFINITY instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.POSITIVE_INFINITY instead.

(lint/style/useNumberNamespace)


[error] 14-14: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)

⏰ Context from checks skipped due to timeout of 90000ms (28)
  • GitHub Check: E2E / Bun Docker on Ubuntu
  • GitHub Check: E2E / Bun on Ubuntu
  • GitHub Check: E2E / Node Binary on Windows
  • GitHub Check: E2E / Node Binary on Ubuntu
  • GitHub Check: E2E / Node Docker on Ubuntu
  • GitHub Check: Leaks / Node v23
  • GitHub Check: E2E / Node 23 on Ubuntu
  • GitHub Check: Leaks / Node v22
  • GitHub Check: E2E / Node 22 on Ubuntu
  • GitHub Check: Unit / Node v23
  • GitHub Check: Leaks / Node v20
  • GitHub Check: Snapshot / snapshot
  • GitHub Check: E2E / Node 20 on Ubuntu
  • GitHub Check: Unit / Bun
  • GitHub Check: Benchmark / bun / 1000 items
  • GitHub Check: Benchmark / bun / 100 items
  • GitHub Check: Unit / Node v22
  • GitHub Check: Benchmark / bun / 10 items
  • GitHub Check: Leaks / Node v18
  • GitHub Check: Benchmark / node / 1000 items
  • GitHub Check: Unit / Node v20
  • GitHub Check: Bundle
  • GitHub Check: Benchmark / node / 100 items
  • GitHub Check: E2E / Node 18 on Ubuntu
  • GitHub Check: Unit / Node v18
  • GitHub Check: Build
  • GitHub Check: Benchmark / node / 10 items
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (14)
packages/winston/src/index.ts (4)

10-10: Use Number.POSITIVE_INFINITY instead of Infinity.

This recommendation was already provided in a past review comment.

🧰 Tools
🪛 Biome (1.9.4)

[error] 10-10: Use Number.POSITIVE_INFINITY instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.POSITIVE_INFINITY instead.

(lint/style/useNumberNamespace)


14-14: Avoid reassigning function parameters.

This suggestion was already provided in a past review comment.

🧰 Tools
🪛 Biome (1.9.4)

[error] 14-14: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)


35-59: Consider supporting Winston’s other log levels.

This feedback was already provided in a past review comment.


1-72: No reference to a linked Linear issue (GW-*) detected.

According to the guidelines, please confirm whether a Linear issue (GW-*) should be associated with this PR.

🧰 Tools
🪛 Biome (1.9.4)

[error] 10-10: Use Number.POSITIVE_INFINITY instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.POSITIVE_INFINITY instead.

(lint/style/useNumberNamespace)


[error] 14-14: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)

packages/winston/tests/winston.spec.ts (1)

8-14: Consider using a more robust callback tracking mechanism.

This suggestion was already provided in a past review comment.

.changeset/wild-balloons-repair.md (1)

1-3: Validate the semver bump for @graphql-hive/winston.

The file marks a major version, but if this feature is newly introduced and not breaking existing usage, changing it to a minor version might be more appropriate.

packages/winston/package.json (8)

21-31: Review Exports Field Configuration
The "exports" section appropriately supports both CommonJS and ES modules, including specific type definition paths. Please verify that using the custom declaration file ("./dist/index.d.cts") under the "require" entry is supported by your toolchain, as intended.


35-37: Files Inclusion
The "files" array restricts the published package to the dist directory. This is a good practice to minimize the package size and ensure only the built artifacts are published.


38-41: Build & Prepack Scripts
The build and prepack scripts using pkgroll --clean-dist and yarn build are standard and align with expectations. Make sure that the build output in dist is as expected before publishing.


42-45: Peer Dependencies Specification
The peer dependencies for graphql and winston are correctly specified to ensure compatibility with downstream projects.


46-50: Optional Peer Dependency Configuration
The peerDependenciesMeta entry for "@parcel/watcher" correctly marks it as optional. This configuration is appropriate.


51-54: Dependencies Configuration
The dependencies (@graphql-mesh/types and tslib) are clearly defined and meet the package requirements.


55-59: Dev Dependencies
The dev dependencies, including graphql, pkgroll, and winston, are set up for proper testing and development. This configuration looks correct.


60-60: Side Effects Flag
Setting "sideEffects" to false is a good practice for optimizing bundling via tree-shaking.

.changeset/wild-balloons-repair.md Show resolved Hide resolved
@klippx
Copy link
Contributor

klippx commented Feb 12, 2025

Sample logs from prod testing:

{"extensions":{},"level":"error","locations":[{"column":13,"line":137}],"message":"Cannot return null for non-nullable field CarComponentConfiguration.selected.","path":["carByToken","configurationByToken","upholstery",4,"inConfiguration","selected"],"stack":"Error: Cannot return null for non-nullable field CarComponentConfiguration.selected.\n    at completeValue (/app/node_modules/@graphql-tools/executor/esm/execution/execute.js:422:23)\n    at executeField (/app/node_modules/@graphql-tools/executor/esm/execution/execute.js:316:25)\n    at executeFields (/app/node_modules/@graphql-tools/executor/esm/execution/execute.js:258:28)\n    at collectAndExecuteSubfields (/app/node_modules/@graphql-tools/executor/esm/execution/execute.js:690:23)\n    at executeField (/app/node_modules/@graphql-tools/executor/esm/execution/execute.js:316:25)\n    at executeFields (/app/node_modules/@graphql-tools/executor/esm/execution/execute.js:258:28)\n    at collectAndExecuteSubfields (/app/node_modules/@graphql-tools/executor/esm/execution/execute.js:690:23)\n    at completeValue (/app/node_modules/@graphql-tools/executor/esm/execution/execute.js:420:27)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-02-12T08:34:16.442Z"}
{"level":"info","message":["incoming operation",{"clientName":"site-navigation","operationName":"CarPriceDirectOffers"}],"name":["use-request-log"],"timestamp":"2025-02-12T08:34:16.525Z"}
{"level":"warn","message":["GraphQL errors detected",{"clientName":"account-app","messages":["\"vcc-session\" cookie or \"x-session-data\" header is required"],"operationName":"GetConnectedVehicles","phase":"execution","variables":{}}],"name":["use-error-log"],"timestamp":"2025-02-12T08:37:05.869Z"}
{"level":"info","message":["incoming operation",{"clientName":"site-navigation","operationName":"CarPriceDirectOffers"}],"name":["use-request-log"],"timestamp":"2025-02-12T08:39:20.294Z"}

Comment on prod log:

  • name: Should this really be logged as an array? "name":["use-request-log"]
  • message: Should this really be logged as a tuple? I think it is better to let message: <first item in tuple> + ...i.e. spreading the props flatly into the same level asmessage` 🤔

Locally with DEBUG=1 there are some issues, sample:

debug: Processing GraphQL Parameters done.
debug: Parsing request to extract GraphQL parameters
debug: Processing GraphQL Parameters
debug: start,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","car-configuration-dgs","subgraph-execute"]}
debug: request,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","fetch"]}
debug: response,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","fetch"]}
debug: result,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","car-configuration-dgs","subgraph-execute"]}
debug: start,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","car-configuration-dgs","delegation-plan"]}
debug: done,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","car-configuration-dgs","delegation-plan"]}
debug: Initializing executor {"name":["37bba565-155a-4f01-b103-baedac24f1ca","product-enrichment-dgs"]}
debug: Loading transport "http" {"name":["product-enrichment-dgs"]}
[2025-02-12T08:34:40.386Z] HOOKS Trying default resolve for "@graphql-mesh/transport-http"
debug: start,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","product-enrichment-dgs","subgraph-execute"]}
debug: request,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","fetch"]}
debug: response,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","fetch"]}
debug: result,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","product-enrichment-dgs","subgraph-execute"]}
debug: start,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","product-enrichment-dgs","delegation-plan"]}
debug: done,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","product-enrichment-dgs","delegation-plan"]}
debug: start,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","pricing-dgs","delegation-stage-execute"]}
debug: Initializing executor {"name":["37bba565-155a-4f01-b103-baedac24f1ca","pricing-dgs"]}
debug: Loading transport "http" {"name":["pricing-dgs"]}
[2025-02-12T08:34:40.892Z] HOOKS Trying default resolve for "@graphql-mesh/transport-http"
debug: start,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","pricing-dgs","subgraph-execute"]}
debug: request,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","fetch"]}
debug: response,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","fetch"]}
debug: result,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","pricing-dgs","subgraph-execute"]}
debug: result,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","pricing-dgs","delegation-stage-execute"]}
debug: start,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","pricing-dgs","delegation-plan"]}
debug: done,[object Object] {"name":["37bba565-155a-4f01-b103-baedac24f1ca","pricing-dgs","delegation-plan"]}
info: incoming operation,[object Object] {"name":["use-request-log"]}

Comment on those

  • [object Object] what's this? Is it a record that should be spread into the rest of the log message?

@ardatan ardatan marked this pull request as draft February 12, 2025 09:23
Copy link

@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

♻️ Duplicate comments (1)
packages/winston/package.json (1)

1-4: ⚠️ Potential issue

Update package version for alpha release.

The package version is set to "0.0.0" but should reflect its alpha status as mentioned in the PR description.

-  "version": "0.0.0",
+  "version": "1.0.0-alpha-78ee389cb41e09aa27b4d57748634f609664aa63"
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 78ee389 and dd844e6.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • .changeset/wild-balloons-repair.md (1 hunks)
  • packages/winston/package.json (1 hunks)
  • packages/winston/src/index.ts (1 hunks)
  • packages/winston/tests/winston.spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`packages/**`: In this directory we keep all packages releva...

packages/**: In this directory we keep all packages relevant to the gateway.

In most cases, when changes are made to the source code / dependencies in these directories, we also require to have a corresponding changeset file, created using yarn changeset with a full description on the changes with an example.
Also, when new features are added the packages, the changeset file should mention minor semver change. When a bug is fixed, patch needs to be used. The major bump is used for a PR that has breaking changes.

  • packages/winston/package.json
  • packages/winston/src/index.ts
  • packages/winston/tests/winston.spec.ts
`**`: For all PRs, we would like to verify that a Linear iss...

**: For all PRs, we would like to verify that a Linear issue is linked. Check if there's a mention for "GW-*" in the PR description, and the us know when it's missing.

In most cases, when a PR adds a new functionality, we would like to make sure it has documentation in the corresponding console project.
Use the global knowledge feature to search for PRs in graphql-hive/console repository that adds documentation. Suggest to create a follow up issue to add the missing documentation.

  • packages/winston/package.json
  • packages/winston/src/index.ts
  • packages/winston/tests/winston.spec.ts
🪛 Biome (1.9.4)
packages/winston/src/index.ts

[error] 11-11: Use Number.POSITIVE_INFINITY instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.POSITIVE_INFINITY instead.

(lint/style/useNumberNamespace)


[error] 15-15: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)

⏰ Context from checks skipped due to timeout of 90000ms (19)
  • GitHub Check: Examples / Convert operation-field-permissions
  • GitHub Check: Examples / Convert type-merging-batching
  • GitHub Check: Examples / Convert subscriptions-with-transforms
  • GitHub Check: Examples / Convert programmatic-batching
  • GitHub Check: Examples / Convert openapi-subscriptions
  • GitHub Check: Examples / Convert openapi-javascript-wiki
  • GitHub Check: Examples / Convert openapi-arg-rename
  • GitHub Check: Examples / Convert openapi-additional-resolvers
  • GitHub Check: Examples / Convert json-schema-subscriptions
  • GitHub Check: Examples / Convert interface-additional-resolvers
  • GitHub Check: Examples / Convert hmac-auth-https
  • GitHub Check: Examples / Convert federation-subscriptions-passthrough
  • GitHub Check: Examples / Convert apq-subgraphs
  • GitHub Check: Examples / Convert file-upload
  • GitHub Check: Examples / Convert federation-mixed
  • GitHub Check: Examples / Convert federation-example
  • GitHub Check: Examples / Convert extra-fields
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Mend Security Check
🔇 Additional comments (11)
packages/winston/src/index.ts (3)

11-11: Use Number.POSITIVE_INFINITY instead of Infinity.

This comment duplicates a past review note about using Number.POSITIVE_INFINITY for clarity and consistency in ES2015.

🧰 Tools
🪛 Biome (1.9.4)

[error] 11-11: Use Number.POSITIVE_INFINITY instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.POSITIVE_INFINITY instead.

(lint/style/useNumberNamespace)


15-15: Avoid reassigning function parameters.

This comment duplicates a past review note about using a local variable instead of reassigning the function parameter arg. Reassigning parameters can be confusing.

🧰 Tools
🪛 Biome (1.9.4)

[error] 15-15: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)


28-28: Verify the Disposable import/export.

The WinstonLoggerAdapter class implements Disposable, but it's unclear if '@whatwg-node/disposablestack' exports it. Please confirm or update the import.

❌ Verification inconclusive

🏁 Script executed:

#!/bin/bash
# Description: Searching for Disposable export definition in '@whatwg-node/disposablestack'
fd disposablestack | xargs cat | grep "export.*Disposable"

Length of output: 60


Based on our investigation, there is no evidence in the repository that the package @whatwg-node/disposablestack exports a type or interface named Disposable. Our initial grep for a matching export pattern returned no output, and a subsequent case‐insensitive search for any export of “Disposable” also yielded no findings.

It appears that the implementation of

class WinstonLoggerAdapter implements MeshLogger, Disposable {

is expecting a Disposable export that isn’t present in the referenced module. Please verify with the dependency’s documentation or source code to determine whether:

  • The package is indeed meant to export a Disposable type, or
  • The import should be updated (or replaced with a locally defined type) to correctly match the intended behavior.

If the dependency truly does not export Disposable, you should update the import or the implementation accordingly.

packages/winston/tests/winston.spec.ts (2)

8-14: Consider using a more robust callback handling approach.

This comment duplicates a past suggestion to reduce fragility by employing a queue or promise-based mechanism instead of reassigning lastCallback for asynchronous scenarios.


29-38: Extract repeated test data into a shared fixture.

This duplicates a past suggestion. The testData array is reused for multiple test cases; consider placing it in a shared constant to improve maintainability.

Also applies to: 67-76, 107-116, 147-156

.changeset/wild-balloons-repair.md (3)

1-3: Confirm correctness of major version bump.

This duplicates a past remark questioning the need for a major release here. Ensure it aligns with the changeset tooling and semver guidelines.


9-30: Consider providing an error handling example.

This duplicates a past suggestion to showcase error-logging usage in addition to the basic setup demonstrated.


5-30: Ensure documentation updates in the console project.

This duplicates a past remark reminding you to add or confirm documentation in the graphql-hive/console repository, or create a follow-up issue if missing.

packages/winston/package.json (3)

21-33: Verify the exports field configuration.

The exports field is well-structured for dual module support (CommonJS and ESM). Please verify that using the custom declaration file "./dist/index.d.cts" under "require" is supported by your tooling.


51-55: Update tslib dependency.

The tslib dependency might not be the latest version. Let's verify the latest stable version.

✅ Verification successful

🌐 Web query:

What is the latest stable version of tslib npm package?

💡 Result:

The latest stable version of the tslib npm package is 2.8.1, released on October 31, 2024[1][3][7]. This version includes fixes for helper functions and workflow improvements[7].

For installation:

npm install tslib

or with yarn:

yarn add tslib

The package is actively maintained by Microsoft, with regular updates and a healthy release cadence[2][7].

Citations:


Action: No update required for tslib dependency

The tslib version in the file (^2.8.1) is already set to the latest stable release.

  • File: packages/winston/package.json (Lines 51-55)

42-45: Verify Winston peer dependency version.

The Winston peer dependency is set to "^3.17.0". Let's verify if this is the latest stable version and if it includes all required features.

✅ Verification successful

🌐 Web query:

What is the latest stable version of winston npm package?

💡 Result:

The latest stable version of the winston npm package is v3.17.0, released on November 9, 2024[7][3]. This version includes updates such as:

  • Dependency bumps for logform and winston-transport
  • Security fixes for Node.js 18 compatibility
  • New transport integrations (e.g., Parseable transport)[7]

Key details from recent releases:

Version Release Date Notable Changes
3.17.0 2024-11-09 Updated dependencies and transport improvements[7][3]
3.16.0 2024-11-01 Maintenance updates
3.15.0 2024-10-04 Bug fixes and documentation improvements

The package maintains MIT licensing and weighs ~271 kB with 11 dependencies[3]. For production use with Elasticsearch or Google Cloud integrations, compatible versions include:

  • winston-elasticsearch@0.19.0[4]
  • @google-cloud/logging-winston@6.0.0[6][9]

Install via npm:

npm install winston@3.17.0

Citations:


Winston Peer Dependency Verified:
The peer dependency is set to "^3.17.0", which matches the latest stable version of winston according to the web query. No changes required.

packages/winston/src/index.ts Outdated Show resolved Hide resolved
.changeset/wild-balloons-repair.md Show resolved Hide resolved
packages/winston/package.json Outdated Show resolved Hide resolved
packages/winston/package.json Outdated Show resolved Hide resolved
Copy link

@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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between dd844e6 and 89f930e.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • .changeset/wild-balloons-repair.md (1 hunks)
  • packages/logger-winston/package.json (1 hunks)
  • packages/logger-winston/src/index.ts (1 hunks)
  • packages/logger-winston/tests/winston.spec.ts (1 hunks)
  • tsconfig.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**`: For all PRs, we would like to verify that a Linear iss...

**: For all PRs, we would like to verify that a Linear issue is linked. Check if there's a mention for "GW-*" in the PR description, and the us know when it's missing.

In most cases, when a PR adds a new functionality, we would like to make sure it has documentation in the corresponding console project.
Use the global knowledge feature to search for PRs in graphql-hive/console repository that adds documentation. Suggest to create a follow up issue to add the missing documentation.

  • tsconfig.json
  • packages/logger-winston/tests/winston.spec.ts
  • packages/logger-winston/package.json
  • packages/logger-winston/src/index.ts
`packages/**`: In this directory we keep all packages releva...

packages/**: In this directory we keep all packages relevant to the gateway.

In most cases, when changes are made to the source code / dependencies in these directories, we also require to have a corresponding changeset file, created using yarn changeset with a full description on the changes with an example.
Also, when new features are added the packages, the changeset file should mention minor semver change. When a bug is fixed, patch needs to be used. The major bump is used for a PR that has breaking changes.

  • packages/logger-winston/tests/winston.spec.ts
  • packages/logger-winston/package.json
  • packages/logger-winston/src/index.ts
🪛 Biome (1.9.4)
packages/logger-winston/src/index.ts

[error] 23-23: This type annotation is trivially inferred from its initialization.

Safe fix: Remove the type annotation.

(lint/style/noInferrableTypes)


[error] 35-35: Template literals are preferred over string concatenation.

Unsafe fix: Use a template literal.

(lint/style/useTemplate)


[error] 10-10: Use Number.POSITIVE_INFINITY instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.POSITIVE_INFINITY instead.

(lint/style/useNumberNamespace)


[error] 13-13: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)


[error] 16-16: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)


[error] 25-25: This let declares a variable that is only assigned once.

'messageArg' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)


[error] 80-80: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)

⏰ Context from checks skipped due to timeout of 90000ms (18)
  • GitHub Check: Examples / Convert operation-field-permissions
  • GitHub Check: Examples / Convert type-merging-batching
  • GitHub Check: Examples / Convert subscriptions-with-transforms
  • GitHub Check: Examples / Convert programmatic-batching
  • GitHub Check: Examples / Convert openapi-subscriptions
  • GitHub Check: Examples / Convert openapi-javascript-wiki
  • GitHub Check: Examples / Convert openapi-arg-rename
  • GitHub Check: Examples / Convert openapi-additional-resolvers
  • GitHub Check: Examples / Convert json-schema-subscriptions
  • GitHub Check: Examples / Convert interface-additional-resolvers
  • GitHub Check: Examples / Convert hmac-auth-https
  • GitHub Check: Examples / Convert federation-subscriptions-passthrough
  • GitHub Check: Examples / Convert apq-subgraphs
  • GitHub Check: Examples / Convert file-upload
  • GitHub Check: Examples / Convert federation-mixed
  • GitHub Check: Examples / Convert federation-example
  • GitHub Check: Examples / Convert extra-fields
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (9)
packages/logger-winston/src/index.ts (1)

95-99: Looks good.
This helper cleanly constructs a WinstonLoggerAdapter from an existing Winston logger.

packages/logger-winston/tests/winston.spec.ts (1)

6-146: Tests are comprehensive.
All logging levels, child loggers, and deduplication scenarios appear well-covered. Great job verifying output via JSON parsing. No critical issues found.

.changeset/wild-balloons-repair.md (3)

2-2: Check if “major” bump is necessary.

This package is newly introduced, so a minor bump often suffices unless you’re seeing a breaking change across the ecosystem. Also, ensure this version notation aligns with the changeset tooling requirements.


5-30: Confirm or create corresponding documentation in the console.

As this PR adds new functionality, please ensure the documentation is updated in the graphql-hive/console repository or create a follow-up issue if needed.


1-31: Link a relevant Linear issue or create one.

No reference to “GW-*” is found in this PR. Please update the PR description or changeset with a reference to the appropriate Linear ticket, or create one if necessary.

packages/logger-winston/package.json (3)

2-19: LGTM! Package metadata and configuration look good.

The package metadata is well-configured with:

  • Appropriate name and repository information
  • Node.js engine requirement >=18.0.0
  • Proper licensing and author information

20-37: LGTM! Module configuration is properly set up.

The package correctly:

  • Provides both CommonJS and ES module formats
  • Includes TypeScript type definitions
  • Specifies the dist directory in files array

42-60: Verify the winston peer dependency version.

The winston peer dependency is set to ^3.17.0. Let's verify this is the latest stable version to ensure we're not missing any important features or security fixes.

✅ Verification successful

🌐 Web query:

What is the latest stable version of winston?

💡 Result:

The latest stable version of winston is 3.17.0, released on November 9, 2024[2][5]. This release includes updates such as dependency bumps for logform and winston-transport, along with maintenance changes like CI autotesting and codebase improvements[2].

Key details from recent releases:

  • v3.17.0 (Nov 2024):
    • Dependency updates (logform, winston-transport@4.x)
    • Maintenance fixes and CI improvements[2]
  • v3.16.xv3.13.x (2024):
    • Node.js compatibility adjustments
    • Security patches and transport enhancements[2][4]

The npm registry confirms this version as current[5], while earlier sources like JS LibHunt (listing v3.8.1)[1] are outdated by comparison to GitHub’s release history[2] and npm’s package data[5].

Citations:


Winston Peer Dependency Verified

The winston peer dependency is set to ^3.17.0, which matches the latest stable version as confirmed by the web query. No update is needed.

tsconfig.json (1)

62-63: LGTM! Path mapping is correctly configured.

The new path mapping for @graphql-hive/logger-winston follows the existing pattern and maintains alphabetical order.

packages/logger-winston/src/index.ts Show resolved Hide resolved
packages/logger-winston/src/index.ts Outdated Show resolved Hide resolved
Copy link

@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

♻️ Duplicate comments (6)
packages/logger-winston/src/index.ts (6)

10-10: 🧹 Nitpick (assertive)

Use Number.POSITIVE_INFINITY for consistency.

ES2015 moved some globals into the Number namespace. Replacing .flat(Infinity) with .flat(Number.POSITIVE_INFINITY) aligns with modern JavaScript standards.

-    .flat(Infinity)
+    .flat(Number.POSITIVE_INFINITY)
🧰 Tools
🪛 Biome (1.9.4)

[error] 10-10: Use Number.POSITIVE_INFINITY instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.POSITIVE_INFINITY instead.

(lint/style/useNumberNamespace)


13-16: 🧹 Nitpick (assertive)

Avoid reassigning the function parameter inside the callback.

Updating function parameters is confusing. Instead, store the updated value in a new local variable.

- .flatMap((messageArg) => {
-   if (typeof messageArg === 'function') {
-     messageArg = messageArg();
-   }
-   if (messageArg?.toJSON) {
-     messageArg = messageArg.toJSON();
-   }
-   ...
+ .flatMap((originalArg) => {
+   let localArg = typeof originalArg === 'function' ? originalArg() : originalArg;
+   if (localArg?.toJSON) {
+     localArg = localArg.toJSON();
+   }
+   ...
🧰 Tools
🪛 Biome (1.9.4)

[error] 13-13: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)


[error] 16-16: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)


23-23: 🧹 Nitpick (assertive)

Remove the trivially inferred type annotation.

Declaring message as string is redundant since its initializer already infers the type.

-  let message: string = '';
+  let message = '';
🧰 Tools
🪛 Biome (1.9.4)

[error] 23-23: This type annotation is trivially inferred from its initialization.

Safe fix: Remove the type annotation.

(lint/style/noInferrableTypes)


25-25: 🧹 Nitpick (assertive)

Use const instead of let where the value is never reassigned.

This improves code clarity and enforces immutability.

-for (let messageArg of flattenedMessageArgs) {
+for (const messageArg of flattenedMessageArgs) {
🧰 Tools
🪛 Biome (1.9.4)

[error] 25-25: This let declares a variable that is only assigned once.

'messageArg' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)


35-35: 🧹 Nitpick (assertive)

Use a template literal for string concatenation.

Template literals are more readable and recommended over +.

-      message = message ? message + ', ' + messageArg : messageArg;
+      message = message ? `${message}, ${messageArg}` : `${messageArg}`;
🧰 Tools
🪛 Biome (1.9.4)

[error] 35-35: Template literals are preferred over string concatenation.

Unsafe fix: Use a template literal.

(lint/style/useTemplate)


80-80: 🧹 Nitpick (assertive)

Avoid reassigning the nameOrMeta parameter in the child method.

Use a local variable to improve clarity, as repeatedly changing the parameter can be confusing.

if (typeof nameOrMeta === 'string') {
-  nameOrMeta = {
+  const newMeta = {
     name: this.name
       ? this.name.includes(nameOrMeta)
         ? this.name
         : `${this.name}, ${nameOrMeta}`
       : nameOrMeta,
  };
  return new WinstonLoggerAdapter(
-    this.winstonLogger.child(nameOrMeta),
+    this.winstonLogger.child(newMeta),
    {
      ...this.meta,
-     ...nameOrMeta,
+     ...newMeta,
    }
  );
}
🧰 Tools
🪛 Biome (1.9.4)

[error] 80-80: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 89f930e and 4703c15.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • packages/logger-winston/src/index.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`packages/**`: In this directory we keep all packages releva...

packages/**: In this directory we keep all packages relevant to the gateway.

In most cases, when changes are made to the source code / dependencies in these directories, we also require to have a corresponding changeset file, created using yarn changeset with a full description on the changes with an example.
Also, when new features are added the packages, the changeset file should mention minor semver change. When a bug is fixed, patch needs to be used. The major bump is used for a PR that has breaking changes.

  • packages/logger-winston/src/index.ts
`**`: For all PRs, we would like to verify that a Linear iss...

**: For all PRs, we would like to verify that a Linear issue is linked. Check if there's a mention for "GW-*" in the PR description, and the us know when it's missing.

In most cases, when a PR adds a new functionality, we would like to make sure it has documentation in the corresponding console project.
Use the global knowledge feature to search for PRs in graphql-hive/console repository that adds documentation. Suggest to create a follow up issue to add the missing documentation.

  • packages/logger-winston/src/index.ts
🪛 Biome (1.9.4)
packages/logger-winston/src/index.ts

[error] 23-23: This type annotation is trivially inferred from its initialization.

Safe fix: Remove the type annotation.

(lint/style/noInferrableTypes)


[error] 35-35: Template literals are preferred over string concatenation.

Unsafe fix: Use a template literal.

(lint/style/useTemplate)


[error] 10-10: Use Number.POSITIVE_INFINITY instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.POSITIVE_INFINITY instead.

(lint/style/useNumberNamespace)


[error] 13-13: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)


[error] 16-16: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)


[error] 25-25: This let declares a variable that is only assigned once.

'messageArg' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)


[error] 80-80: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)

⏰ Context from checks skipped due to timeout of 90000ms (22)
  • GitHub Check: Unit / Bun
  • GitHub Check: E2E / Bun Docker on Ubuntu
  • GitHub Check: E2E / Bun on Ubuntu
  • GitHub Check: Leaks / Node v23
  • GitHub Check: E2E / Node Binary on Windows
  • GitHub Check: Leaks / Node v22
  • GitHub Check: E2E / Node Binary on Ubuntu
  • GitHub Check: Leaks / Node v20
  • GitHub Check: E2E / Node Docker on Ubuntu
  • GitHub Check: Benchmark / bun / 1000 items
  • GitHub Check: E2E / Node 23 on Ubuntu
  • GitHub Check: Benchmark / bun / 100 items
  • GitHub Check: Leaks / Node v18
  • GitHub Check: Benchmark / bun / 10 items
  • GitHub Check: E2E / Node 22 on Ubuntu
  • GitHub Check: Snapshot / snapshot
  • GitHub Check: Benchmark / node / 1000 items
  • GitHub Check: E2E / Node 20 on Ubuntu
  • GitHub Check: Benchmark / node / 100 items
  • GitHub Check: E2E / Node 18 on Ubuntu
  • GitHub Check: Bundle
  • GitHub Check: Benchmark / node / 10 items

packages/logger-winston/src/index.ts Show resolved Hide resolved
@ardatan ardatan marked this pull request as ready for review February 12, 2025 20:46
@dotansimha dotansimha self-requested a review February 13, 2025 10:44
@ardatan ardatan merged commit 16f9bd9 into main Feb 13, 2025
64 checks passed
@ardatan ardatan deleted the winston-adapter branch February 13, 2025 11:42
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.

4 participants