Conversation
Reclaim the `run` verb for predictions by moving the arbitrary-command runner to `cog exec`. `cog run` remains as a hidden alias with a deprecation warning so existing scripts continue to work. - Rename pkg/cli/run.go -> pkg/cli/exec.go - Use Cobra Aliases for the backward-compatible `run` alias - Print deprecation warning to stderr when invoked as `cog run` - Update integration tests, docs, and architecture references - Regenerate docs/cli.md and docs/llms.txt
|
LGTM |
- Add exec_run_deprecated.txtar to verify 'cog run' alias works and emits a deprecation warning (matches train_deprecated.txtar pattern) - Fix AGENTS.md: 'build, run, predict' -> 'build, exec, predict'
|
I reviewed PR #2916 by loading the relevant review skills and examining the key changed files including |
Switch from raw fmt.Fprintln(os.Stderr) to console.Warn() for the 'cog run' deprecation message, consistent with how warnings are emitted elsewhere in the CLI.
There was a problem hiding this comment.
This PR renames cog run to cog exec while maintaining backward compatibility via a hidden alias with deprecation warning. The implementation looks solid overall with proper use of Cobra's Aliases field and appropriate deprecation messaging.
One minor issue with a comment referencing the wrong command:
|
|
||
| // The final image ID comes from the label-adding step. | ||
| // When schema validation is skipped (cog run), there is no schema file to bundle. | ||
| // When schema validation is skipped (cog exec), there is no schema file to bundle. |
There was a problem hiding this comment.
The comment mentions cog exec but the condition checks skipSchemaValidation which is used by cog exec, cog predict, cog serve, and cog train (per the comment on line 290). The comment should be more accurate:
| // When schema validation is skipped (cog exec), there is no schema file to bundle. | |
| // The final image ID comes from the label-adding step. | |
| // When schema validation is skipped (cog exec/predict/serve/train), there is no schema file to bundle. |
|
I'm Bonk, and I've done a quick review of your PR. This PR renames Minor issue: In |
…icate/cog into mphelps/push-phase-progress * 'mphelps/push-phase-progress' of https://github.com/replicate/cog: (95 commits) feat: add metric name validation (#2911) Rename `cog run` to `cog exec` (#2916) chore(deps): bump github.com/google/go-containerregistry (#2884) fix: replace removed libgl1-mesa-glx in tensorflow integration test (#2914) ci: enforce stub freshness in CI, fix existing stub drift (#2912) feat: add schema-compare command to test harness (#2891) chore(deps): bump uuid from 1.22.0 to 1.23.0 in /crates (#2887) chore(deps): bump github.com/hashicorp/go-version from 1.7.0 to 1.9.0 (#2909) chore(deps): bump insta from 1.46.3 to 1.47.2 in /crates (#2908) fix: support list[X] | None inputs + integration tests for PEP 604 union File/Path coercion (#2882) ci: exclude Dependabot PRs from auto-code review (#2910) chore(deps): bump actions/checkout from 4 to 6 (#2904) chore(deps): bump github.com/testcontainers/testcontainers-go/modules/registry (#2886) fix: metrics bugs in coglet prediction server (#2896) Bump version to 0.17.2 (#2903) fix(coglet): propagate metric scope to async event loop thread (#2902) chore: remove unnecessary nolint directive in test (#2803) feat(coglet): add Sentry error reporting for infrastructure errors (#2865) fix: homebrew cask postflight xattr references wrong binary name (#2899) fix: include custom metrics in cog predict --json output (#2897) ...
Summary
cog runcommand tocog execto free up therunverb for predictionscog runas a hidden alias with a deprecation warning printed to stderr so existing scripts don't breakAliasesfield — single command definition, no duplicated flag registrationChanges
Go (4 files)
pkg/cli/run.go→pkg/cli/exec.go: renamed command constructor, handler, and port variable; addedAliases: []string{"run"}and deprecation warning viacmd.CalledAs()pkg/cli/root.go: updated command registration and root example textpkg/model/options.go,pkg/image/build.go: updated commentsIntegration tests (6 files, 3 renamed)
run_basic.txtar→exec_basic.txtar,run_stdin_cat.txtar→exec_stdin_cat.txtar,run_stdin_unconsumed.txtar→exec_stdin_unconsumed.txtarpty_echo.txtar,pty_interactive.txtar,config_subdirectory.txtar: updated commandsDocs (auto-generated + manual)
docs/cli.mdanddocs/llms.txt: regenerateddocs/getting-started.md,docs/getting-started-own-model.md,docs/notebooks.md,docs/yaml.md: updated examplesREADME.md,architecture/06-cli.md,architecture/04-container-runtime.md,integration-tests/README.md: updated referencesTesting
mise run lint:go— 0 issuesmise run test:go— all tests passmise run docs:cli:check— docs up to datecog exec --helpshows the new commandcog run --helpworks via aliascog --helponly listsexec(alias is hidden)