Conversation
…fully, reduce output pollution
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughThe changes relax the API integration Sequence Diagram(s)sequenceDiagram
participant CLI as CLI (command)
participant Fetch as Fetch Integrations
participant Validate as Validator
participant Merge as Merge Integrations
participant Output as Debug/Output
participant FS as File System
CLI->>Fetch: request integrations
Fetch->>Validate: parse & validate (metadata now z.unknown)
Validate-->>Fetch: integration objects
Fetch->>Merge: provide integrations list
Merge->>Validate: validate each integration
alt valid
Merge->>Merge: include in merged result
else invalid/unsupported
Merge->>Output: debug "skipping integration" + issues
Merge-->>Merge: skip integration
end
Merge->>FS: write merged integrations (YAML)
FS-->>CLI: write complete
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #313 +/- ##
==========================================
+ Coverage 82.63% 82.66% +0.03%
==========================================
Files 114 114
Lines 6939 6941 +2
Branches 1914 1853 -61
==========================================
+ Hits 5734 5738 +4
+ Misses 1205 1203 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/cli/src/integrations/fetch-integrations.ts`:
- Around line 66-68: The code unconditionally writes the API response to
"integrations-response.json" using fs.writeFileSync in fetch-integrations.ts,
which pollutes the cwd and blocks the event loop; either remove the import+write
line entirely or gate it behind a debug flag (e.g., if
(process.env.DEBUG_INTEGRATIONS) { await import('node:fs').then(fs =>
fs.promises.writeFile('integrations-response.json', JSON.stringify(json, null,
2))); }) and use the async fs.promises.writeFile API instead of writeFileSync to
avoid blocking; update/remove the reference to writeFileSync accordingly.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/cli/src/integrations/fetch-integrations.ts`:
- Line 13: The schema currently uses metadata: z.unknown(), which permits any
value; tighten this by replacing z.unknown() with a narrower union such as
z.union([z.record(z.unknown()), z.string()]) (or another union matching expected
shapes) to preserve type safety while supporting legacy cases; update the schema
entry named metadata and any dependent types/usages to handle the chosen union
(add guards or refinements where the code accesses metadata properties).
Historically, some old integrations have metadata as empty strings
""we don't need to validate that strictly when parsing the raw JSON response
Also updated logging
Some examples of debug output
without debug, no longer spams output with failed validations
Summary by CodeRabbit
Bug Fixes
Improvements
Tests