Skip to content

namastex patch#7

Open
automagik-genie wants to merge 2 commits into
namastex/mainfrom
chore/namastex-patch
Open

namastex patch#7
automagik-genie wants to merge 2 commits into
namastex/mainfrom
chore/namastex-patch

Conversation

@automagik-genie
Copy link
Copy Markdown

Single-squash patch containing fleet automation only.

Includes:

  • Jenkinsfile fleet deploy pipeline hardened (no hardcoded internal hosts/IPs; uses Jenkins Secret Text credentials OPENCLAW_BUILD_HOST + OPENCLAW_FLEET_HOSTS_JSON; JSON parsing via JsonSlurperClassic; polling instead of fixed sleeps)
  • scripts/install.sh idempotent fleet installer/updater
  • build pipeline tweaks to remove pnpm dependency (bun run, npx tsc)

Intentionally excludes:

  • NX-001/002/003 (ClawNet / session path / apiKey)
  • install-client.sh
  • upstream-install.sh reference artifacts

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @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

  • Automated Fleet Deployment: Introduced a robust Jenkins pipeline for automated, secure, and resilient deployment of the OpenClaw fleet, utilizing Jenkins credentials for sensitive information and implementing polling for stability.
  • Idempotent Fleet Installer: Added a comprehensive 'install.sh' script that handles environment setup, dependency management (nvm, Node.js, Bun, Homebrew), repository synchronization, build processes, and systemd service management for the OpenClaw gateway.
  • Build System Modernization: Migrated the build process from 'pnpm' to 'bun run' and 'npx tsc', streamlining dependencies and improving build efficiency.
Changelog
  • Jenkinsfile
    • Added a new Jenkins pipeline for automated fleet deployment, including stages for fetching changes, building, restarting local gateway, deploying to fleet, and health checks.
    • Implemented secure credential usage for build and fleet hosts.
    • Incorporated JsonSlurperClassic for parsing fleet host configurations.
    • Replaced fixed sleeps with polling mechanisms for increased reliability.
  • package.json
    • Updated the 'build' script to use 'bun run' instead of 'pnpm' for executing build commands.
  • scripts/bundle-a2ui.sh
    • Modified error messages and build commands to reflect the transition from 'pnpm' to 'bun run' and 'npx tsc'.
  • scripts/install.sh
    • Added a new idempotent shell script for installing and updating the OpenClaw gateway on Linux.
    • Included steps for installing Homebrew, system packages, nvm, Node.js, and Bun.
    • Implemented logic for repository cloning/updating, build execution, and systemd user service management.
    • Added swap space management for low-memory environments.
Activity
  • The pull request was created to introduce a single-squash patch focused on fleet automation.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Copy Markdown

⚠️ Formal models conformance drift detected

The formal models extracted constants (generated/*) do not match this openclaw PR.

This check is informational (not blocking merges yet).
See the formal-models-conformance-drift artifact for the diff.

If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there.

@namastex888
Copy link
Copy Markdown

@codex review this pr

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread package.json Outdated
"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",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Jenkinsfile
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;\
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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;\

Comment thread scripts/install.sh
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" "$@"'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
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" "$@"

Comment thread Jenkinsfile
Comment on lines +132 to +156
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
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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().

@github-actions
Copy link
Copy Markdown

⚠️ Formal models conformance drift detected

The formal models extracted constants (generated/*) do not match this openclaw PR.

This check is informational (not blocking merges yet).
See the formal-models-conformance-drift artifact for the diff.

If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants