Skip to content

fix db seed - #58

Merged
Marfuen merged 1 commit into
mainfrom
mariano/stuff
Feb 17, 2025
Merged

Marfuen merged 1 commit into
mainfrom
mariano/stuff

Conversation

@Marfuen

@Marfuen Marfuen commented Feb 17, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes

    • Improved error handling during policy file processing to ensure that issues with individual files don’t interrupt overall operations.
  • New Features

    • Enhanced the policy data structure to support more detailed and flexible content representation.

@vercel

vercel Bot commented Feb 17, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app 🔄 Building (Inspect) Visit Preview 💬 Add feedback Feb 17, 2025 10:16pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
web ⬜️ Skipped (Inspect) Feb 17, 2025 10:16pm

@coderabbitai

coderabbitai Bot commented Feb 17, 2025 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request enhances the seeding process by adding error handling during the processing of policy files and refines the data structure of the Policy interface. In the seeding script, a try-catch block is introduced to manage errors in file reading and JSON parsing, ensuring that one faulty file does not halt the entire process. In parallel, the Policy interface is updated by adding a new top-level type property, removing the type property from the metadata, and restructuring the content field from a simple JSON array to an array of objects with defined schema.

Changes

File(s) Change Summary
packages/db/prisma/seed.ts Added a try-catch block to handle errors during file reading/parsing. Moved the declaration of policyData inside the try block to limit its scope.
packages/db/prisma/seedTypes.ts Updated the Policy interface by adding a new top-level type property. Removed the type property from the metadata object and restructured content from a JsonArray to an array of objects with a defined structure.

Sequence Diagram(s)

sequenceDiagram
    participant SeedFunction as Seed Function
    participant FileSystem as File System
    participant Logger as Logger
    participant Database as Database

    SeedFunction->>FileSystem: Read & parse policy file
    alt Parsing is successful
        SeedFunction->>Database: Upsert policy data
    else Error occurs
        SeedFunction->>Logger: Log error with file details
    end
Loading

Poem

I'm a bunny hopping through the code,
Dancing with lines where errors erode.
With try-catch leaps, I keep the pace,
Nibbling bugs with a graceful grace.
Data gardens bloom as I happily roam,
CodeRabbit cheers—this seed finds its home!
🐇💻


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5bf12d0 and 433f18d.

📒 Files selected for processing (2)
  • packages/db/prisma/seed.ts (1 hunks)
  • packages/db/prisma/seedTypes.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 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.

@Marfuen
Marfuen merged commit d3b1721 into main Feb 17, 2025
Marfuen added a commit that referenced this pull request Jul 15, 2026
… (#3412)

apps/mcp-server is a standalone npm project (excluded from the bun
workspaces). Three open Dependabot alerts, all dev-scope transitives:
- #59 (high) + #58 (low): tmp path traversal / symlink write — tmp@0.0.33
  via external-editor; patched in tmp>=0.2.6
- #71 (moderate): js-yaml quadratic-complexity DoS — js-yaml@4.1.1 via
  @eslint/eslintrc; patched in js-yaml>=4.2.0

Add npm overrides (caret-pinned to stay within the safe major):
- tmp ^0.2.6  -> resolves 0.2.7 (fileSync API is stable, external-editor works)
- js-yaml ^4.2.0 -> resolves 4.3.0 (satisfies eslintrc's ^4.1.1; NOT floated to
  v5, which would be an unvetted breaking major)

Verified: npm audit 0 vulnerabilities; mcp-server build + lint pass.
(bun.lock is gitignored and regenerated from package-lock.json at build.)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
claudfuen pushed a commit that referenced this pull request Jul 15, 2026
# [3.102.0](v3.101.2...v3.102.0) (2026-07-15)

### Bug Fixes

* **ci:** pin Syft 1.46.0 in SBOM action (1.42.3 can't parse bun.lock) ([#3415](#3415)) ([5f47024](5f47024))
* **ci:** scan bun.lock via file: input so the SBOM isn't empty ([#3414](#3414)) ([e47e6fd](e47e6fd))
* **deps:** override uuid to ^11.1.1 (Dependabot [#85](#85)) ([#3418](#3418)) ([598ff8c](598ff8c))
* **deps:** patch tmp and js-yaml in mcp-server (Dependabot [#58](https://github.com/trycompai/comp/issues/58)/[#59](https://github.com/trycompai/comp/issues/59)/[#71](https://github.com/trycompai/comp/issues/71)) ([#3412](#3412)) ([59a6b0f](59a6b0f))
* **deps:** remediate dependency security vulnerabilities ([#3403](#3403)) ([7577a37](7577a37))
* **deps:** remediate dependency security vulnerabilities (165→16, 4 critical→0) ([#3406](#3406)) ([d403e9c](d403e9c))
* **device-agent:** implement the installer-cleanup fix ([#3381](#3381)) ([0f7581b](0f7581b))
* **security:** prevent SSRF in task-automation enterprise API calls ([#3411](#3411)) ([dcec288](dcec288)), closes [#116](#116)
* **security:** resolve open CodeQL alerts (XSS, sanitization, workflow perms) ([#3419](#3419)) ([32329be](32329be)), closes [#108](#108) [js/xss-throu#dom](https://github.com/js/xss-throu/issues/dom) [#95](#95) [84/#85](#85)

### Features

* **framework-editor:** raise requirement description limit to 100,000 chars (FRAME-2) ([67c9f4a](67c9f4a))

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – app — 433f18de Deployed Feb 17, 2025 by vercel[bot]
Preview – web — 433f18de Deployed Feb 17, 2025 by vercel[bot]
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.

1 participant