feat: add profile presets and proof artifacts#115
Conversation
…-proof # Conflicts: # internal/cli/config.go
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f538d604e4
ℹ️ 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".
| } else if useShell { | ||
| remote = windowsRemoteShellCommandWithEnvFiles(workdir, runEnv, envFiles, runCommandShellStringWithLiteralArgs(command, false, expansion.LiteralArgs)) |
There was a problem hiding this comment.
Use PowerShell-safe auto-shell script on native Windows
When useShell is true on a native Windows target (for example commands containing control operators like &&/| or leading env assignments) this path now feeds runCommandShellStringWithLiteralArgs(...) into windowsRemoteShellCommandWithEnvFiles(...). That helper builds POSIX-quoted fragments via shellQuote (e.g. 'cmd' 'arg'), which PowerShell does not execute as a command invocation, so auto-shell commands that previously ran as plain joined text will fail on Windows with parse/execution errors.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a8a7c70be
ℹ️ 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".
| if err != nil { | ||
| return err | ||
| } | ||
| cfg.Profile = strings.TrimSpace(*profile) |
There was a problem hiding this comment.
Preserve configured profile when --profile is omitted
Do not overwrite cfg.Profile unconditionally from the flag value here: --profile is registered with defaultConfig().Profile (typically empty), so when users run crabbox doctor --id ... without passing --profile, this assignment clears the profile loaded from config and silently disables profiles.<name>.doctor.enabled checks. That means repos relying on profile: in config will skip the new remote prerequisite contract unless callers redundantly pass --profile every time.
Useful? React with 👍 / 👎.
| func remoteProfileDoctorCommand(profile string, doctor DoctorProfileConfig, workdir string) string { | ||
| script := profileDoctorScript(doctor, workdir) | ||
| encoded := base64.StdEncoding.EncodeToString([]byte(script)) | ||
| return "bash -lc " + shellQuote("tmp=$(mktemp); trap 'rm -f \"$tmp\"' EXIT; printf %s "+shellQuote(encoded)+" | base64 -d > \"$tmp\" || exit 1; bash \"$tmp\"") |
There was a problem hiding this comment.
Make profile doctor script decode portable across POSIX targets
The profile doctor path is only blocked for native Windows, so macOS targets are treated as supported POSIX targets, but this command hard-codes base64 -d for decoding. On BSD/macOS base64, decode uses -D (and -d fails), so profile doctor exits before executing any prerequisite checks on macOS leases. This creates false profile doctor failed results despite valid environments.
Useful? React with 👍 / 👎.
Summary
crabbox run, including profile env defaults, doctor requirements, artifact globs, proof templates, and preset variables..crabbox/runs, parser-safe real behavior proof emission, expanded run summary fields, and--stop-aftercleanup policy.run,doctor, artifacts, and configuration.docs/refactor/profiles-presets.mdis intentionally absent.Verification
go test ./...go vet ./...go build -trimpath -o bin/crabbox ./cmd/crabboxgo test -race ./...node scripts/check-command-docs.mjsnode scripts/check-docs-links.mjsnode scripts/build-docs-site.mjsnpm ci --prefix workernpm run format:check --prefix workernpm run lint --prefix workernpm run check --prefix workernpm test --prefix workernpm run build --prefix worker$codex-review: clean, no accepted/actionable findingstest ! -e docs/refactor/profiles-presets.md