Repository navigation
Fix app/service/task help and messages that can't work (#1145, #1153) - #1222
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Help examples, hints and error messages that point at commands that fail or do something else: app launch examples for recipe-only apps, a Reconnect hint that launched a second instance, DCV inspect hints that opened the streaming session instead of a shell (connect --session-manager now opens one), bare --image refs, --health-path ignored without --web-port, app list -o json, the uvicorn and slurm --spot examples, the unregistered spawn:// URL, the service --host dry run's idle note, and task's results_prefix field name and --help. TestHelpExamplesResolve resolves every `spawn ...` example in Long and Example help against the real cobra tree.
scttfrdmn
force-pushed
the
fix/1145-1153-help-messages
branch
from
October 20, 2026 05:52
50512f3 to
84c5579
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1145
Fixes #1153
None of this was run on AWS. Each item was checked in source, and the claims about connect and slurm were checked against a locally built binary with fake credentials.
#1145
spawn task run: the malformed-prefix error saidresources.results_prefix. It now saysresults_prefix, the TaskSpec's top-level JSON tag.spawn task --helplistsrunandstatusas well asdiagnose, and the Short no longer says only "diagnose".#1153
spawn connect <id>, which reopens the session and starts an idle-stopped instance. It used to sayspawn app launch <app> --name <session>, which launches a second instance. For a web app it says "open the URL above", becausespawn connectopens an SSH shell there, not the app.spawn connect <id> --session-manageron a DCV instance now opens a shell instead of the streaming session (connectOpensDCV). The DCV security group has no port 22, so SSM is the way in. The DCV failure messages now name that command. The web-app messages keep plainspawn connect, because the web SG does allow 22.spawn app --helpnow uses jupyter / code-server / desktop, and paraview only with--image. It also says which apps launch out of the box. README anddocs/bring-your-own-app.md: theirspawn app launch myapp --image … --web-port …form ("no catalog entry needed") is now real. An unknown name with--imageand--web-portbecomes an ad-hoc web entry, and--instance-typeis required, since there is no hardware spec to default from. I picked this over rewriting the docs because the docs state the intent. README example 1 now uses paraview with--image.--imageresolves to the ref's tag, else--app-version, elselatest(byoImageTag), as the code comment promised.--health-pathapplies to any web app, including catalog web apps, and is refused for DCV/desktop (applyWebFlags). Before, it was silently ignored without--web-port.spawn service --help: the uvicorn example is replaced with an--addr-argsexample. uvicorn rejects the appended--addr, and it doesn't print the readiness line either.spawn app list -o jsonemits JSON (writeAppList).service --host --dry-rundrops the idle-timeout note. The session page no longer navigates to the unregisteredspawn://URL: the restart button showsspawn connect <id>and waits for the session.catalog-schema.mdgains anargsrow.launch_commandis marked legacy and not launchable (that is whatclassifyForList/launch already do), incatalog-overlay.example.yamltoo. Thevisibilityrow now says that a private image owned by another account is refused even with a grant. I kept the refusal rather than attempting the pull, because a failed pull leaves a doomed, billing instance (catalog: igv/qgis/fiji/ds9 show as 'launchable' but can't launch; bind existing upstream container images #592), and I fixed the contradicting header comment inapp_byo.go.mergeEntryskipsKindRaw/Port/HealthPath/Args. Filed as catalog: overlay rebind can't change kind, port, health_path or args (mergeEntry skips them) libs#58.The example gate
TestHelpExamplesResolve(cmd/help_examples_test.go) walks the real cobra tree. It discovers every line of Long/Example help that is aspawn <subcommand|flag> …invocation (handling\continuations, two-space comment/description columns, and--workload args) and resolves it: every word must be a subcommand, a flag on the resolved command (local or inherited), or a positional argument itsArgsaccepts. The discovery fails on fewer than 20 examples.TestHelpAppLaunchExamplesAreLaunchableadds a semantic check: anapp launch <app>example without--imagemust belaunchableperclassifyForList, run against the embedded catalog only, not the developer's~/.spawn/catalog.yaml.What it found, beyond the issue:
spawn slurmhelp used a--spotflag that doesn't exist (spot comes from#SPAWN --spot=true), andspawn launch --params params.yamlwith no name (--paramsis inline JSON; the file flag is--param-file). Theslurm estimatenext-steps text had the same mistake. All fixed. Help owned by libs i18n (root and launch Long) is skipped, and its broken examples are spore-host/libs#59. Limitation (documented in the test): flag values are not applied, so anArgsvalidator sees flag defaults.Gates failed against compiling reverts
Each was reverted and the named test watched fail:
spawn app launch paraview: AreLaunchable--spot: ResolveconnectOpensDCVignoring--session-manager: DCVInspect"": BYOImageTagresources.results_prefix: TaskResultsPrefix (reflects the TaskSpec JSON tag)status: TaskHelpLists (discovers the subcommands)spawn://restored: SessionPageChecks
make check: all steps pass exceptcheck-build-tags, which fails identically on unmodified main on this machine (/private/tmppaths; verified on a stash of this worktree).make gen-docs(app/connect/service/slurm/task.md), thenmake check-docs: clean. semgrep: 0 findings.Follow-ups filed
spawn slurm submitre-execsspawn launch --param-file <tmp>with no name, so every submit fails after the cost confirmation. Reproduced locally with the exact argv plus--dry-run. No launch happens and nothing leaks.mergeEntrydrops kind/port/health_path/args.Both PRs (this one and #1213) add to
## [Unreleased]in the CHANGELOG, so whichever merges second needsmake changelog-fix.