Skip to content

Fix app/service/task help and messages that can't work (#1145, #1153) - #1222

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1145-1153-help-messages
Oct 20, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1145-1153-help-messages

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

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 said resources.results_prefix. It now says results_prefix, the TaskSpec's top-level JSON tag.
  • spawn task --help lists run and status as well as diagnose, and the Short no longer says only "diagnose".

#1153

  1. Reconnect hint. For a DCV session it now says spawn connect <id>, which reopens the session and starts an idle-stopped instance. It used to say spawn app launch <app> --name <session>, which launches a second instance. For a web app it says "open the URL above", because spawn connect opens an SSH shell there, not the app.
  2. DCV inspect hints. spawn connect <id> --session-manager on 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 plain spawn connect, because the web SG does allow 22.
  3. Help examples. spawn app --help now uses jupyter / code-server / desktop, and paraview only with --image. It also says which apps launch out of the box. README and docs/bring-your-own-app.md: their spawn app launch myapp --image … --web-port … form ("no catalog entry needed") is now real. An unknown name with --image and --web-port becomes an ad-hoc web entry, and --instance-type is 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.
  4. Bare --image resolves to the ref's tag, else --app-version, else latest (byoImageTag), as the code comment promised.
  5. --health-path applies to any web app, including catalog web apps, and is refused for DCV/desktop (applyWebFlags). Before, it was silently ignored without --web-port.
  6. spawn service --help: the uvicorn example is replaced with an --addr-args example. uvicorn rejects the appended --addr, and it doesn't print the readiness line either.
  7. spawn app list -o json emits JSON (writeAppList). service --host --dry-run drops the idle-timeout note. The session page no longer navigates to the unregistered spawn:// URL: the restart button shows spawn connect <id> and waits for the session.

The example gate

TestHelpExamplesResolve (cmd/help_examples_test.go) walks the real cobra tree. It discovers every line of Long/Example help that is a spawn <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 its Args accepts. The discovery fails on fewer than 20 examples. TestHelpAppLaunchExamplesAreLaunchable adds a semantic check: an app launch <app> example without --image must be launchable per classifyForList, run against the embedded catalog only, not the developer's ~/.spawn/catalog.yaml.

What it found, beyond the issue: spawn slurm help used a --spot flag that doesn't exist (spot comes from #SPAWN --spot=true), and spawn launch --params params.yaml with no name (--params is inline JSON; the file flag is --param-file). The slurm estimate next-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 an Args validator sees flag defaults.

Gates failed against compiling reverts

Each was reverted and the named test watched fail:

  • help example back to spawn app launch paraview: AreLaunchable
  • slurm --spot: Resolve
  • old Reconnect string: ReconnectHint
  • connectOpensDCV ignoring --session-manager: DCVInspect
  • a DCV message back to plain connect: DCVInspect
  • bare-ref tag "": BYOImageTag
  • health-path only with web-port: ApplyWebFlags
  • JSON branch disabled: AppListJSON
  • idle-note condition: ServiceDryRunWithHost
  • resources.results_prefix: TaskResultsPrefix (reflects the TaskSpec JSON tag)
  • task Long missing status: TaskHelpLists (discovers the subcommands)
  • spawn:// restored: SessionPage
  • ad-hoc path disabled: AdhocWebEntry

Checks

  • make check: all steps pass except check-build-tags, which fails identically on unmodified main on this machine (/private/tmp paths; verified on a stash of this worktree).
  • make gen-docs (app/connect/service/slurm/task.md), then make check-docs: clean. semgrep: 0 findings.

Follow-ups filed

Both PRs (this one and #1213) add to ## [Unreleased] in the CHANGELOG, so whichever merges second needs make changelog-fix.

@scttfrdmn scttfrdmn added this to the v0.137.0 milestone Oct 20, 2026
@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.33333% with 33 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/app.go 48.21% 29 Missing ⚠️
cmd/slurm.go 0.00% 2 Missing ⚠️
cmd/connect.go 75.00% 1 Missing ⚠️
cmd/task.go 0.00% 1 Missing ⚠️

📢 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
scttfrdmn force-pushed the fix/1145-1153-help-messages branch from 50512f3 to 84c5579 Compare October 20, 2026 05:52
@scttfrdmn
scttfrdmn merged commit 61c71ad into main Oct 20, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1145-1153-help-messages branch October 20, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant