-
Notifications
You must be signed in to change notification settings - Fork 6
fix(build): native incremental rebuild perpetual full-rebuild loop #928
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -490,17 +490,18 @@ describe('version/engine mismatch auto-promotes to full rebuild', () => { | |||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||
| db2.close(); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // codegraph_version must match the npm package version | ||||||||||||||||||||||||||
| const pkg = JSON.parse( | ||||||||||||||||||||||||||
| fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'), 'utf8'), | ||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||
| expect(meta.codegraph_version).toBe(pkg.version); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // engine must be either 'native' or 'wasm' (not empty, not stale) | ||||||||||||||||||||||||||
| expect(['native', 'wasm']).toContain(meta.engine); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // engine_version must equal the npm package version (#751: was using Rust crate version) | ||||||||||||||||||||||||||
| expect(meta.engine_version).toBe(pkg.version); | ||||||||||||||||||||||||||
| // engine_version must be a valid semver string. For native engine, this is | ||||||||||||||||||||||||||
| // the addon version (CARGO_PKG_VERSION); for WASM, the npm package version. | ||||||||||||||||||||||||||
| // They may differ when the addon hasn't been republished yet (#928). | ||||||||||||||||||||||||||
| expect(meta.engine_version).toMatch(/^\d+\.\d+\.\d+/); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // codegraph_version tracks the npm package version when the JS pipeline | ||||||||||||||||||||||||||
| // finalizes, or the addon version when the Rust orchestrator runs. | ||||||||||||||||||||||||||
| // Either is valid — the key invariant is it's a valid semver string. | ||||||||||||||||||||||||||
| expect(meta.codegraph_version).toMatch(/^\d+\.\d+\.\d+/); | ||||||||||||||||||||||||||
|
Comment on lines
+499
to
+504
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Both regexes match any string that starts with a semver prefix — e.g.
Suggested change
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // built_at must be a valid ISO timestamp from the current build | ||||||||||||||||||||||||||
| expect(new Date(meta.built_at).getTime()).toBeGreaterThan(0); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkEngineSchemaMismatchskips thecodegraph_versioncheck wheneverctx.nativeAvailableistrue, even though the native orchestrator may subsequently fail and fall through to the JS pipeline. In that narrow scenario — native available, version bumped, orchestrator throws — the JS pipeline runs in whatever mode was already determined (potentially incremental) without the version-change promotion to full rebuild that the old code provided.The comment says "the Rust orchestrator handles its own version check", which is true when the orchestrator succeeds. Given the
warn + fall-througherror handling inbuildGraph, the JS pipeline does proceed without the version gate if the orchestrator throws after this check runs.