refactor: rename nodejs-api app mode to nodejs#763
Merged
Conversation
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>
|
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nodejs-apitonodejsand updating its description to "Node.js application". After that change, Connect's app-mode parser only acceptsnodejs, so any bundle still uploadingappmode: nodejs-apiwill be rejected.AppModes.NODE_APIsymbol →NODE_JS, the description, and the corresponding docstrings, CLI help text, tests, and CHANGELOG wording.AppModes.get_by_nameso localAppStoremetadata 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/andtests/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 --helpHelp 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.JS deploy against a Connect that includes the rename:
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.)
TS deploy:
Manifest inspection: Run
write-manifest nodejson a fixture and confirm the resultingmanifest.jsoncontains"appmode": "nodejs":AppStore backwards-compat alias: Simulate an old local AppStore entry from the prior
nodejs-apibuild, then re-deploy with this branch:This must NOT fail with
ValueError: No app mode named nodejs-api— the alias inAppModes.get_by_nameis 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)🤖 Generated with Claude Code