Compare commits

...

2 Commits

Author SHA1 Message Date
GitCaddy
9bd0a95e9f fix(mcp): use json.RawMessage for proper JSON unmarshaling
Some checks failed
Build and Release / Create Release (push) Successful in 0s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 2m15s
Build and Release / Build Binaries (amd64, darwin) (push) Has been cancelled
Build and Release / Build Binaries (amd64, linux) (push) Has been cancelled
Build and Release / Build Binaries (amd64, windows) (push) Has been cancelled
Build and Release / Build Binaries (arm64, darwin) (push) Has been cancelled
Build and Release / Build Binaries (arm64, linux) (push) Has been cancelled
Build and Release / Lint (push) Has been cancelled
Build and Release / Unit Tests (push) Has been cancelled
Add RawMessage type alias to modules/json and use it in MCP handler.
The custom RawMessage type was not implementing json.Unmarshaler,
causing parse errors when receiving MCP tool calls with params object.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 00:37:16 +00:00
GitCaddy
5818970a2a feat(runners): display Xcode SDKs, Simulators, BuildTools, and PackageManagers
All checks were successful
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 3m15s
Build and Release / Unit Tests (push) Successful in 3m53s
Build and Release / Lint (push) Successful in 4m23s
Build and Release / Build Binaries (amd64, darwin) (push) Successful in 2m49s
Build and Release / Create Release (push) Successful in 0s
Build and Release / Build Binaries (amd64, windows) (push) Successful in 2m40s
Build and Release / Build Binaries (amd64, linux) (push) Successful in 2m48s
Build and Release / Build Binaries (arm64, darwin) (push) Successful in 2m10s
Build and Release / Build Binaries (arm64, linux) (push) Successful in 2m4s
- Add XcodeInfo struct for macOS runner capabilities (version, build, SDKs, simulators)
- Add BuildTools and PackageManagers fields to RunnerCapability struct
- Update runner_edit.tmpl to display:
  - Xcode info with SDKs and Simulators for macOS runners
  - Build Tools (gcc, g++, msbuild, etc.) for all platforms
  - Package Managers (apt, brew, chocolatey, etc.) for all platforms

This aligns with act_runner capability detection which already reports these fields.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 00:07:49 +00:00
4 changed files with 72 additions and 7 deletions

View File

@@ -109,3 +109,7 @@ func UnmarshalHandleDoubleEncode(bs []byte, v any) error {
}
return err
}
// RawMessage is a raw encoded JSON value.
// It implements Marshaler and Unmarshaler and can be used to delay JSON decoding.
type RawMessage = json.RawMessage

View File

@@ -28,16 +28,27 @@ type DistroInfo struct {
PrettyName string `json:"pretty_name,omitempty"` // e.g., "Ubuntu 24.04 LTS"
}
// XcodeInfo holds Xcode-specific information for macOS runners
type XcodeInfo struct {
Version string `json:"version,omitempty"`
Build string `json:"build,omitempty"`
SDKs []string `json:"sdks,omitempty"`
Simulators []string `json:"simulators,omitempty"`
}
// RunnerCapability represents the detailed capabilities of a runner
type RunnerCapability struct {
OS string `json:"os"`
Arch string `json:"arch"`
Distro *DistroInfo `json:"distro,omitempty"`
Xcode *XcodeInfo `json:"xcode,omitempty"`
Docker bool `json:"docker"`
DockerCompose bool `json:"docker_compose"`
ContainerRuntime string `json:"container_runtime,omitempty"`
Shell []string `json:"shell,omitempty"`
Tools map[string][]string `json:"tools,omitempty"`
BuildTools []string `json:"build_tools,omitempty"`
PackageManagers []string `json:"package_managers,omitempty"`
Features *CapabilityFeatures `json:"features,omitempty"`
Limitations []string `json:"limitations,omitempty"`
Disk *DiskInfo `json:"disk,omitempty"`

View File

@@ -22,16 +22,13 @@ import (
"code.gitea.io/gitea/services/context"
)
// RawMessage is a raw encoded JSON value (equivalent to encoding/json.RawMessage)
type RawMessage []byte
// MCP Protocol Types (JSON-RPC 2.0)
type MCPRequest struct {
JSONRPC string `json:"jsonrpc"`
ID any `json:"id"`
Method string `json:"method"`
Params RawMessage `json:"params,omitempty"`
JSONRPC string `json:"jsonrpc"`
ID any `json:"id"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
type MCPResponse struct {

View File

@@ -174,6 +174,37 @@
{{end}}
</div>
{{if .RunnerCapabilities.Xcode}}
<div class="field tw-mb-3">
<label>Xcode</label>
<div>
{{if .RunnerCapabilities.Xcode.Version}}
<span class="ui small blue label">{{.RunnerCapabilities.Xcode.Version}}{{if .RunnerCapabilities.Xcode.Build}} ({{.RunnerCapabilities.Xcode.Build}}){{end}}</span>
{{end}}
</div>
{{if .RunnerCapabilities.Xcode.SDKs}}
<div class="tw-mt-2">
<label class="tw-text-xs" style="opacity: 0.7;">SDKs</label>
<div class="tw-flex tw-flex-wrap tw-gap-1">
{{range .RunnerCapabilities.Xcode.SDKs}}
<span class="ui small olive label">{{.}}</span>
{{end}}
</div>
</div>
{{end}}
{{if .RunnerCapabilities.Xcode.Simulators}}
<div class="tw-mt-2">
<label class="tw-text-xs" style="opacity: 0.7;">Simulators</label>
<div class="tw-flex tw-flex-wrap tw-gap-1">
{{range .RunnerCapabilities.Xcode.Simulators}}
<span class="ui small violet label">{{.}}</span>
{{end}}
</div>
</div>
{{end}}
</div>
{{end}}
{{if .RunnerCapabilities.Shell}}
<div class="field tw-mb-3">
<label>{{ctx.Locale.Tr "actions.runners.capabilities.shells"}}</label>
@@ -196,6 +227,28 @@
</div>
{{end}}
{{if .RunnerCapabilities.BuildTools}}
<div class="field tw-mb-3">
<label>Build Tools</label>
<div class="tw-flex tw-flex-wrap tw-gap-1">
{{range .RunnerCapabilities.BuildTools}}
<span class="ui small brown label">{{.}}</span>
{{end}}
</div>
</div>
{{end}}
{{if .RunnerCapabilities.PackageManagers}}
<div class="field tw-mb-3">
<label>Package Managers</label>
<div class="tw-flex tw-flex-wrap tw-gap-1">
{{range .RunnerCapabilities.PackageManagers}}
<span class="ui small pink label">{{.}}</span>
{{end}}
</div>
</div>
{{end}}
{{if .RunnerCapabilities.Limitations}}
<div class="field tw-mb-3">
<label>{{ctx.Locale.Tr "actions.runners.capabilities.limitations"}}</label>