- Nix 64.4%
- Shell 35.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Check / check (push) Successful in 1m55s
update.sh finds the newest upstream version and rewrites sources.json, taking each hash from what nix reports for a fake one, so it works for any fetcher and for Go and npm dependency hashes alike. The update workflow runs it daily, rewrites the README title, and pushes only if the package builds and passes its smoke test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
| .forgejo/workflows | ||
| .gitignore | ||
| alejandra.toml | ||
| flake.lock | ||
| flake.nix | ||
| package.nix | ||
| README.md | ||
| sources.json | ||
| update.sh | ||
open-code-review 1.12.12
A Nix flake packaging OpenCodeReview, Alibaba's AI-powered code review CLI. It reads git diffs, sends them to a configurable LLM provider and writes review comments.
On top of a plain buildGoModule it adds:
- The
ocrname.makebuilds the binary asopencodereview, but the upstream npm launcher and all of the docs call itocr. The package installsocrand keepsopencodereviewas a link to it. - Shell completions for bash, zsh and fish, generated at build time.
giton the wrapped binary'sPATH, since every review shells out to it.- Version info (
ocr version) stamped the same waymakedoes, from values hardcoded inpackage.nixso the build stays reproducible.
Built from source, so the npm launcher's update check
(~/.opencodereview/update-available) is not part of it; updates come through
this flake.
Usage
nix run git+https://git.cumsek.com/flakes/open-code-review -- --help
nix build .#open-code-review
{
inputs.open-code-review.url = "git+https://git.cumsek.com/flakes/open-code-review";
}
Then either take the package directly:
environment.systemPackages = [inputs.open-code-review.packages.${pkgs.system}.default];
or add the overlay and use pkgs.open-code-review:
nixpkgs.overlays = [inputs.open-code-review.overlays.default];
Outputs: packages.<system>.{open-code-review,default},
apps.<system>.{ocr,default}, overlays.default, formatter, checks.
Updating
.forgejo/workflows/update.yml runs every night and on demand. It updates
flake.lock, then runs update.sh to point sources.json at the newest
upstream release (version, hash, vendorHash, and the commit and date
of the release tag), and puts the new version in this README's title. If
nix flake check passes it pushes to main, one commit for the lock and one
for the package.
By hand, the same thing is:
nix flake update
nix shell --inputs-from . nixpkgs#curl nixpkgs#jq -c ./update.sh
nix flake check -L
commit is the short hash the tag points at and date that commit's date in
UTC; make would read both from git, so they are recorded to keep the build
reproducible. The hashes are the ones nix reports when update.sh builds
open-code-review.src and open-code-review.goModules with a fake hash.
Releases are listed at https://github.com/alibaba/open-code-review/releases.
Checks
nix flake check -L
Builds the package (running upstream's cmd/opencodereview tests), checks
that ocr version reports the packaged version, and runs alejandra,
deadnix, statix and shellcheck. CI runs the same command and nothing else.
Licence
The packaging is trivial; OpenCodeReview itself is under the Apache License
2.0, as recorded in meta.license.