-
Notifications
You must be signed in to change notification settings - Fork 148
feat(box): curated 3-image box boot + #715 build-debt fixes #731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
69bcbe8
df620bf
28daac6
1a31d40
e392878
2ab2582
f090328
7394dfe
61a1b1a
5c2d602
4efe337
c1bb095
908bee8
33b336d
7f79701
449eb9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,13 +11,30 @@ | |||||||||||||||||||||||||||||||||||
| # Triggers: | ||||||||||||||||||||||||||||||||||||
| # - workflow_run: After "Build C SDK" completes (ensures libboxlite.a exists) | ||||||||||||||||||||||||||||||||||||
| # - workflow_dispatch: Manual trigger for testing | ||||||||||||||||||||||||||||||||||||
| # - workflow_call: Reusable callers can set libboxlite_source=build to use a | ||||||||||||||||||||||||||||||||||||
| # C SDK artifact built from the same checkout. | ||||||||||||||||||||||||||||||||||||
| name: Build Runner Binary | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||
| workflow_run: | ||||||||||||||||||||||||||||||||||||
| workflows: ["Build C SDK"] | ||||||||||||||||||||||||||||||||||||
| types: [completed] | ||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||
| libboxlite_source: | ||||||||||||||||||||||||||||||||||||
| description: 'libboxlite.a source for manual runs' | ||||||||||||||||||||||||||||||||||||
| type: choice | ||||||||||||||||||||||||||||||||||||
| default: source | ||||||||||||||||||||||||||||||||||||
| options: | ||||||||||||||||||||||||||||||||||||
| - source | ||||||||||||||||||||||||||||||||||||
| - release | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+23
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add missing 'build' option and align default with workflow_call. The ✅ Proposed fix to add 'build' option and align defaults workflow_dispatch:
inputs:
libboxlite_source:
description: 'libboxlite.a source for manual runs'
type: choice
- default: source
+ default: release
options:
- source
- release
+ - build📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||
| workflow_call: | ||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||
| libboxlite_source: | ||||||||||||||||||||||||||||||||||||
| description: 'How to obtain libboxlite.a: release, build, or source' | ||||||||||||||||||||||||||||||||||||
| type: string | ||||||||||||||||||||||||||||||||||||
| default: release | ||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+31
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Validate libboxlite_source input to prevent silent failures. The 🛡️ Proposed fix to add early validationAdd a validation step after checkout: steps:
- uses: actions/checkout@v4
+ - name: Validate libboxlite_source input
+ run: |
+ VALID_VALUES="release build source"
+ VALUE="${{ inputs.libboxlite_source }}"
+ if [ -n "$VALUE" ] && ! echo "$VALID_VALUES" | grep -qw "$VALUE"; then
+ echo "::error::Invalid libboxlite_source='$VALUE'. Must be one of: $VALID_VALUES"
+ exit 1
+ fi
+
- name: Set up Go
uses: actions/setup-go@v5🧰 Tools🪛 zizmor (1.25.2)[error] 18-37: use of fundamentally insecure workflow trigger (dangerous-triggers): workflow_run is almost always used insecurely (dangerous-triggers) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||
|
|
@@ -56,7 +73,14 @@ jobs: | |||||||||||||||||||||||||||||||||||
| VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/') | ||||||||||||||||||||||||||||||||||||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Set up Rust | ||||||||||||||||||||||||||||||||||||
| if: inputs.libboxlite_source == 'source' | ||||||||||||||||||||||||||||||||||||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pin action to commit SHA for supply chain security. The action reference 🔒 Proposed fix to pin the action - name: Set up Rust
if: inputs.libboxlite_source == 'source'
- uses: actions-rust-lang/setup-rust-toolchain@v1
+ uses: actions-rust-lang/setup-rust-toolchain@b113a30d27a8e59c969077c0a0168cc13dab5ffc # v1
with:
toolchain: ${{ needs.config.outputs.rust-toolchain }}Note: Replace the SHA with the actual commit hash for the v1 tag from the upstream repository. 🧰 Tools🪛 zizmor (1.25.2)[error] 78-78: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||
| toolchain: ${{ needs.config.outputs.rust-toolchain }} | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Download prebuilt libboxlite.a | ||||||||||||||||||||||||||||||||||||
| if: inputs.libboxlite_source == '' || inputs.libboxlite_source == 'release' | ||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||
| VERSION: ${{ steps.version.outputs.version }} | ||||||||||||||||||||||||||||||||||||
| GH_REPO: ${{ github.repository }} | ||||||||||||||||||||||||||||||||||||
|
|
@@ -67,6 +91,34 @@ jobs: | |||||||||||||||||||||||||||||||||||
| curl -fsSL "${URL}" | tar xz -C /tmp/ | ||||||||||||||||||||||||||||||||||||
| cp "/tmp/boxlite-c-v${VERSION}-linux-x64-gnu/lib/libboxlite.a" sdks/go/libboxlite.a | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Download libboxlite.a from sibling Build C SDK job | ||||||||||||||||||||||||||||||||||||
| if: inputs.libboxlite_source == 'build' | ||||||||||||||||||||||||||||||||||||
| uses: actions/download-artifact@v4 | ||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pin action to commit SHA for supply chain security. The action reference 🔒 Proposed fix to pin the action - name: Download libboxlite.a from sibling Build C SDK job
if: inputs.libboxlite_source == 'build'
- uses: actions/download-artifact@v4
+ uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
name: c-sdk-linux-x64-gnu
path: /tmp/c-sdk/Note: Replace the SHA with the actual commit hash for the v4 tag from the actions/download-artifact repository. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[error] 96-96: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||
| name: c-sdk-linux-x64-gnu | ||||||||||||||||||||||||||||||||||||
| path: /tmp/c-sdk/ | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Stage libboxlite.a from sibling artifact | ||||||||||||||||||||||||||||||||||||
| if: inputs.libboxlite_source == 'build' | ||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||
| set -euo pipefail | ||||||||||||||||||||||||||||||||||||
| ARCHIVE=$(ls /tmp/c-sdk/boxlite-c-v*-linux-x64-gnu.tar.gz | head -1) | ||||||||||||||||||||||||||||||||||||
| [ -n "$ARCHIVE" ] || { echo "::error::No c-sdk archive in artifact"; exit 1; } | ||||||||||||||||||||||||||||||||||||
| tar xzf "$ARCHIVE" -C /tmp/c-sdk/ | ||||||||||||||||||||||||||||||||||||
| A=$(find /tmp/c-sdk -name libboxlite.a | head -1) | ||||||||||||||||||||||||||||||||||||
| [ -n "$A" ] || { echo "::error::libboxlite.a not found in archive"; exit 1; } | ||||||||||||||||||||||||||||||||||||
| mkdir -p sdks/go | ||||||||||||||||||||||||||||||||||||
| cp "$A" sdks/go/libboxlite.a | ||||||||||||||||||||||||||||||||||||
| ls -lh sdks/go/libboxlite.a | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Build libboxlite.a from current source | ||||||||||||||||||||||||||||||||||||
| if: inputs.libboxlite_source == 'source' | ||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||
| make setup:build runtime dist:go | ||||||||||||||||||||||||||||||||||||
| mkdir -p sdks/go | ||||||||||||||||||||||||||||||||||||
| cp target/release/libboxlite.a sdks/go/libboxlite.a | ||||||||||||||||||||||||||||||||||||
| ls -lh sdks/go/libboxlite.a | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Rewrite go.work for minimal modules | ||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||
| printf 'go 1.25.4\n\nuse (\n\t./runner\n\t./daemon\n\t./common-go\n\t./api-client-go\n\t./libs/computer-use\n\t../sdks/go\n)\n' > apps/go.work | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: boxlite-ai/boxlite
Length of output: 12289
Split the GitHub Release upload out of the reusable C build workflow to keep PR permissions read-only.
.github/workflows/build-c.ymlis invoked viaworkflow_call, but it also containsupload-to-releasewithpermissions: contents: write(guarded by the release-onlyif:). This still forces the caller in.github/workflows/e2e-cloud.yml(build_c_sdk) to requestcontents: write, expanding the PR token even though the release-upload job won’t run for PR/workflow_call builds. Move the asset upload to a release-only workflow (or a separate reusable workflow) and keep the reusable build path read-only.🤖 Prompt for AI Agents