Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# The Go gates for this plugin's own module.
#
# The stock plugin repos carry no Go CI (their candies were thin); THIS one
# ships a real Go module with a vendored device client, so the rulebook's
# "tests that can fail" (R7) requires a gate that actually runs them:
# gofmt, the configured golangci-lint set, the formatter-class diff,
# go vet, and the unit tests (which drive a fake JetKVM device).
# This repo ships a REAL Go module (the cua provider + its client, CUE schema, and
# unit tests), so the rulebook's "tests that can fail" (R7) requires a gate that
# actually RUNS them: gofmt, golangci-lint, go vet, and the unit tests. The candy
# manifest gate (deploy.yml `charly box validate`) checks the manifest, not the Go
# code, and the bed exercises verb DISPATCH, not the unit tests — so this workflow
# is the only place the module's tests run.
name: ci

on:
Expand All @@ -28,23 +29,23 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version-file: candy/plugin-jetkvm/go.mod
cache-dependency-path: candy/plugin-jetkvm/go.sum
go-version-file: candy/plugin-cua/go.mod
cache-dependency-path: candy/plugin-cua/go.sum

- name: gofmt
working-directory: candy/plugin-jetkvm
working-directory: candy/plugin-cua
run: test -z "$(gofmt -l .)"

- name: golangci-lint
uses: golangci/golangci-lint-action@v7
with:
version: v2.13.2
working-directory: candy/plugin-jetkvm
working-directory: candy/plugin-cua

- name: go vet
working-directory: candy/plugin-jetkvm
working-directory: candy/plugin-cua
run: go vet ./...

- name: go test
working-directory: candy/plugin-jetkvm
working-directory: candy/plugin-cua
run: go test ./...
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Fetch the pinned charly source (CI-time temp checkout)
run: |
git clone --depth 1 --branch v2026.258.0219 https://github.com/opencharly/charly.git /tmp/charly
git clone --depth 1 --branch v2026.269.1034 https://github.com/opencharly/charly.git /tmp/charly

- uses: actions/setup-go@v5
with:
Expand Down
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
# Build output
/bin/
*.test

# charly run artifacts
.check/

# Go workspace files — this is a STANDALONE module (charly's loader builds it
# with GOWORK=off), so a workspace file here would only mask module resolution.
go.work
go.work.sum

# charly-generated build context ignores + build output
.containerignore
.dockerignore
.build/

# Migration rollback backups (charly migrate writes <file>.bak.<unix-ts>)
*.bak
*.bak.*
7 changes: 0 additions & 7 deletions candy/plugin-cua/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"context"
"encoding/json"
"fmt"
"os"
"strings"

"github.com/opencharly/plugin-cua/candy/plugin-cua/params"
Expand Down Expand Up @@ -111,9 +110,3 @@ func jsonArgs(m map[string]any) string {
func shellSingleQuote(s string) string {
return "'" + strings.ReplaceAll(s, "'", `'\''`) + "'"
}

// hostname is a small helper for evidence rows.
func hostname() string {
h, _ := os.Hostname()
return h
}
10 changes: 0 additions & 10 deletions candy/plugin-cua/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,6 @@ func applyDeviceDefaults(in *params.CuaInput, dev *params.CuaDeviceInput) {
}
}

// kindCapability advertises the plugin's kind:cua capability — the entity's
// self-contained CUE schema, served over the same Describe channel as the verb.
func kindCapability() sdk.ProvidedCapability {
return sdk.ProvidedCapability{
Class: "kind",
Word: kindWord,
InputDef: "#CuaDeviceInput",
}
}

// deviceCanonicalJSON is the OpLoad body decode: the host validates the authored entity
// against #CuaDeviceInput, then this re-marshals it canonically.
func deviceCanonicalJSON(paramsJSON []byte) (json.RawMessage, error) {
Expand Down
Loading