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.
resolve_app_typemaps a Connectapp_modeto aposit connect deploysubcommand, but mostapp_modenames don't match.The authoritative app_mode list is
AppModeFromStringinsrc/connect/worker/apptypes/apptypes.go:82, not the manifest docspage.
Deploy subcommands come from
AppModes._cli_aliasesinrsconnect-python.Works today
python-shinyshinypython-fastapifastapipython-dashdashpython-streamlitstreamlitpython-bokehbokehquarto-staticquartonodejsnodejs— by accident; the names happen to matchBroken: the subcommand exists, we don't map it
python-api(Flask/WSGI)api(orflask)python-gradiogradiopython-panelpaneljupyter-staticnotebookjupyter-voilavoilatensorflow-saved-modeltensorflowstatichtmlNo correct subcommand to map to
shiny,rmd-shiny,rmd-static,api— R content; these already errortoday asking for a
manifest.jsonquarto-shiny— silently deploys asquarto-staticviaposit connect deploy quarto; needs... deploy manifestinsteadproxied— no CLI alias at all; not deployable from sourceshinyandapiare the sharp edge here: subcommands by those names doexist, but they mean
python-shinyandpython-api(see below), so mappingthem straight through would deploy R content as Python.
Also
APP_MODE_TO_TYPEcontains apython-flaskkey, but no such app_modeexists — Connect reports Flask content as
python-api. That entry neverfires, and Flask content fails.
apiandshinymean different things in the two namespaces: as app_modesthey are R Plumber and R Shiny, as CLI aliases they are
python-apiandpython-shiny.Proposed fix
Fill in the missing modes, delete the dead
python-flaskkey, and routequarto-shinyandproxiedto 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
AppModeFromStringso a mode Connectadds later fails loudly instead of falling through.
Docs discrepancy (separate, connect repo)
The manifest docs page lists
jupyterandquarto, whichAppModeFromStringrejects, and omitsrmd-shiny,nodejs, andproxied.Worth a docs issue; not in scope here.
Found while reviewing #75 — see Neal's comment.