posit-dev / posit-dev/posit-sdk-py

Add `nodejs` to the `Environments` Protocol type signature

Open Beginner friendly
#477 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement sdk
Dominant language
Python
Stars
18
Forks
14
Avg merge
2d 18h
Merged PRs (30d)
4

Description

The Environments.create() Protocol in src/posit/connect/environments.py lists explicit keyword arguments for python, r, quarto, and tensorflow installations, but not nodejs.

Connect is adding support for nodejs.installations as an option for execution environments.

  • POST /v1/environments accepts it
  • PUT /v1/environments/{guid} also accepts it
  • and GET always returns it.

At runtime the underlying _ResourceSequence.create(**attributes) happily POSTs a nodejs=... kwarg, so the SDK works against the new field today.

The gap is purely typing: static type-checkers and IDE autocomplete flag nodejs=... as unexpected.

Suggested change

Add nodejs: Installations | None = ... alongside the other language kwargs in three places in src/posit/connect/environments.py:

  • Environment.update
  • Environments.create
  • Environments.find_by

Node.js content support is currently behind EarlyAccess.NodeJs` in Connect, but the field shape mirrors the other languages exactly.

Contributor guide

Open the contributing guide

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

Read the Environments protocol definitions in src/posit/connect/environments.py, focusing on Environment.update, Environments.create, and Environments.find_by and their existing installation arguments. Add the nodejs parameter consistently, then run the project's type checks or tests to confirm nodejs is accepted by static tooling in all three entry points.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, python
Domain
api
Issue type
Feature
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.