refactor: atomic sync of logseq-cli and desktop app#2
Conversation
1e3142f to
b0532d4
Compare
Drive both logseq and logseq-cli packages from data/logseq-nightly.json as the single source of truth for upstream commit, hashes, and versions. - Expand manifest schema with cliSrcHash, cliYarnDepsHash, cliVersion - Parameterize lib/cli.nix to accept manifest-driven values - Wire flake.nix callPackage to pass manifest attrs to cli.nix - Add validateHash helper in loadManifest.nix for SRI validation - Create scripts/update-nightly.sh for CI hash computation - Replace inline manifest rendering in nightly.yml with script call - Switch formatter from nixfmt to nixfmt-tree (fixes deprecation) - Update validate.yml and pre-commit to match new formatter interface
nix-prefetch-github requires nix-prefetch-git in PATH to compute source hashes. Add it as an explicit dependency in the nix shell call.
b0532d4 to
1af20ad
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
- loadManifest.nix: use foldl' for hash validation instead of chained calls - update-nightly.sh: tighten sed pattern to exact 44-char SRI hash - README: reflect atomic CLI/desktop sync and update CI pipelines section
|
@claude review |
|
Claude finished @Bad3r's task in 1m 35s —— View job Code ReviewTodo List
SummaryThis is a well-structured refactoring that successfully unifies the CLI and desktop builds under a single manifest. The implementation is clean, with good error handling and validation. I found a few minor issues and suggestions for improvement. Issues Found1. Error Output Visibility in scripts/update-nightly.shSeverity: Low The Suggestion: Consider adding more robust error extraction with multiple fallback patterns, or documenting the expected error format. 2. Missing Error Handling for curl in scripts/update-nightly.shSeverity: Low The Suggestion: Add explicit error handling: if ! CLI_VERSION=$(curl -fsSL "https://raw.githubusercontent.com/logseq/logseq/${LOGSEQ_REV}/deps/cli/package.json" | jq -r '.version'); then
echo "ERROR: Failed to fetch CLI version from upstream" >&2
exit 1
fi3. Git Diff Check InconsistencySeverity: Low The check changed from Suggestion: Consider 4. Hardcoded Placeholder HashSeverity: Low The placeholder hash Suggestion: Document why this specific placeholder is used, or use a constant at the top of the script. Positive Observations
Minor Suggestions
Security ConsiderationsNo security issues found. The script properly validates inputs and uses safe shell practices ( ConclusionThis is a high-quality refactoring that achieves its stated goals. The code is well-documented, follows Nix best practices, and includes proper error handling. The few issues identified are minor and don't block the PR. All tests pass and the implementation is production-ready. Recommendation: Approve with optional minor improvements. |
Summary
Test plan