Conversation
|
/crush_fast AI review started. |
There was a problem hiding this comment.
Pull request overview
This PR switches backend version reporting to read from chelonia.json instead of environment variables, and updates the pinning workflow to surface/store per-contract version metadata.
Changes:
- Load
chelonia.jsonat server startup and send VERSION_INFO withappVersionand per-contract versions. - Update
pincommand output and config lookup to use a “full” (unsanitized) contract name.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/serve/server.ts | Imports chelonia.json and changes the VERSION_INFO payload to report app + per-contract versions. |
| src/pin.ts | Adjusts manifest parsing/printing to include fullContractName and uses it when reading/writing chelonia.json contract entries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return await import(join(process.cwd(), 'chelonia.json'), { | ||
| with: { type: 'json' } | ||
| }) |
There was a problem hiding this comment.
Using join(process.cwd(), 'chelonia.json') as an import() specifier is not portable (e.g., backslashes on Windows) and can fail because import() expects a valid module specifier/URL. Consider converting the filesystem path to a file:// URL (e.g., via pathToFileURL) before importing.
Advanced AI Review
Click to expand reviewNow let me also check one more thing about the Looking at line 77: Let me verify this:Now I have all the context I need. Here is my review: Issue 1: 🔴
|
|
/crush_fast AI review started. |
Advanced AI Review
Click to expand reviewNow let me check additional context around the manifest version regex issue and how version info is consumed.Now I have the full context. Let me verify one more thing about the worker cleanup:Now I have all the context needed for a thorough review. Code Review: Report Version from Manifest1. 🔴
|
|
/crush_fast AI review started. |
Advanced AI Review
Click to expand reviewCode Review: Report version from manifest1. 🔴 Breaking wire protocol change in
|
taoeffect
left a comment
There was a problem hiding this comment.
Looks solid, I think! Just have a documentation request:
Where is chelonia.json documented?
Need to know:
- What it is
- What it's for
- What it can contain
- How it's different from the .toml config
Could you add this to the README.md maybe?
|
/crush_fast AI review started. |
Advanced AI Review
Click to expand reviewLet me check a few more things for completeness.Now I have enough context to provide a thorough review. Code Review: Report version from manifestIssue 1: 🔴 Path traversal via
|
taoeffect
left a comment
There was a problem hiding this comment.
Oh, actually, I missed one thing:
| appVersion: cheloniaAppManifest?.appVersion || null, | ||
| contractsVersion: cheloniaAppManifest?.contracts ? Object.fromEntries( | ||
| Object.entries(cheloniaAppManifest?.contracts) | ||
| .map(([k, v]) => [k, (v as { version: string }).version]) | ||
| ) : null |
There was a problem hiding this comment.
Question: does this design assume there will only be one app per server?
If so, that's clearly not a safe assumption (per the other open issues).
So I think we should address this somehow in this PR in a way that either fully addresses it, or sets up future versions to address it properly.
I.e.:
- It could fully address this by returning all apps
- It could partially address this by passing in some server API version perhaps that clients could distinguish for figuring out what format to expect?
There was a problem hiding this comment.
At the moment there can only possibly be one app per server. Since this is being sent when a WS connection is established, I think this is fine (since presumably, a WS client will be for a single app).
I think it's low risk to make this assumption since, whichever changes are needed, they are limited to the server API and will not require changing contracts.
In addition, presumably, we'll want https://groupincome.app (as an example) to be a single app, regardless of how many apps the backend is running. I.e., the origin will identify the app.
With this in mind, these changes look safe and perhaps even future proof:
- We might need to refactor
chelto serve multiple apps, but those changes don't seem related to the ones here (it'd mean, in this case, that we'd have to pick whichcheloniaAppManifestwe want --- now, there's a single choice) - In the future, since we need to pick a way of choosing the
cheloniaAppManifest(see previous point), we need a way to do it. If we do it based on origin, this already is future proof. If we do it some other way, we can change the WS protocol to add an app id selector (which would not require recreating contracts)
There was a problem hiding this comment.
Question: does this design assume there will only be one app per server?
Currently, yes. But, I think little if anything will change from the client's perspective.
These changes read version information from
chelonia.jsoninstead of from environment variables and also present per-contract versions (as opposed to a single, global,CONTRACTS_VERSION)