Skip to content

refactor: rename nodejs-api app mode to nodejs#763

Merged
dotNomad merged 1 commit intomainfrom
dotnomad/rename-nodejs-api-appmode
Apr 28, 2026
Merged

refactor: rename nodejs-api app mode to nodejs#763
dotNomad merged 1 commit intomainfrom
dotnomad/rename-nodejs-api-appmode

Conversation

@dotNomad
Copy link
Copy Markdown
Contributor

@dotNomad dotNomad commented Apr 27, 2026

Summary

  • Posit Connect is renaming the Node.js content app mode from nodejs-api to nodejs and updating its description to "Node.js application". After that change, Connect's app-mode parser only accepts nodejs, so any bundle still uploading appmode: nodejs-api will be rejected.
  • This PR updates the manifest appmode string, the internal AppModes.NODE_API symbol → NODE_JS, the description, and the corresponding docstrings, CLI help text, tests, and CHANGELOG wording.
  • Adds a one-entry alias map in AppModes.get_by_name so local AppStore metadata written by an earlier rsconnect-python (containing "nodejs-api") still resolves on re-deploy.

No changes to API call shapes, ordinals, or wire protocol — only the appmode string and the internal Python symbol change.

Directions for Reviewers

You'll need a Connect build that already includes the matching server-side rename. The fixtures from #761 (tests/testdata/node-express/ and tests/testdata/node-ts-express/) are reused below.

Run the CLI from this branch without cloning:

uvx --from "rsconnect-python @ git+https://github.com/posit-dev/rsconnect-python@dotnomad/rename-nodejs-api-appmode" rsconnect deploy nodejs --help
  1. Help text wording: Confirm the help output now says "Deploy a Node.js application to Posit Connect." (not "Node.js API"). Same for rsconnect write-manifest nodejs --help.

  2. JS deploy against a Connect that includes the rename:

    uvx --from "rsconnect-python @ git+https://github.com/posit-dev/rsconnect-python@dotnomad/rename-nodejs-api-appmode" \
      rsconnect deploy nodejs -s $CONNECT_URL -k $API_KEY tests/testdata/node-express/

    Should succeed end-to-end. (Against a pre-rename Connect, Connect will reject the bundle with an "unknown app mode" error — that's the breaking change this PR aligns with.)

  3. TS deploy:

    uvx --from "rsconnect-python @ git+https://github.com/posit-dev/rsconnect-python@dotnomad/rename-nodejs-api-appmode" \
      rsconnect deploy nodejs -s $CONNECT_URL -k $API_KEY tests/testdata/node-ts-express/
  4. Manifest inspection: Run write-manifest nodejs on a fixture and confirm the resulting manifest.json contains "appmode": "nodejs":

    cp -r tests/testdata/node-express /tmp/node-express-check && \
      uvx --from "rsconnect-python @ git+https://github.com/posit-dev/rsconnect-python@dotnomad/rename-nodejs-api-appmode" \
        rsconnect write-manifest nodejs -o /tmp/node-express-check && \
      grep appmode /tmp/node-express-check/manifest.json
  5. AppStore backwards-compat alias: Simulate an old local AppStore entry from the prior nodejs-api build, then re-deploy with this branch:

    cp -r tests/testdata/node-express /tmp/node-express-old
    mkdir -p /tmp/node-express-old/rsconnect-python
    cat > /tmp/node-express-old/rsconnect-python/node-express.json <<'JSON'
    {
      "version": 1,
      "deployments": {
        "$CONNECT_URL": {
          "server_url": "$CONNECT_URL",
          "app_mode": "nodejs-api",
          "app_id": "0"
        }
      }
    }
    JSON
    # Replace $CONNECT_URL above, then redeploy with --new (or with the existing app id):
    uvx --from "rsconnect-python @ git+https://github.com/posit-dev/rsconnect-python@dotnomad/rename-nodejs-api-appmode" \
      rsconnect deploy nodejs --new -s $CONNECT_URL -k $API_KEY /tmp/node-express-old

    This must NOT fail with ValueError: No app mode named nodejs-api — the alias in AppModes.get_by_name is what makes the legacy metadata resolve.

Test plan

  • pytest tests/test_bundle.py tests/test_main.py::TestDeployNodeJS tests/test_main.py::TestWriteManifestNodeJS (115 passed)
  • pytest tests/test_metadata.py tests/test_models.py (28 passed)
  • black --check rsconnect/ (clean)
  • flake8 rsconnect/ (clean)
  • pyright rsconnect/ (error count unchanged from baseline — all pre-existing Click typing noise)
  • Verify deploy against a Connect build that includes the rename

🤖 Generated with Claude Code

Connect renamed the Node.js content app mode from `nodejs-api` to
`nodejs` (posit-dev/connect#39005). After that change, Connect's
`AppModeFromString` only accepts `nodejs`, so any bundle uploaded with
`appmode: nodejs-api` would be rejected. Update the manifest string,
description, internal symbol, and surrounding docs/help/tests to match.

Also alias `nodejs-api` -> `nodejs` in `AppModes.get_by_name` so local
AppStore metadata written by an earlier rsconnect-python still resolves
on re-deploy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-04-28 18:20 UTC

@github-actions
Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
5618 4326 77% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/bundle.py 81% 🟢
rsconnect/main.py 69% 🟢
rsconnect/models.py 92% 🟢
TOTAL 81% 🟢

updated for commit: 414c174 by action🐍

Copy link
Copy Markdown
Contributor

@marcosnav marcosnav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! Thanks for this!

@dotNomad dotNomad merged commit 046ddf1 into main Apr 28, 2026
23 checks passed
@dotNomad dotNomad deleted the dotnomad/rename-nodejs-api-appmode branch April 28, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants