Repository navigation
chore: test improvements - #17
Conversation
|
👋 This PR targeted
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (23)
📒 Files selected for processing (50)
📝 WalkthroughWalkthroughThe change adds reusable Nix setup and cache-push actions, installs manager push-reference validation, updates build and Git tooling, advances executor references, and reorganizes contributor documentation with fuzzing guidance. ChangesNix CI cache integration
Developer workflow and tooling
Contributor documentation and fuzzing
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ 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 |
|
/run-e2e |
GenVM PR actionsTick a box to run it (the box unticks itself when handled). Actions only run while the PR has the
Full GenVM CI runs only when A repo admin can comment |
Linked executor PR(s)executor: genlayerlabs/genvm-executor#12 |
There was a problem hiding this comment.
Actionable comments posted: 13
🧹 Nitpick comments (1)
.github/actions/genlayerlabs-nix-setup/action.yaml (1)
60-71: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winUse a random heredoc delimiter for the
GITHUB_OUTPUTmultiline write.The heredoc uses the fixed literal
EOF_NIX_CONFIGas its delimiter. Ifextra_nix_config(or, in principle,extra_substituters/extra_trusted_public_keysafter collapsing) ever contains a line equal toEOF_NIX_CONFIG, the heredoc terminates early and corrupts thenix_configoutput thatcachix/install-nix-actionconsumes downstream. Use a randomly generated delimiter for each run to eliminate this class of collision.♻️ Proposed fix using a random delimiter
+ delimiter="EOF_NIX_CONFIG_$(openssl rand -hex 8)" { - echo 'nix_config<<EOF_NIX_CONFIG' + echo "nix_config<<${delimiter}" echo "experimental-features = nix-command flakes recursive-nix" echo "substituters = $substituters" echo "trusted-public-keys = $keys" echo "download-attempts = 10" echo "connect-timeout = 15" echo "stalled-download-timeout = 60" echo "fallback = true" if [ -n "$EXTRA_CONFIG" ]; then printf '%s\n' "$EXTRA_CONFIG"; fi - echo 'EOF_NIX_CONFIG' + echo "${delimiter}" } >> "$GITHUB_OUTPUT"🤖 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 @.github/actions/genlayerlabs-nix-setup/action.yaml around lines 60 - 71, Update the multiline GITHUB_OUTPUT write in the nix configuration generation block to use a newly generated random heredoc delimiter for each run instead of the fixed EOF_NIX_CONFIG token. Use that same delimiter for both the opening marker and closing marker while preserving the existing nix configuration contents and EXTRA_CONFIG handling.
🤖 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.
Inline comments:
In @.claude/skills/agentic-fuzzing/SKILL.md:
- Around line 92-95: Clarify the safe-mode runner rule in the guidance paragraph
by replacing the incomplete wording with language stating that safe refuses both
wall-clock exposure and the :test alias. Preserve the surrounding runner-by-hash
resolution instructions unchanged.
In @.github/actions/genlayerlabs-nix-cache-push/action.yaml:
- Around line 34-77: Make the entire cache-upload path fail-soft, not just the
final xargs attic push. In the shell block, ensure failures from nix build and
attic login are caught and emit the same warning without causing the action to
exit nonzero; preserve the existing early exit when no paths are built and the
current push warning behavior. Anchor the changes around the nix build command
and the attic login invocation.
In `@docs/contributing/howto/building/docs.md`:
- Around line 39-42: Update the documentation deployment description to
reference _site/versions.json instead of a repository-root versions.json in both
occurrences, including the version-switcher location and the file contributors
should inspect after deploy-docs.
In `@docs/contributing/howto/docs/style.md`:
- Around line 31-34: Update the name-formatting rule near the examples to fix
subject-verb agreement by changing “Write names as it is native to the referee”
to plural-consistent wording, preferably “Write names in their native form.”
In `@docs/contributing/howto/extending/write-a-script.md`:
- Around line 3-6: Update the language names in the contributor guide’s
scripting recommendations to use “Python” and “Bash” with capitalization, while
leaving the surrounding guidance and code formatting unchanged.
In `@docs/contributing/howto/pr.md`:
- Around line 24-27: Update the ci-safe paragraph near the `support/ci/`
explanation by replacing the comma splice after “scope” with a period, making
“Authors with write access get it automatically” and “Everyone else needs a
maintainer to add it after reading the diff” separate sentences.
In `@docs/contributing/howto/testing/fuzzing.md`:
- Around line 16-19: Update the Host Preparation section in the fuzzing guide to
warn that changing kernel.yama.ptrace_scope weakens a system-wide security
control. Recommend performing this only on an isolated runner, and document how
to capture the existing value and restore it after fuzzing.
In `@docs/contributing/howto/testing/python.md`:
- Around line 12-14: Update the Nix flake reference in the testing command after
the genlayer-py-std directory change to use four parent traversals, resolving
the repository-level support/nix/py-test path correctly. Keep the existing
environment setup and pytest invocation unchanged.
In `@docs/contributing/README.md`:
- Around line 19-20: Update the GenVM security guidance sentence so the two
independent commands are separated with a period: end the instruction not to
open a public vulnerability issue after “vulnerability,” then begin “Follow
[SECURITY.md](../../SECURITY.md) instead” as a new sentence.
In `@docs/README.md`:
- Around line 11-12: Update the navigation note in docs/README.md to say that
docs-layout.md explains which documentation page a new page belongs in and why,
replacing the ambiguous reference to “line” with “page.”
In `@executors/v0.3.x`:
- Line 1: Update the executors/v0.3.x submodule pointer from the unavailable
commit to a valid commit on genvm-executor’s v0.3.x branch, then verify the
manager checkout initializes and resolves the submodule successfully before
merging.
In `@flake.nix`:
- Around line 225-239: In the install-manager-push-refs hook, update the failure
branch that reports an existing $user_legacy in install-manager-push-refs to
exit explicitly with status 1 instead of invoking false, preventing execution
from reaching the subsequent ln -sfn command.
In `@support/scripts/get-all-git.py`:
- Around line 149-152: Serialize concurrent get-all-git.py executions, or
introduce a lock keyed to each cache path. Hold the lock across ensure_cache()
check/initialize, remote updates, fetches, and update_submodules_with_cache()
operations using the shared cached reference, and release it reliably after
completion or failure.
---
Nitpick comments:
In @.github/actions/genlayerlabs-nix-setup/action.yaml:
- Around line 60-71: Update the multiline GITHUB_OUTPUT write in the nix
configuration generation block to use a newly generated random heredoc delimiter
for each run instead of the fixed EOF_NIX_CONFIG token. Use that same delimiter
for both the opening marker and closing marker while preserving the existing nix
configuration contents and EXTRA_CONFIG handling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 825d195a-0ccf-4a33-bbaf-244d4e7a6d66
⛔ Files ignored due to path filters (22)
support/tools/genvm-tool/default.nixis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/__main__.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/cmd_configure.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/cmd_docs.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/cmd_howto.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/codegen/model.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/codegen/rst.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/common.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/git/__init__.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/git/check_for_push.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/git/create_branches.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/git/verify_pushed_executors.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/tests/__init__.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/tests/util/watchdog.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/genvm_tool/tests/util/watchdog_main.pyis excluded by!support/tools/genvm-tool/**support/tools/genvm-tool/unit_tests/test_verify_pushed_executors.pyis excluded by!support/tools/genvm-tool/**tests/runner/genvm_tool_plugins/genvm.pyis excluded by!tests/**tests/runner/genvm_tool_plugins/integration.pyis excluded by!tests/**tests/runner/genvm_tool_plugins/ninja.pyis excluded by!tests/**tests/runner/origin/log_asserts.pyis excluded by!tests/**tests/runner/origin/logger.pyis excluded by!tests/**tests/templates/util.jsonnetis excluded by!tests/**
📒 Files selected for processing (50)
.claude/settings.fuzzing.json.claude/skills/agentic-fuzzing/SKILL.md.genvm-tool.py.github/actions/genlayerlabs-nix-cache-push/action.yaml.github/actions/genlayerlabs-nix-setup/action.yaml.github/actions/get-src/action.yaml.github/workflows/incl_initial.yaml.github/workflows/incl_release_build_test_cell_build.yaml.github/workflows/incl_release_build_test_cell_test.yaml.github/workflows/queue_test_cell.yamlCLAUDE.mddocs/README.mddocs/contributing/README.mddocs/contributing/explanation/README.mddocs/contributing/explanation/docs-layout.mddocs/contributing/explanation/executor-lines.mddocs/contributing/explanation/merge-model.mddocs/contributing/explanation/vendored-trees.mddocs/contributing/howto/README.mddocs/contributing/howto/building/build.mddocs/contributing/howto/building/docs.mddocs/contributing/howto/building/runners.mddocs/contributing/howto/committing/git-third-party.mddocs/contributing/howto/committing/runners.mddocs/contributing/howto/committing/submodules.mddocs/contributing/howto/docs/style.mddocs/contributing/howto/extending/add-host-function.mddocs/contributing/howto/extending/add-llm-provider.mddocs/contributing/howto/extending/add-wasi-function.mddocs/contributing/howto/extending/modify-runner.mddocs/contributing/howto/extending/modify-wasmtime.mddocs/contributing/howto/extending/write-a-script.mddocs/contributing/howto/genvm-tool.mddocs/contributing/howto/pr.mddocs/contributing/howto/releasing/release-build.mddocs/contributing/howto/releasing/versioning.mddocs/contributing/howto/setup.mddocs/contributing/howto/testing/README.mddocs/contributing/howto/testing/fuzzing.mddocs/contributing/howto/testing/integration.mddocs/contributing/howto/testing/python.mddocs/contributing/howto/testing/rust.mddocs/contributing/howto/write-a-script.mddocs/contributing/tutorial/README.mddocs/contributing/tutorial/first-contribution.mdexecutors/v0.2.xexecutors/v0.3.xflake.nixsupport/scripts/check-source-text.pysupport/scripts/get-all-git.py
💤 Files with no reviewable changes (2)
- docs/contributing/howto/write-a-script.md
- .claude/settings.fuzzing.json
| Which of these a new page belongs in, and why the line falls where it does: | ||
| [docs-layout.md](contributing/explanation/docs-layout.md) |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use “page” instead of “line” in the navigation note.
line does not identify a documentation category. State that docs-layout.md explains where a new page belongs and why.
🤖 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 `@docs/README.md` around lines 11 - 12, Update the navigation note in
docs/README.md to say that docs-layout.md explains which documentation page a
new page belongs in and why, replacing the ambiguous reference to “line” with
“page.”
| install-manager-push-refs = '' | ||
| hooks_dir="$(git rev-parse --git-path hooks)" | ||
| legacy="$hooks_dir/pre-push.legacy" | ||
| user_legacy="$hooks_dir/pre-push.user-legacy" | ||
| installed="$(${pkgs.coreutils}/bin/readlink "$legacy" 2>/dev/null || true)" | ||
| if [[ -e "$legacy" && "$installed" != *-verify-manager-push-refs && "$installed" != *-verify-single-manager-push-ref ]]; then | ||
| if [[ ! -e "$user_legacy" ]]; then | ||
| mv "$legacy" "$user_legacy" | ||
| else | ||
| echo "cannot preserve existing $legacy: $user_legacy already exists" >&2 | ||
| false | ||
| fi | ||
| fi | ||
| ln -sfn ${verify-manager-push-refs} "$legacy" | ||
| ''; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
Does nix mkShell shellHook run with bash's set -e enabled by default?
💡 Result:
No, nix mkShell's shellHook does not run with bash's set enabled by default [1][2][3]. The shellHook is a string of bash commands that are executed by nix-shell when the environment is initialized [1][4][3]. These commands are evaluated within the context of the shell, but they do not automatically inherit or enable bash flags such as -e (errexit) or -u (nounset) unless you explicitly include them in the shellHook string itself [1][3]. Because shellHook is treated as a script fragment to be sourced or executed upon entering the shell, it behaves like standard bash code [5][3]. If you require specific bash behavior, you can manually set it at the beginning of your shellHook, for example: shellHook = '' set -euo pipefail # your commands here ''; This allows you to control the environment settings explicitly rather than relying on default shell behavior [3][6].
Citations:
- 1: https://ryantm.github.io/nixpkgs/builders/special/mkshell/
- 2: https://nix.dev/tutorials/first-steps/declarative-shell.html
- 3: https://nix.dev/manual/nix/2.18/command-ref/nix-shell
- 4: https://discourse.nixos.org/t/run-some-bash-script-when-flake-is-initialized/70833/1
- 5: https://discourse.nixos.org/t/how-can-i-make-a-shell-nix-that-runs-some-code-only-using-inbuilt-derivation-function/36834
- 6: https://discourse.nixos.org/t/why-use-exec-when-creating-a-custom-script-in-the-nix-store-and-how-does-shellhook-work-exactly/30213
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== locate docs/config files =="
git ls-files | rg '(^|/)flake\.nix$|(^|/)docs/contributing/|(^|/)README|pkgs|mkShell|install-manager-push-refs|verify-manager-push-refs|shellHook' | head -200
echo
echo "== flake references =="
if [ -f flake.nix ]; then
wc -l flake.nix
sed -n '200,255p' flake.nix | nl -ba -v200
echo
sed -n '730,770p' flake.nix | nl -ba -v730
rg -n "set -euo pipefail|shellHook|install-manager-push-refs|install-manager-push" flake.nix
fi
echo
echo "== docs presence =="
if [ -d docs/contributing ]; then
find docs/contributing -maxdepth 2 -type f -print | sort
rg -n "how-to|design|implement|flake|shellHook|mkShell|contributing" docs/contributing -i || true
elif [ -d docs ]; then
find docs -maxdepth 3 -type f -print | sort | head -100
fiRepository: genlayerlabs/genvm-manager
Length of output: 1828
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== relevant flake.nix blocks =="
sed -n '218,242p' flake.nix
echo
sed -n '745,756p' flake.nix
echo
echo "== shellHook/flow flags and install-manager-push-refs occurrences in flake.nix =="
grep -nE 'flake\.nix:\s*shellHook\s*=|set -euo pipefail|install-manager-push-refs|verify-manager-push-refs|mkShell' flake.nix || true
echo
echo "== bash errexit behavior for the exact control flow =="
bash -c '
hooks_dir=/tmp/cr-shellhook-test-hooks-$$
rm -rf "$hooks_dir"
mkdir -p "$hooks_dir"
legacy="$hooks_dir/pre-push.legacy"
user_legacy="$hooks_dir/pre-push.user-legacy"
target="$hooks_dir/target"
touch "$user_legacy" "$target"
installed="$(readlink "$legacy" 2>/dev/null || true)"
if [[ -e "$legacy" && "$installed" != *-verify-manager-push-refs && "$installed" != *-verify-single-manager-push-ref ]]; then
if [[ ! -e "$user_legacy" ]]; then
mv "$legacy" "$user_legacy"
else
echo "cannot preserve existing $legacy: $user_legacy already exists" >&2
false
fi
fi
ln -sfn "$target" "$legacy"
echo "legacy points to: $(readlink "$legacy")"
'
rm -rf "$hooks_dir" 2>/dev/null || trueRepository: genlayerlabs/genvm-manager
Length of output: 3191
Exit explicitly after failing to preserve the user hook.
If it cannot move the existing $legacy to $user_legacy, only printing a warning lets execution fall through to ln -sfn ${verify-manager-push-refs} "$legacy" and overwrite the managed hook, which conflicts with the preservation attempt. Use exit 1 instead of false so this cannot silently be ignored by the surrounding hook.
🛡️ Proposed fix
if [[ ! -e "$user_legacy" ]]; then
mv "$legacy" "$user_legacy"
else
echo "cannot preserve existing $legacy: $user_legacy already exists" >&2
- false
+ exit 1
fi
fi
ln -sfn ${verify-manager-push-refs} "$legacy"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| install-manager-push-refs = '' | |
| hooks_dir="$(git rev-parse --git-path hooks)" | |
| legacy="$hooks_dir/pre-push.legacy" | |
| user_legacy="$hooks_dir/pre-push.user-legacy" | |
| installed="$(${pkgs.coreutils}/bin/readlink "$legacy" 2>/dev/null || true)" | |
| if [[ -e "$legacy" && "$installed" != *-verify-manager-push-refs && "$installed" != *-verify-single-manager-push-ref ]]; then | |
| if [[ ! -e "$user_legacy" ]]; then | |
| mv "$legacy" "$user_legacy" | |
| else | |
| echo "cannot preserve existing $legacy: $user_legacy already exists" >&2 | |
| false | |
| fi | |
| fi | |
| ln -sfn ${verify-manager-push-refs} "$legacy" | |
| ''; | |
| install-manager-push-refs = '' | |
| hooks_dir="$(git rev-parse --git-path hooks)" | |
| legacy="$hooks_dir/pre-push.legacy" | |
| user_legacy="$hooks_dir/pre-push.user-legacy" | |
| installed="$(${pkgs.coreutils}/bin/readlink "$legacy" 2>/dev/null || true)" | |
| if [[ -e "$legacy" && "$installed" != *-verify-manager-push-refs && "$installed" != *-verify-single-manager-push-ref ]]; then | |
| if [[ ! -e "$user_legacy" ]]; then | |
| mv "$legacy" "$user_legacy" | |
| else | |
| echo "cannot preserve existing $legacy: $user_legacy already exists" >&2 | |
| exit 1 | |
| fi | |
| fi | |
| ln -sfn ${verify-manager-push-refs} "$legacy" | |
| ''; |
🤖 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 `@flake.nix` around lines 225 - 239, In the install-manager-push-refs hook,
update the failure branch that reports an existing $user_legacy in
install-manager-push-refs to exit explicitly with status 1 instead of invoking
false, preventing execution from reaching the subsequent ln -sfn command.
d68c920 to
0961143
Compare
|
/run-e2e |
|
❌ Merge blocked: no approving review on |
|
/genvm-force-merge |
|
|
* fix: add pre-push hook * chore: restructure contributor docs and rework the test harness 📝♻️ * fix(git): ask the remote for the gitlink commit, not for a matching ref 🐛 * chore(ci): push locally built store paths to the nix cache 🏗️ * docs: fix wording and the versions.json path flagged in review 📝 * chore(ci): make the whole nix cache push fail-soft 💚 * fix(build): keep a user pre-push hook and serialize the submodule cache 🐛 * chore(codegen): assert a non-empty description in $str constructors ✅
870d5a2 to
98148e9
Compare
* chore(executor): harden the precompile cache and speed up dev builds 🔒️⚡ * chore(sdk-rs): reject an empty description in vm_error constructors ✅
|
✅ Merged into |
Summary by CodeRabbit
Documentation
Chores