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

feat: force cleanup at boot with SYNC_FORCE_REMOVE=true #956

Merged
merged 7 commits into from
Jan 11, 2025

Conversation

michael-0acf4
Copy link
Contributor

@michael-0acf4 michael-0acf4 commented Jan 8, 2025

Migration notes

None

  • The change comes with new or modified tests
  • Hard-to-understand functions have explanatory comments
  • End-user documentation is updated to reflect the change

Summary by CodeRabbit

  • New Features

    • Added optional SYNC_FORCE_REMOVE configuration variable for typegate synchronization.
    • Introduced ability to forcefully remove cached typegraphs at boot.
    • Added a new method to retrieve all history entries from the Redis replicated map.
    • Introduced a new function to return a greeting based on a provided name.
    • Added a synchronization feature test suite for validating cleanup logic.
  • Documentation

    • Updated documentation to reflect new synchronization configuration option.
  • Improvements

    • Enhanced the Typegate class with a method to facilitate bulk removal of typegraphs during initialization.
    • Made the replicatedMap parameter publicly accessible in the ReplicatedRegister class constructor.
    • Updated configuration retrieval to include the new forceRemove property.

Copy link

linear bot commented Jan 8, 2025

Copy link
Contributor

coderabbitai bot commented Jan 8, 2025

📝 Walkthrough

Walkthrough

The pull request introduces a new optional configuration variable SYNC_FORCE_REMOVE for typegate synchronization, allowing users to specify whether cached typegraphs should be undeployed at boot. The changes span multiple files, adding support for this feature by updating configuration schemas, modifying the configuration transformation logic, and implementing methods to handle forceful removal of typegraphs during initialization. Additionally, new methods and tests are introduced to ensure the functionality is properly validated.

Changes

File Change Summary
docs/metatype.dev/docs/reference/typegate/synchronization/index.mdx Added documentation for new SYNC_FORCE_REMOVE configuration variable.
src/typegate/src/config.ts Updated transformSyncConfig to include forceRemove property from raw.force_remove.
src/typegate/src/config/types.ts Added force_remove to syncConfigSchema with default false. Updated SyncConfigX type to include forceRemove boolean.
src/typegate/src/main.ts Added conditional logic to check forceRemove and call forceRemoveAllTypegraphs if truthy.
src/typegate/src/typegate/mod.ts Introduced new forceRemove() method to remove a typegraph by name and payload. Updated init method to call forceRemove for each entry in history if forceRemove is enabled.
src/typegate/src/sync/replicated_map.ts Added getAllHistory() method to RedisReplicatedMap for retrieving all history entries. Updated historySync to use getAllHistory().
src/typegate/src/typegate/register.ts Changed visibility of replicatedMap in ReplicatedRegister constructor from private to public.
tests/sync/sync_config_test.ts Modified getSyncConfig() to include forceRemove property in returned configuration when sync is enabled.
tests/e2e/published/published_test.ts Added force_remove property to syncConfig object in downloadAndExtractCli function.
tests/sync/scripts/hello.ts Introduced hello function that returns a greeting string.
tests/sync/sync.py Added sync function that exposes a method on a graph.
tests/sync/sync_force_remove_test.ts Added test suite for synchronization cleanup logic when forceRemove is enabled.

Sequence Diagram

sequenceDiagram
    participant Config as Configuration
    participant Typegate as Typegate Instance
    participant Engine as Registered Engines

    Config->>Typegate: Initialize with forceRemove=true
    Typegate->>Typegate: Check forceRemove flag
    Typegate->>Engine: forceRemoveAllTypegraphs()
    loop For each engine
        Typegate->>Engine: removeTypegraph()
    end
    Typegate-->>Config: Log warning about typegraph removal
Loading

Possibly related PRs

  • feat(meta-test): update t.engine() impl #716: The changes in this PR involve updates to the test framework and deployment logic, which may relate to the new SYNC_FORCE_REMOVE configuration variable introduced in the main PR, as both involve synchronization configurations and their handling in tests.
  • refactor: move to ghjk 0.2.0 #754: This PR includes updates to CI workflows and testing configurations, which could be relevant to the changes made in the main PR regarding synchronization settings and their implications in deployment and testing environments.

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.

@michael-0acf4 michael-0acf4 requested a review from a team January 8, 2025 17:13
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/typegate/src/main.ts (1)

56-59: LGTM! Consider adding more detailed logging.

The implementation correctly handles the force removal of typegraphs at boot. However, it would be helpful to add more detailed logging about the number of typegraphs being removed.

 if (config.sync?.forceRemove) {
-  logger.warn("Force removal of typegraphs at boot");
+  const engines = typegate.register.list();
+  logger.warn(`Force removal of ${engines.length} typegraphs at boot`);
   await typegate.forceRemoveAllTypegraphs();
 }
src/typegate/src/typegate/mod.ts (1)

400-404: Consider adding error handling for individual typegraph removals.

While the implementation is correct, it could be more robust by handling failures of individual typegraph removals without stopping the entire process.

 async forceRemoveAllTypegraphs() {
+  const errors: Array<[string, Error]> = [];
   for (const engine of this.register.list()) {
-    await this.removeTypegraph(engine.name);
+    try {
+      await this.removeTypegraph(engine.name);
+    } catch (error) {
+      logger.error(`Failed to remove typegraph ${engine.name}: ${error}`);
+      errors.push([engine.name, error]);
+    }
   }
+  if (errors.length > 0) {
+    throw new Error(`Failed to remove ${errors.length} typegraphs: ${errors.map(([name]) => name).join(', ')}`);
+  }
 }
docs/metatype.dev/docs/reference/typegate/synchronization/index.mdx (1)

72-72: Enhance documentation with usage details and warnings.

While the documentation is clear, it would be helpful to add more details about:

  • The implications of using this feature
  • When to use it
  • Potential risks
-| SYNC\__FORCE_REMOVE (\_Optional_)   | `true` or `false`, Undeploy cached typegraphs at boot        |
+| SYNC\__FORCE_REMOVE (\_Optional_)   | `true` or `false`, Undeploy cached typegraphs at boot. Use with caution as this will remove all deployed typegraphs during startup, requiring redeployment. Useful for clean slate scenarios or recovering from corrupted states. |
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c60f4ee and 74fbd47.

📒 Files selected for processing (5)
  • docs/metatype.dev/docs/reference/typegate/synchronization/index.mdx (1 hunks)
  • src/typegate/src/config.ts (1 hunks)
  • src/typegate/src/config/types.ts (1 hunks)
  • src/typegate/src/main.ts (1 hunks)
  • src/typegate/src/typegate/mod.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: bulid-docker (linux/amd64, custom-ubuntu-large)
  • GitHub Check: lint-compat (macos-14, aarch64-apple-darwin, false)
  • GitHub Check: lint-compat (macos-13, x86_64-apple-darwin, false)
  • GitHub Check: test-full
  • GitHub Check: pre-commit
🔇 Additional comments (3)
src/typegate/src/config/types.ts (1)

118-118: LGTM! Configuration schema changes are well-structured.

The schema and type definitions for the force removal feature are correctly implemented with appropriate defaults and consistent naming.

Also applies to: 125-125

docs/metatype.dev/docs/reference/typegate/synchronization/index.mdx (1)

Line range hint 400-404: Add tests for the force removal feature.

The feature would benefit from integration tests that verify:

  • The force removal behavior when enabled/disabled
  • Error handling during removal
  • Interaction with system typegraphs

Would you like me to help create test cases for this feature?

src/typegate/src/config.ts (1)

120-120: LGTM! Clean implementation following existing conventions.

The new property follows the established naming convention of transforming snake_case input to camelCase output, consistent with other properties in the configuration.

Let's verify the type definition update in the types file:

✅ Verification successful

Implementation verified - both type checking and runtime validation are in place

The forceRemove property is properly implemented with:

  • Type definition in SyncConfigX
  • Runtime validation through syncConfigSchema
  • Consistent naming convention in the transformation layer
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the type definition update for SyncConfigX in config/types.ts

# Test: Check if the forceRemove property is properly defined in SyncConfigX
ast-grep --pattern 'type SyncConfigX = {
  $$$
  forceRemove: $_
  $$$
}'

# Test: Check if force_remove is properly defined in syncConfigSchema
ast-grep --pattern 'syncConfigSchema = $_.object({
  $$$
  force_remove: $_
  $$$
})'

Length of output: 511


Script:

#!/bin/bash
# Search for zod schema definitions related to force_remove
rg -A 5 "force_remove.*z\." || rg -A 5 "force_remove:.*boolean"

# Search for any schema definition files
fd "schema" --type f --exec rg -l "force_remove"

Length of output: 111


Script:

#!/bin/bash
# Find the schema validation pattern by looking at s3_bucket validation
# since it's a known property in SyncConfigX
rg -B 5 -A 5 "s3_bucket.*schema" || rg -B 5 -A 5 "s3_bucket:.*z\."

# Look for the syncConfigSchema definition
ast-grep --pattern 'syncConfigSchema = $_.object({
  $$$
})'

Length of output: 130


Script:

#!/bin/bash
# Look at the config.ts file content to understand the validation pattern
cat src/typegate/src/config.ts

Length of output: 4046

Yohe-Am
Yohe-Am previously approved these changes Jan 8, 2025
Copy link
Contributor

@Yohe-Am Yohe-Am left a comment

Choose a reason for hiding this comment

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

Looking good, any thoughts about tests?

@Yohe-Am
Copy link
Contributor

Yohe-Am commented Jan 8, 2025

@coderabbitai can you generate tests for this functionality in a new file within tests/sync? Look at the tests/runtimes/wasm_wire/wasm_sync_test.ts file to understand the needs for testing sync functionality.

Copy link
Contributor

coderabbitai bot commented Jan 8, 2025

Tip

For best results, initiate chat on the files or code changes.

@Yohe-Am Here's a test file for the force cleanup functionality. I suggest creating it as tests/sync/force_cleanup_test.ts:

// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Meta } from "test-utils/mod.ts";
import { connect } from "redis";
import { S3Client } from "aws-sdk/client-s3";
import { createBucket, listObjects, tryDeleteBucket } from "test-utils/s3.ts";
import { assertEquals } from "@std/assert";

const redisKey = "typegraph";
const redisEventKey = "typegraph_event";

async function cleanUp(config: typeof syncConfig) {
  using redis = await connect(config.redis);
  await redis.del(redisKey);
  await redis.del(redisEventKey);

  const s3 = new S3Client(config.s3);
  await tryDeleteBucket(s3, config.s3Bucket);
  await createBucket(s3, config.s3Bucket);
  s3.destroy();
  await redis.quit();
}

const syncConfig = {
  redis: {
    hostname: "localhost",
    port: 6379,
    password: "password",
    db: 4,
  },
  s3: {
    endpoint: "http://localhost:9000",
    region: "local",
    credentials: {
      accessKeyId: "minio",
      secretAccessKey: "password",
    },
    forcePathStyle: true,
  },
  s3Bucket: "metatype-force-cleanup-test",
  force_remove: false,
};

Meta.test(
  {
    name: "Force Cleanup: Sync Config",
    syncConfig,
    async setup() {
      await cleanUp(syncConfig);
    },
    async teardown() {
      await cleanUp(syncConfig);
    },
  },
  async (metaTest) => {
    await metaTest.should("preserve typegraphs when force_remove is false", async () => {
      // Deploy first engine
      const engine1 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Create new typegate instance without force_remove
      const engine2 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Verify both engines are still available
      const s3 = new S3Client(syncConfig.s3);
      const objects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(objects?.length, 3); // artifact + typegraphs
      s3.destroy();
    });

    await metaTest.should("remove typegraphs when force_remove is true", async () => {
      // Update config to enable force_remove
      const forceConfig = {
        ...syncConfig,
        force_remove: true,
      };

      // Deploy first engine
      const engine1 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Create new typegate instance with force_remove enabled
      const engine2 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts", {
        syncConfig: forceConfig,
      });
      
      // Verify typegraphs were removed
      const s3 = new S3Client(syncConfig.s3);
      const objects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(objects?.length, 0); // All typegraphs should be removed
      s3.destroy();
    });
  },
);

This test file:

  1. Tests both scenarios where force_remove is enabled and disabled
  2. Verifies that typegraphs are preserved by default
  3. Confirms that typegraphs are removed when force_remove is enabled
  4. Follows the same patterns as existing sync tests
  5. Uses the same cleanup and setup mechanisms

Let me know if you'd like any modifications to the test cases!

🔗 Analysis chain
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if tests/sync directory exists
fd --type d "sync$" tests/

# Get the reference test file content
cat tests/runtimes/wasm_wire/wasm_sync_test.ts

# Look for any other sync-related test files that might be helpful
fd --type f "sync.*test" tests/

Length of output: 3372

src/typegate/src/typegate/mod.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/typegate/src/sync/replicated_map.ts (1)

108-120: Consider using array destructuring for better readability.

The implementation is correct, but readability could be improved by using array destructuring to handle key-value pairs.

-    for (let i = 0; i < all.length; i += 2) {
-      history.push({
-        name: all[i],
-        payload: all[i+1]
-      });
+    for (let i = 0; i < all.length; i += 2) {
+      const [name, payload] = [all[i], all[i+1]];
+      history.push({ name, payload });
+    }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 74fbd47 and 0e3404b.

📒 Files selected for processing (4)
  • src/typegate/src/main.ts (0 hunks)
  • src/typegate/src/sync/replicated_map.ts (1 hunks)
  • src/typegate/src/typegate/mod.ts (3 hunks)
  • src/typegate/src/typegate/register.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • src/typegate/src/main.ts
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: bulid-docker (linux/amd64, custom-ubuntu-large)
  • GitHub Check: lint-compat (macos-14, aarch64-apple-darwin, false)
  • GitHub Check: test-full
  • GitHub Check: lint-compat (macos-13, x86_64-apple-darwin, false)
  • GitHub Check: pre-commit
🔇 Additional comments (3)
src/typegate/src/typegate/register.ts (1)

89-89: LGTM! Constructor parameter visibility change is appropriate.

The change from private to public visibility for replicatedMap is necessary to support the new force cleanup feature by allowing access to the map's history.

src/typegate/src/sync/replicated_map.ts (1)

133-141: LGTM! Proper error handling and logging.

The implementation includes appropriate error handling with the ensure check and informative logging.

src/typegate/src/typegate/mod.ts (1)

410-424: LGTM! Comprehensive force cleanup implementation.

The forceRemove method properly handles:

  • Typegraph ID parsing
  • Artifact reference cleanup
  • Garbage collection
  • Logging for observability

src/typegate/src/typegate/mod.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/typegate/src/typegate/mod.ts (1)

415-429: Add explicit error handling for download and schema validation.

While the implementation is functionally correct, consider enhancing error handling:

 async forceRemove(name: string, payload: string, typegraphStore: TypegraphStore) {
   logger.warn(`Dropping "${name}": started`);
-  const typegraphId = typegraphIdSchema.parse(JSON.parse(payload));
-  const [tg] = await typegraphStore.download(
-    typegraphId,
-  );
+  let typegraphId;
+  try {
+    typegraphId = typegraphIdSchema.parse(JSON.parse(payload));
+  } catch (e) {
+    throw new Error(`Invalid typegraph ID in payload for "${name}": ${e.message}`);
+  }
+
+  let tg;
+  try {
+    [tg] = await typegraphStore.download(typegraphId);
+  } catch (e) {
+    throw new Error(`Failed to download typegraph "${name}": ${e.message}`);
+  }

   const artifacts = new Set(
     Object.values(tg.meta.artifacts).map((m) => m.hash),
   );

   await this.register.remove(name);
   await this.artifactStore.updateRefCounts(new Set(), artifacts);
   await this.artifactStore.runArtifactGC();
   logger.warn(`Dropping "${name}": done`);
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0e3404b and a9d12b2.

📒 Files selected for processing (3)
  • src/typegate/src/config/types.ts (1 hunks)
  • src/typegate/src/typegate/mod.ts (3 hunks)
  • tests/sync/sync_config_test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/typegate/src/config/types.ts
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: lint-compat (macos-14, aarch64-apple-darwin, false)
  • GitHub Check: bulid-docker (linux/amd64, custom-ubuntu-large)
  • GitHub Check: lint-compat (macos-13, x86_64-apple-darwin, false)
  • GitHub Check: test-full
  • GitHub Check: pre-commit
🔇 Additional comments (4)
tests/sync/sync_config_test.ts (1)

45-45: LGTM!

The test case correctly verifies that forceRemove defaults to false when sync is enabled.

src/typegate/src/typegate/mod.ts (3)

46-46: LGTM!

The import statement correctly includes the required dependencies for the new force cleanup functionality.


144-148: LGTM!

The initialization sequence correctly integrates the TypegraphStore with the ReplicatedRegister.


155-166: LGTM! Robust implementation with proper error handling.

The force cleanup implementation correctly:

  • Checks the configuration flag
  • Safely iterates through history
  • Handles errors gracefully with proper logging and Sentry integration
  • Continues processing even if individual removals fail

@michael-0acf4
Copy link
Contributor Author

michael-0acf4 commented Jan 9, 2025

Tip

For best results, initiate chat on the files or code changes.

@Yohe-Am Here's a test file for the force cleanup functionality. I suggest creating it as tests/sync/force_cleanup_test.ts:

// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Meta } from "test-utils/mod.ts";
import { connect } from "redis";
import { S3Client } from "aws-sdk/client-s3";
import { createBucket, listObjects, tryDeleteBucket } from "test-utils/s3.ts";
import { assertEquals } from "@std/assert";

const redisKey = "typegraph";
const redisEventKey = "typegraph_event";

async function cleanUp(config: typeof syncConfig) {
  using redis = await connect(config.redis);
  await redis.del(redisKey);
  await redis.del(redisEventKey);

  const s3 = new S3Client(config.s3);
  await tryDeleteBucket(s3, config.s3Bucket);
  await createBucket(s3, config.s3Bucket);
  s3.destroy();
  await redis.quit();
}

const syncConfig = {
  redis: {
    hostname: "localhost",
    port: 6379,
    password: "password",
    db: 4,
  },
  s3: {
    endpoint: "http://localhost:9000",
    region: "local",
    credentials: {
      accessKeyId: "minio",
      secretAccessKey: "password",
    },
    forcePathStyle: true,
  },
  s3Bucket: "metatype-force-cleanup-test",
  force_remove: false,
};

Meta.test(
  {
    name: "Force Cleanup: Sync Config",
    syncConfig,
    async setup() {
      await cleanUp(syncConfig);
    },
    async teardown() {
      await cleanUp(syncConfig);
    },
  },
  async (metaTest) => {
    await metaTest.should("preserve typegraphs when force_remove is false", async () => {
      // Deploy first engine
      const engine1 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Create new typegate instance without force_remove
      const engine2 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Verify both engines are still available
      const s3 = new S3Client(syncConfig.s3);
      const objects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(objects?.length, 3); // artifact + typegraphs
      s3.destroy();
    });

    await metaTest.should("remove typegraphs when force_remove is true", async () => {
      // Update config to enable force_remove
      const forceConfig = {
        ...syncConfig,
        force_remove: true,
      };

      // Deploy first engine
      const engine1 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Create new typegate instance with force_remove enabled
      const engine2 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts", {
        syncConfig: forceConfig,
      });
      
      // Verify typegraphs were removed
      const s3 = new S3Client(syncConfig.s3);
      const objects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(objects?.length, 0); // All typegraphs should be removed
      s3.destroy();
    });
  },
);

This test file:

  1. Tests both scenarios where force_remove is enabled and disabled
  2. Verifies that typegraphs are preserved by default
  3. Confirms that typegraphs are removed when force_remove is enabled
  4. Follows the same patterns as existing sync tests
  5. Uses the same cleanup and setup mechanisms

Let me know if you'd like any modifications to the test cases!

🔗 Analysis chain
🏁 Scripts executed

@coderabbitai this test does not reflect the new changes, can you review one last time now that engines are not produced anymore from the redis and s3? We drop all of it before sync (note: sync creates engines from stored typegraphs).

Copy link
Contributor

coderabbitai bot commented Jan 9, 2025

Tip

For best results, initiate chat on the files or code changes.

@michael-0acf4 Here's the updated test file that correctly reflects the new changes:

// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { Meta } from "test-utils/mod.ts";
import { connect } from "redis";
import { S3Client } from "aws-sdk/client-s3";
import { createBucket, listObjects, tryDeleteBucket } from "test-utils/s3.ts";
import { assertEquals } from "@std/assert";
import { Typegate } from "@metatype/typegate/typegate/mod.ts";

const redisKey = "typegraph";
const redisEventKey = "typegraph_event";

async function cleanUp(config: typeof syncConfig) {
  using redis = await connect(config.redis);
  await redis.del(redisKey);
  await redis.del(redisEventKey);

  const s3 = new S3Client(config.s3);
  await tryDeleteBucket(s3, config.s3Bucket);
  await createBucket(s3, config.s3Bucket);
  s3.destroy();
  await redis.quit();
}

const syncConfig = {
  redis: {
    hostname: "localhost",
    port: 6379,
    password: "password",
    db: 4,
  },
  s3: {
    endpoint: "http://localhost:9000",
    region: "local",
    credentials: {
      accessKeyId: "minio",
      secretAccessKey: "password",
    },
    forcePathStyle: true,
  },
  s3Bucket: "metatype-force-cleanup-test",
  force_remove: false,
};

Meta.test(
  {
    name: "Force Cleanup: Sync Config",
    syncConfig,
    async setup() {
      await cleanUp(syncConfig);
    },
    async teardown() {
      await cleanUp(syncConfig);
    },
  },
  async (metaTest) => {
    await metaTest.should("preserve stored typegraphs when force_remove is false", async () => {
      // Deploy typegraphs to store them in Redis and S3
      await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Verify typegraphs are stored
      const s3 = new S3Client(syncConfig.s3);
      const objects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(objects?.length, 3); // artifact + typegraphs
      
      // Create new typegate instance without force_remove
      const typegate2 = await Typegate.init(syncConfig);
      
      // Verify typegraphs are preserved
      const objectsAfterSync = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(objectsAfterSync?.length, 3);
      
      await typegate2.deinit();
      s3.destroy();
    });

    await metaTest.should("remove stored typegraphs when force_remove is true", async () => {
      // Deploy typegraphs to store them in Redis and S3
      await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Verify typegraphs are stored
      const s3 = new S3Client(syncConfig.s3);
      const objects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(objects?.length, 3);
      
      // Create new typegate instance with force_remove enabled
      const forceConfig = {
        ...syncConfig,
        force_remove: true,
      };
      const typegate2 = await Typegate.init(forceConfig);
      
      // Verify typegraphs are removed
      const objectsAfterSync = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(objectsAfterSync?.length, 0);
      
      await typegate2.deinit();
      s3.destroy();
    });
  },
);

Key changes made:

  1. Removed the engine creation after sync since engines are now created by sync from stored typegraphs
  2. Added verification of stored typegraphs before and after sync
  3. Used Typegate.init() to test the force cleanup functionality
  4. Added proper cleanup with deinit() for typegate instances

Let me know if you'd like any adjustments to the test cases!

🔗 Analysis chain
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for sync-related implementation in typegate
rg -A 10 "sync.*typegraph" src/typegate/
# Look for sync test implementations
fd --type f "sync.*test" tests/

Length of output: 2665


Script:

#!/bin/bash
# Check the content of existing sync test files
cat tests/sync/typegraph_sync_test.ts.disable
cat tests/runtimes/wasm_wire/wasm_sync_test.ts

Length of output: 6201


✏️ Learnings added
Learnt from: michael-0acf4
URL: https://github.com/metatypedev/metatype/pull/956

Timestamp: 2025-01-09T17:28:57.859Z
Learning: When testing sync functionality with force cleanup, engines are not produced from Redis and S3. Instead, typegraphs are stored first, and then sync creates engines from the stored typegraphs. The force cleanup feature drops all stored typegraphs before sync when enabled.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Copy link
Contributor

coderabbitai bot commented Jan 9, 2025

Tip

For best results, initiate chat on the files or code changes.

@michael-0acf4 Here's the updated test file that reflects the new sync behavior:

// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { gql, Meta } from "test-utils/mod.ts";
import { connect } from "redis";
import { S3Client } from "aws-sdk/client-s3";
import { createBucket, listObjects, tryDeleteBucket } from "test-utils/s3.ts";
import { assertEquals } from "@std/assert";

const redisKey = "typegraph";
const redisEventKey = "typegraph_event";

async function cleanUp(config: typeof syncConfig) {
  using redis = await connect(config.redis);
  await redis.del(redisKey);
  await redis.del(redisEventKey);

  const s3 = new S3Client(config.s3);
  await tryDeleteBucket(s3, config.s3Bucket);
  await createBucket(s3, config.s3Bucket);
  s3.destroy();
  await redis.quit();
}

const syncConfig = {
  redis: {
    hostname: "localhost",
    port: 6379,
    password: "password",
    db: 4,
  },
  s3: {
    endpoint: "http://localhost:9000",
    region: "local",
    credentials: {
      accessKeyId: "minio",
      secretAccessKey: "password",
    },
    forcePathStyle: true,
  },
  s3Bucket: "metatype-force-cleanup-test",
  force_remove: false,
};

Meta.test(
  {
    name: "Force Cleanup: Sync Config",
    syncConfig,
    async setup() {
      await cleanUp(syncConfig);
    },
    async teardown() {
      await cleanUp(syncConfig);
    },
  },
  async (metaTest) => {
    await metaTest.should("preserve typegraphs during sync when force_remove is false", async () => {
      // Store initial typegraph
      const engine1 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Verify initial state
      const s3 = new S3Client(syncConfig.s3);
      const initialObjects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(initialObjects?.length, 3); // artifact + typegraphs
      
      // Create new typegate instance without force_remove
      const engine2 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Verify typegraphs are preserved and functional
      await gql`
        query {
          add(a: 11, b: 2)
        }
      `
        .expectData({
          add: 13,
        })
        .on(engine2);

      const finalObjects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(finalObjects?.length, 3); // Should remain the same
      s3.destroy();
    });

    await metaTest.should("remove typegraphs during sync when force_remove is true", async () => {
      // Store initial typegraph
      const engine1 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Verify initial state
      const s3 = new S3Client(syncConfig.s3);
      const initialObjects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(initialObjects?.length, 3);
      
      // Create new typegate instance with force_remove enabled
      const forceConfig = {
        ...syncConfig,
        force_remove: true,
      };
      
      const engine2 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts", {
        syncConfig: forceConfig,
      });
      
      // Verify typegraphs are removed during sync
      const intermediateObjects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(intermediateObjects?.length, 0);
      
      // Verify new typegraph is created and functional after sync
      await gql`
        query {
          add(a: 11, b: 2)
        }
      `
        .expectData({
          add: 13,
        })
        .on(engine2);
      
      const finalObjects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(finalObjects?.length, 3); // New typegraph should be created
      s3.destroy();
    });
  },
);

Key changes made:

  1. Added GraphQL queries to verify functionality after sync
  2. Updated test cases to reflect that sync creates engines from stored typegraphs
  3. Added intermediate state verification to ensure typegraphs are removed during sync when force_remove is true
  4. Added verification that new typegraphs are created and functional after sync

Let me know if you'd like any adjustments to the test cases!

🔗 Analysis chain
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Get the reference test file content
cat tests/runtimes/wasm_wire/wasm_sync_test.ts

# Look for any other sync-related test files that might be helpful
fd --type f "sync.*test" tests/

Length of output: 3331

Copy link
Contributor

coderabbitai bot commented Jan 9, 2025

Tip

For best results, initiate chat on the files or code changes.

@michael-0acf4 Here's the updated test file that correctly reflects the sync behavior:

// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

import { gql, Meta } from "test-utils/mod.ts";
import { connect } from "redis";
import { S3Client } from "aws-sdk/client-s3";
import { createBucket, listObjects, tryDeleteBucket } from "test-utils/s3.ts";
import { assertEquals } from "@std/assert";

const redisKey = "typegraph";
const redisEventKey = "typegraph_event";

async function cleanUp(config: typeof syncConfig) {
  using redis = await connect(config.redis);
  await redis.del(redisKey);
  await redis.del(redisEventKey);

  const s3 = new S3Client(config.s3);
  await tryDeleteBucket(s3, config.s3Bucket);
  await createBucket(s3, config.s3Bucket);
  s3.destroy();
  await redis.quit();
}

const syncConfig = {
  redis: {
    hostname: "localhost",
    port: 6379,
    password: "password",
    db: 4,
  },
  s3: {
    endpoint: "http://localhost:9000",
    region: "local",
    credentials: {
      accessKeyId: "minio",
      secretAccessKey: "password",
    },
    forcePathStyle: true,
  },
  s3Bucket: "metatype-force-cleanup-test",
  force_remove: false,
};

Meta.test(
  {
    name: "Force Cleanup: Sync Config",
    syncConfig,
    async setup() {
      await cleanUp(syncConfig);
    },
    async teardown() {
      await cleanUp(syncConfig);
    },
  },
  async (metaTest) => {
    await metaTest.should("preserve stored typegraphs during sync when force_remove is false", async () => {
      // Store initial typegraph
      const engine1 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Verify initial storage state
      const s3 = new S3Client(syncConfig.s3);
      const initialObjects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(initialObjects?.length, 3); // artifact + typegraphs
      
      // Create new typegate instance without force_remove
      const engine2 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Verify typegraphs are preserved and functional after sync
      await gql`
        query {
          add(a: 11, b: 2)
        }
      `
        .expectData({
          add: 13,
        })
        .on(engine2);

      const finalObjects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(finalObjects?.length, 3); // Should remain the same
      s3.destroy();
    });

    await metaTest.should("remove stored typegraphs during sync when force_remove is true", async () => {
      // Store initial typegraph
      const engine1 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts");
      
      // Verify initial storage state
      const s3 = new S3Client(syncConfig.s3);
      const initialObjects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(initialObjects?.length, 3);
      
      // Create new typegate instance with force_remove enabled
      const forceConfig = {
        ...syncConfig,
        force_remove: true,
      };
      
      const engine2 = await metaTest.engine("runtimes/wasm_wire/wasm_wire.ts", {
        syncConfig: forceConfig,
      });
      
      // Verify typegraphs are removed during sync
      const intermediateObjects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(intermediateObjects?.length, 0);
      
      // Verify new typegraph is created and functional after sync
      await gql`
        query {
          add(a: 11, b: 2)
        }
      `
        .expectData({
          add: 13,
        })
        .on(engine2);
      
      const finalObjects = await listObjects(s3, syncConfig.s3Bucket);
      assertEquals(finalObjects?.length, 3); // New typegraph should be created
      s3.destroy();
    });
  },
);

Key changes:

  1. Added verification of storage state at each stage (initial, during sync, and after sync)
  2. Added GraphQL queries to verify functionality after sync
  3. Added intermediate state verification to ensure typegraphs are removed during sync when force_remove is true
  4. Added verification that new typegraphs are created and functional after sync

Let me know if you'd like any adjustments to the test cases!

🔗 Analysis chain
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Get the reference test file content
cat tests/runtimes/wasm_wire/wasm_sync_test.ts

# Look for any other sync-related test files that might be helpful
fd --type f "sync.*test" tests/

Length of output: 3331


✏️ Learnings added
Learnt from: michael-0acf4
URL: https://github.com/metatypedev/metatype/pull/956

Timestamp: 2025-01-09T17:30:05.951Z
Learning: When testing sync functionality with force cleanup, engines are not produced from Redis and S3. Instead, typegraphs are stored first, and then sync creates engines from the stored typegraphs. The force cleanup feature drops all stored typegraphs before sync when enabled.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
tests/e2e/published/published_test.ts (1)

Line range hint 19-31: Add SYNC_FORCE_REMOVE to environment variables.

The syncEnvs object should include the new SYNC_FORCE_REMOVE environment variable to ensure consistent configuration across the test process.

Apply this diff:

 const syncEnvs = {
   SYNC_REDIS_URL: "redis://:password@localhost:6379/12",
   SYNC_S3_HOST: "http://localhost:9000",
   SYNC_S3_REGION: "local",
   SYNC_S3_ACCESS_KEY: "minio",
   SYNC_S3_SECRET_KEY: "password",
   SYNC_S3_BUCKET: "upgrade-test",
   SYNC_S3_PATH_STYLE: "true",
+  SYNC_FORCE_REMOVE: "false",
 };
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a9d12b2 and 72e1a5b.

📒 Files selected for processing (1)
  • tests/e2e/published/published_test.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: lint-compat (macos-14, aarch64-apple-darwin, false)
  • GitHub Check: test-full
  • GitHub Check: lint-compat (macos-13, x86_64-apple-darwin, false)
  • GitHub Check: bulid-docker (linux/amd64, custom-ubuntu-large)
  • GitHub Check: pre-commit
🔇 Additional comments (1)
tests/e2e/published/published_test.ts (1)

Line range hint 186-187: Add test cases for force cleanup functionality.

The test suite verifies upgrade paths and SDK compatibility but lacks explicit tests for the new force cleanup feature. Consider adding test cases that:

  1. Verify typegraphs are preserved when force_remove is false
  2. Verify typegraphs are cleaned up when force_remove is true
  3. Test the behavior during typegate restart

This aligns with the user's request for sync-related tests in the PR comments.

Here's a verification script to check if we have any existing force cleanup tests:

Also applies to: 234-235

✅ Verification successful

Add test cases for force cleanup functionality

The verification confirms that while force_remove configuration exists in the test suite, there are no explicit test cases verifying its behavior. The current tests only use force_remove: false without testing the cleanup functionality when enabled.

  • Add test variations in tests/e2e/published/published_test.ts to verify:
    • Directory preservation with force_remove: false
    • Directory cleanup with force_remove: true
    • Cleanup behavior during typegate restart
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for existing force cleanup tests
# Test: Search for test files and test cases related to force cleanup
rg -l 'force.*cleanup|force.*remove' tests/sync/

Length of output: 50


Script:

#!/bin/bash
# Search for force cleanup related tests across all test directories
rg -l "force.*(?:clean|remov|delet)" tests/
rg -C 3 "removeIfExists|cleanupDir|force" tests/e2e/published/published_test.ts

Length of output: 704

tests/e2e/published/published_test.ts Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (6)
tests/sync/sync_force_remove_test.ts (6)

20-30: Add error handling to cleanup operations.

The cleanup function should handle potential failures gracefully. Consider wrapping Redis and S3 operations in try-catch blocks.

 async function cleanUp(config: typeof syncConfig) {
-  using redis = await connect(config.redis);
-  await redis.del(redisKey);
-  await redis.del(redisEventKey);
+  try {
+    using redis = await connect(config.redis);
+    await redis.del(redisKey);
+    await redis.del(redisEventKey);
+    await redis.quit();
+  } catch (error) {
+    console.error('Failed to cleanup Redis:', error);
+  }

-  const s3 = new S3Client(config.s3);
-  await tryDeleteBucket(s3, config.s3Bucket);
-  await createBucket(s3, config.s3Bucket);
-  s3.destroy();
-  await redis.quit();
+  try {
+    const s3 = new S3Client(config.s3);
+    await tryDeleteBucket(s3, config.s3Bucket);
+    await createBucket(s3, config.s3Bucket);
+    s3.destroy();
+  } catch (error) {
+    console.error('Failed to cleanup S3:', error);
+  }
 }

32-49: Document test credentials and configuration.

Consider adding a comment explaining that these are test-only credentials and configuration. This helps prevent confusion and misuse in production environments.

+// Test-only configuration. These credentials are for local development and testing.
+// Do not use these values in production environments.
 const syncConfig = {
   redis: {
     hostname: "localhost",

51-62: Add JSDoc documentation and return type.

Consider adding JSDoc documentation and explicit return type for better code maintainability and type safety.

+/**
+ * Creates and initializes a new Typegate instance with the provided sync configuration.
+ * @param syncConfig - The synchronization configuration to use
+ * @returns A Promise that resolves to an initialized Typegate instance
+ */
-async function spawnGate(syncConfig: SyncConfig) {
+async function spawnGate(syncConfig: SyncConfig): Promise<Typegate> {

89-89: Document the expected object count.

The assertion expects exactly 3 objects in S3. Add a comment explaining what these objects represent for better test maintainability.

-        assertEquals(initialObjects?.length, 3);
+        // Expect 3 objects: typegraph definition, runtime configuration, and metadata
+        assertEquals(initialObjects?.length, 3);

110-110: Replace cryptic comment with descriptive one.

The "// !" comment is not descriptive. Replace it with a meaningful comment explaining the significance of empty names array.

-        assertEquals(namesAfterRemove, []); // !
+        // Verify that all typegraphs were removed after force cleanup
+        assertEquals(namesAfterRemove, []);

64-114: Add negative test cases.

Consider adding test cases for:

  1. Invalid sync configurations
  2. Network failures during cleanup
  3. Partial cleanup scenarios

This would improve the robustness of the test suite.

Would you like me to help generate these additional test cases?

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 72e1a5b and 481e9b8.

📒 Files selected for processing (3)
  • tests/sync/scripts/hello.ts (1 hunks)
  • tests/sync/sync.py (1 hunks)
  • tests/sync/sync_force_remove_test.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: lint-compat (macos-14, aarch64-apple-darwin, false)
  • GitHub Check: lint-compat (macos-13, x86_64-apple-darwin, false)
  • GitHub Check: test-full
  • GitHub Check: bulid-docker (linux/amd64, custom-ubuntu-large)
  • GitHub Check: pre-commit
🔇 Additional comments (6)
tests/sync/sync_force_remove_test.ts (1)

1-19: LGTM! Well-structured imports and constants.

The file has proper headers, necessary imports, and well-defined constants.

tests/sync/scripts/hello.ts (2)

1-2: LGTM! Proper license headers included.

The file includes the correct Mozilla Public License Version 2.0 headers.


4-6: LGTM! Clean and type-safe implementation.

The function implementation is concise and properly typed using TypeScript's object destructuring pattern.

tests/sync/sync.py (3)

1-2: LGTM! Proper license headers included.

The file includes the correct Mozilla Public License Version 2.0 headers.


4-6: LGTM! Required imports are present.

All necessary imports are included for the typegraph implementation.


8-21: Verify secret configuration and module path.

The implementation looks good, but there are two items that need verification:

  1. The secret "ULTRA_SECRET" is referenced but needs to be configured in the environment.
  2. The relative module path "scripts/hello.ts" needs to be verified.

Let's verify the module path resolution and find any related secret configurations:

✅ Verification successful

Module path and secret configuration are correctly set up

The verification shows that:

  • The module path "scripts/hello.ts" correctly resolves to an existing implementation
  • The ULTRA_SECRET is properly configured for test purposes, being injected during test execution
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the module path is correct relative to the test directory
fd hello.ts tests/

# Look for any environment variable configurations or secret definitions
rg -i "ULTRA_SECRET" --type yaml --type typescript --type python

Length of output: 200


Script:

#!/bin/bash
# Check the content of the hello.ts file
cat tests/sync/scripts/hello.ts

# Search for secret configuration without type restrictions
rg -i "ULTRA_SECRET"

# Look for environment/secret configurations in common locations
fd -e yaml -e yml -e env

Length of output: 1332


Script:

#!/bin/bash
# Check the test file that references the secret
cat tests/sync/sync_force_remove_test.ts

# Check content of test configuration files
cat tests/metatype.yml

Length of output: 4251

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 91.48936% with 4 lines in your changes missing coverage. Please review.

Project coverage is 77.97%. Comparing base (3d8dac2) to head (2aaefed).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/typegate/src/typegate/mod.ts 85.18% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #956      +/-   ##
==========================================
+ Coverage   77.72%   77.97%   +0.24%     
==========================================
  Files         154      154              
  Lines       19154    19057      -97     
  Branches     1930     1923       -7     
==========================================
- Hits        14888    14859      -29     
+ Misses       4243     4175      -68     
  Partials       23       23              

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

@michael-0acf4 michael-0acf4 merged commit 0f699ee into main Jan 11, 2025
12 of 13 checks passed
@michael-0acf4 michael-0acf4 deleted the met-799-clear-out-cached-typegraphs-on-boot branch January 11, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants