posit-dev / posit-dev/connect-actions

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

Open
#83 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1
Forks
0
Avg merge
1h 44m
Merged PRs (30d)
4

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search for resolve_app_type and APP_MODE_TO_TYPE, then inspect the existing deployment tests and compare their cases with AppModeFromString and the listed CLI aliases. Done means all 20 app modes are covered, unsupported modes produce explicit errors, the dead python-flask entry is removed, and the relevant tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.