Skip to content

Deploy fails for most app modes: app_mode → deploy subcommand mapping is incomplete #83

Description

@dotNomad

resolve_app_type maps a Connect app_mode to a posit connect deploy subcommand, but most app_mode names don't match.

$ posit connect deploy python-gradio
Error: No such command 'python-gradio'. Did you mean 'gradio'?

The authoritative app_mode list is AppModeFromString in
src/connect/worker/apptypes/apptypes.go:82, not the manifest docs
page
.

Deploy subcommands come from AppModes._cli_aliases in rsconnect-python.

Works today

app_mode subcommand
python-shiny shiny
python-fastapi fastapi
python-dash dash
python-streamlit streamlit
python-bokeh bokeh
quarto-static quarto
nodejs nodejs — by accident; the names happen to match

Broken: the subcommand exists, we don't map it

app_mode subcommand
python-api (Flask/WSGI) api (or flask)
python-gradio gradio
python-panel panel
jupyter-static notebook
jupyter-voila voila
tensorflow-saved-model tensorflow
static html

No correct subcommand to map to

  • shiny, rmd-shiny, rmd-static, api — R content; these already error
    today asking for a manifest.json
  • quarto-shiny — silently deploys as quarto-static via posit connect deploy quarto; needs ... deploy manifest instead
  • proxied — no CLI alias at all; not deployable from source

shiny and api are the sharp edge here: subcommands by those names do
exist, but they mean python-shiny and python-api (see below), so mapping
them straight through would deploy R content as Python.

Also

APP_MODE_TO_TYPE contains a python-flask key, but no such app_mode
exists — Connect reports Flask content as python-api. That entry never
fires, and Flask content fails.

api and shiny mean different things in the two namespaces: as app_modes
they are R Plumber and R Shiny, as CLI aliases they are python-api and
python-shiny.

Proposed fix

Fill in the missing modes, delete the dead python-flask key, and route
quarto-shiny and proxied to explicit errors.

Replace the fall-through with a clear error naming the supported modes, since
passing an unmapped mode through provably produces No such command.
Parametrize the tests over all 20 modes in AppModeFromString so a mode Connect
adds later fails loudly instead of falling through.

Docs discrepancy (separate, connect repo)

The manifest docs page lists jupyter and quarto, which
AppModeFromString rejects, and omits rmd-shiny, nodejs, and proxied.
Worth a docs issue; not in scope here.

Found while reviewing #75 — see Neal's comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions