namastex patch#7
Conversation
Summary of ChangesHello @automagik-genie, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the deployment and build infrastructure for the OpenClaw project. It introduces a new Jenkins pipeline for automated, secure, and parallel deployment across a fleet of hosts, alongside a powerful, idempotent installation script for setting up and updating the OpenClaw gateway on Linux systems. Furthermore, the core build process has been modernized by transitioning from pnpm to Bun, aiming for improved performance and consistency. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
|
@codex review this pr |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 805d84cb26
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.openclaw.android/.MainActivity", | ||
| "android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest", | ||
| "build": "pnpm canvas:a2ui:bundle && tsdown && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-compat.ts", | ||
| "build": "bun run canvas:a2ui:bundle && tsdown && bun run build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-compat.ts", |
There was a problem hiding this comment.
Keep the build script runnable without Bun
This change makes pnpm build depend on bun by invoking bun run ... inside the build script, but the repo’s CI explicitly runs pnpm build in jobs that set install-bun: "false" (see .github/workflows/ci.yml build-artifacts and release-check setup steps), so those environments will fail with bun: command not found whenever Bun is not preinstalled on the runner. Please keep the build pipeline command chain compatible with the Node+pnpm-only path used by CI.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Code Review
This pull request introduces significant fleet automation capabilities through a new Jenkins pipeline and a comprehensive installer script. The overall implementation is robust, leveraging Jenkins credentials for security and idempotent scripting for reliability. I've identified a few areas for improvement, including opportunities to reduce code duplication and fix hardcoded values that could impact maintainability. Addressing these points will enhance the quality and future-proofing of this new automation.
| for i in \$(seq 1 20); do | ||
| ssh -o BatchMode=yes -o ConnectTimeout=10 ${h.ssh} '\ | ||
| systemctl --user is-active openclaw-gateway >/dev/null 2>&1 || exit 1;\ | ||
| ss -tlnp 2>/dev/null | grep -q ":18789" || exit 1;\ |
There was a problem hiding this comment.
The port number 18789 is hardcoded in this health check. This port is defined as SERVICE_PORT in scripts/install.sh and can be overridden during deployment. To ensure consistency and prevent potential mismatches, you should define SERVICE_PORT as an environment variable in the Jenkinsfile and use it here.
Add this to your environment block:
SERVICE_PORT = '18789'Then use it in the health check.
ss -tlnp 2>/dev/null | grep -q ":${SERVICE_PORT}" || exit 1;\
| log_section "[9/10] Wrapper + stock cleanup" | ||
|
|
||
| local wrapper='#!/bin/bash | ||
| exec "$HOME/.nvm/versions/node/v24.13.1/bin/node" "/opt/genie/openclaw/dist/index.js" "$@"' |
There was a problem hiding this comment.
The Node.js version is hardcoded in the wrapper script definition. The script defines a NODE_VERSION variable at the top (line 9), which should be used here to avoid inconsistencies if the version is updated in the future.
| exec "$HOME/.nvm/versions/node/v24.13.1/bin/node" "/opt/genie/openclaw/dist/index.js" "$@"' | |
| exec "$HOME/.nvm/versions/node/${NODE_VERSION}/bin/node" "/opt/genie/openclaw/dist/index.js" "$@" |
| script { | ||
| def hosts | ||
| try { | ||
| hosts = new groovy.json.JsonSlurperClassic().parseText(env.FLEET_HOSTS_JSON) | ||
| } catch (Exception e) { | ||
| error("Invalid OPENCLAW_FLEET_HOSTS_JSON: ${e.message}") | ||
| } | ||
| if (!(hosts instanceof List) || hosts.size() == 0) { | ||
| error('OPENCLAW_FLEET_HOSTS_JSON must be a non-empty JSON array of {ssh,label} objects') | ||
| } | ||
|
|
||
| def branches = [:] | ||
|
|
||
| for (h in hosts) { | ||
| def sshTarget = h.ssh | ||
| def label = h.label | ||
| branches[label] = { | ||
| stage("${label}") { | ||
| deployHost(sshTarget, label) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| parallel branches | ||
| } |
There was a problem hiding this comment.
The logic for parsing FLEET_HOSTS_JSON is duplicated in the 'Deploy Fleet' and 'Health Checks' stages. To improve maintainability and reduce code duplication, you could extract this logic into a helper function.
For example, you could add this function at the end of the file:
def parseFleetHosts() {
def hosts
try {
hosts = new groovy.json.JsonSlurperClassic().parseText(env.FLEET_HOSTS_JSON)
} catch (Exception e) {
error("Invalid OPENCLAW_FLEET_HOSTS_JSON: ${e.message}")
}
if (!(hosts instanceof List) || hosts.size() == 0) {
error('OPENCLAW_FLEET_HOSTS_JSON must be a non-empty JSON array of {ssh,label} objects')
}
return hosts
}Then, you can simplify this block and the one in the 'Health Checks' stage by calling def hosts = parseFleetHosts().
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
Single-squash patch containing fleet automation only.
Includes:
Intentionally excludes: