posit-dev / posit-dev/rsconnect-python

Implement flags for targeting an execution environment during deployment

Open
#652 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
37
Forks
28
Avg merge
1d 3h
Merged PRs (30d)
7

Description

Connect 2025.04 allows setting environment.identifier in the bundle's manifest.json. This new field allows the content to target a specific execution environment when running on Connect. The existing environment.image field remains unchanged however the semantics are slightly different. An image selection is now treated the same as any other piece of matching criteria. Connect will choose any execution environment that uses the specified container image.

We should add an --environment-id flag to both deploy <app> and write-manifest <app> - the value is the guid of the target execution environment in Connect and it should be written to environment.identifier in the manifest.json.

We should also add arguments the following arguments to deploy <app>: --default-image and --default-environment-id. These arguments accepts an image name and an execution environment guid respectively, however instead of writing these to the manfiest.json, we should update the App record in Connect to set the app.default_image_name and app.default_environment_guid fields. This new workflow allows users to call deploy <app> --default-image='my/custom/image:latest' or deploy <app> --default-environment-id='<env-guid>' only once and the image/environment will continue to be used for subsequent deployments (as long as it isn't overwritten by another deployment). This means that the arguments doesn't need to be provided every time deploy <app> is called, which is how the current --image flag behaves. This is the same workflow used by the Connect dashboard.

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

Start with the command entry points for deploy and write-manifest , then inspect how the existing --image flag and environment fields are handled. Trace the Connect App update path for default_image_name and default_environment_guid. Done means the new flags write the requested manifest value or persist the App defaults as specified, with coverage for both commands and workflows.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.