fix: resolve registry intel cold start and ids dependency - #724
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR fixes two related bugs: it reorders initialization in ChangesRegistry Syncer Bootstrap & Dependency Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📊 Coverage ReportCoverage report not available
Generated by PR Automation (Story 6.1) |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
tests/unit/validate-aiox-core-deps.test.js (1)
25-59: ⚡ Quick winConsider refactoring repeated package.json reads.
The test suite reads and parses
.aiox-core/package.jsonsix times—once per test. Consider extracting this into a shared helper orbeforeAll()hook to improve efficiency and reduce duplication.♻️ Optional refactoring approach
+let aioxCorePackage; + +beforeAll(() => { + const pkgPath = path.join(PROJECT_ROOT, '.aiox-core', 'package.json'); + aioxCorePackage = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); +}); + test('.aiox-core/package.json includes fast-glob', () => { - const pkgPath = path.join(PROJECT_ROOT, '.aiox-core', 'package.json'); - const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); - expect(pkg.dependencies).toHaveProperty('fast-glob'); + expect(aioxCorePackage.dependencies).toHaveProperty('fast-glob'); }); test('.aiox-core/package.json includes fs-extra', () => { - const pkgPath = path.join(PROJECT_ROOT, '.aiox-core', 'package.json'); - const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); - expect(pkg.dependencies).toHaveProperty('fs-extra'); + expect(aioxCorePackage.dependencies).toHaveProperty('fs-extra'); }); // ... apply same pattern to remaining tests🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unit/validate-aiox-core-deps.test.js` around lines 25 - 59, The tests repeatedly read and parse the same .aiox-core package.json in each test; extract the shared setup by adding a beforeAll() that computes pkgPath and loads JSON into a shared variable (e.g., const pkg) and then update each test ('.aiox-core/package.json includes fast-glob', 'fs-extra', 'semver', 'ajv', 'tar', and 'proper-lockfile') to assert against that shared pkg instead of re-reading the file; use the existing PROJECT_ROOT and pkgPath identifiers in the setup so tests simply call expect(pkg.dependencies).toHaveProperty(...) without duplicated fs.readFileSync/JSON.parse logic.tests/code-intel/registry-syncer.test.js (1)
6-6: ⚡ Quick winUse an absolute import for the new
codeInteltest dependency.This newly added relative import conflicts with the repo import rule; please switch it to the project’s absolute import form used by your Jest resolver setup.
As per coding guidelines, "**/*.{js,jsx,ts,tsx}: Use absolute imports instead of relative imports in all code".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/code-intel/registry-syncer.test.js` at line 6, The test currently requires the module via a relative path ("../../.aiox-core/core/code-intel") which violates the repo rule; update the require for const codeIntel to use the project's absolute import form used by the Jest resolver (e.g., require('aiox-core/core/code-intel') or the exact absolute name used elsewhere in the repo) so the import follows the absolute-import convention.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/code-intel/registry-syncer.test.js`:
- Line 6: The test currently requires the module via a relative path
("../../.aiox-core/core/code-intel") which violates the repo rule; update the
require for const codeIntel to use the project's absolute import form used by
the Jest resolver (e.g., require('aiox-core/core/code-intel') or the exact
absolute name used elsewhere in the repo) so the import follows the
absolute-import convention.
In `@tests/unit/validate-aiox-core-deps.test.js`:
- Around line 25-59: The tests repeatedly read and parse the same .aiox-core
package.json in each test; extract the shared setup by adding a beforeAll() that
computes pkgPath and loads JSON into a shared variable (e.g., const pkg) and
then update each test ('.aiox-core/package.json includes fast-glob', 'fs-extra',
'semver', 'ajv', 'tar', and 'proper-lockfile') to assert against that shared pkg
instead of re-reading the file; use the existing PROJECT_ROOT and pkgPath
identifiers in the setup so tests simply call
expect(pkg.dependencies).toHaveProperty(...) without duplicated
fs.readFileSync/JSON.parse logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2e3cd285-8356-4cf0-a77b-b405c25ba2b1
📒 Files selected for processing (6)
.aiox-core/core/code-intel/registry-syncer.js.aiox-core/data/entity-registry.yaml.aiox-core/install-manifest.yaml.aiox-core/package.jsontests/code-intel/registry-syncer.test.jstests/unit/validate-aiox-core-deps.test.js
|
🎉 This PR is included in version 5.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
RegistrySyncer.sync()checks provider availabilityproper-lockfilein the nested.aiox-core/package.jsonused by IDS runtime consumersCloses #721
Closes #722
Validation
npm test -- --runInBand tests/code-intel/registry-syncer.test.js tests/unit/validate-aiox-core-deps.test.jsnode scripts/validate-aiox-core-deps.js{"processed":757,"skipped":0,"errors":0,"total":757}./node_modules/.bin/eslint .aiox-core/core/code-intel/registry-syncer.js tests/code-intel/registry-syncer.test.js tests/unit/validate-aiox-core-deps.test.jsnpm run validate:manifestnpm run validate:publishnpm run test:ci -- --silent(342 passed suites, 8457 passed tests, 11 skipped suites / 151 skipped tests)Summary by CodeRabbit
Chores
Tests