Apply .posit/publish config Connect-side settings: post-deploy hook + `rsconnect sync`
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず RSConnectExecutor、RSConnectClient content API、既存の env-var パスを確認し、次に rsconnect/publisher/ と redeploy で使用される deployment-record ロジックを調査します。共有 config applier と sync エントリーポイントを設計する前に、参照されている Publisher 実装、特に connectContentFromConfig.ts と mergeEnvVars を比較してください。deploy と sync が文書化された設定を適用し、mapping、hooks、server targeting、validation warnings、および bundle rebuild が発生しないことをテストで確認できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Follow-up to #830. That PR made rsconnect-python read/write Posit Publisher's
.posit/publish TOML, drive bundling from a config's files, and propagate
integration_requests into manifest.json. What it does not do is apply the
config's Connect-side settings — the fields that Publisher applies through the
Connect API after upload rather than through manifest.json.
Today those fields (description, connect.runtime.*, connect.access.*,
connect.kubernetes.*, environment, secrets) are round-tripped and preserved
in the config, but a rsconnect deploy/redeploy from a Publisher-authored config
still does not apply them to the content. As of #830, redeploy warns when a
resolved config sets any of these, so the gap is no longer silent — but the
settings themselves still aren't pushed to Connect. This issue tracks closing that
gap in two pieces:
- A post-deploy hook that applies the config's Connect-side settings after a
successful deploy (mirroring Publisher). - A
rsconnect synccommand that applies the current TOML settings to
already-deployed content ad hoc, without rebuilding/redeploying a bundle —
for when a user edits the config and just wants Connect updated.
Where each config field is applied (reference: Posit Publisher)
Publisher builds the manifest from the config, then makes two kinds of API calls.
Verified in the publisher repo:
extensions/vscode/src/bundler/{manifestFromConfig,connectContentFromConfig}.ts
and extensions/vscode/src/publish/{connectPublish,publishShared}.ts.
| Config field | Channel | Status in rsconnect after #830 |
|---|---|---|
type, entrypoint, python, quarto, r, jupyter, has_parameters |
manifest.json | ✅ (from inspection) |
integration_requests |
manifest.json | ✅ propagated in #830 |
title |
PATCH /v1/content/{guid} |
✅ (already applied via executor) |
description |
PATCH /v1/content/{guid} |
❌ not applied |
connect.runtime.* |
PATCH /v1/content/{guid} |
❌ not applied |
connect.access.* |
PATCH /v1/content/{guid} |
❌ not applied |
connect.kubernetes.* |
PATCH /v1/content/{guid} |
❌ not applied |
environment (env-var map) |
env-var API (setEnvVars) |
⚠️ CLI path exists, not sourced from config |
secrets |
env-var API (setEnvVars, merged; secrets override) |
❌ not applied |
Fields to apply via PATCH /v1/content/{guid}
Built by Publisher's connectContentFromConfig:
- metadata:
title,description(Connect rejectsdescription> 4096 chars) - runtime (
connect.runtime.*):connection_timeout,read_timeout,
init_timeout,idle_timeout,max_processes,min_processes,
max_conns_per_process,load_factor - access (
connect.access.*):run_as,run_as_current_user - kubernetes (
connect.kubernetes.*):memory_request,memory_limit,
cpu_request,cpu_limit,amd_gpu_limit,nvidia_gpu_limit,
service_account_name,default_image_name,
default_r_environment_management,default_py_environment_management
Fields to apply via the env-var API
-
environment(non-secret name→value map) is read straight from the config
and set on the content. -
secrets— follow Publisher's model exactly. The config'ssecretsarray
holds secret names only; values are never stored in the TOML or anywhere
on disk. Publisher keeps values in-memory in its webview for the session, does
not persist them (only credentials/Snowflake tokens use VS Code SecretStorage),
and re-prompts (names reload with empty values) on the next session. At publish
it sends only the names the user actually filled in, merges them over
environmentviamergeEnvVars(secret values win on key collision), sets them
on the content flagged as secret (encrypted/masked), and omits any
declared name with no value (it never sends empty values).CLI analogue (the faithful equivalent of Publisher's per-session entry): at
deploy/sync time, source each declared secret's value ad hoc — from the
process environment ($NAME) and/or explicit--secret NAME=VALUEflags — never
from a file. Merge overenvironment(secret wins), set flagged as secret, and
skip any declared name with no supplied value (warn, don't fail). rsconnect
already has an env-var code path (--environment/ executorenv_vars) to reuse
for the actual set call.
Part 1 — Post-deploy hook
Goal: after a successful Connect/SPCS deploy that has an applicable
.posit/publish config, apply that config's Connect-side settings to the deployed
content.
Design sketch:
- Add a
RSConnectClientmethod for the content-settings PATCH
(PATCH v1/content/{guid}) if one does not already exist, plus reuse the existing
env-var setter. - Add a builder in
rsconnect/publisher/that maps aPublisherConfigto the
content-settings payload (the rsconnect analogue ofconnectContentFromConfig)
and to the merged env-var map (analogue ofmergeEnvVars). Readconnect.*,
environment,secrets,descriptionfrom the config (they currently live in
PublisherConfig.extra; consider promoting to managed fields). - Call it from
RSConnectExecutorafterwait_for_taskcompletes, gated to
Connect/SPCS (same gate as_save_publisher_metadata), best-effort (warn,
don't fail the deploy — the bundle already deployed).
Validation / edge cases (mirror Publisher's preflight):
- Runtime settings are invalid on
staticcontent → skip/warn. - Validate
min_processes <= max_processes; clamp/validate*_request <= *_limit;
respect serverscheduler.*_limitmaxima where discoverable. run_as/service_account_namerequire admin;run_as_current_userand
Kubernetes require server license/config — surface a clear warning when the
server rejects, rather than aborting.secrets: follow Publisher's model (see the env-var section above) — names live
in the TOML, values are sourced ad hoc at run time ($NAME/--secret NAME=VALUE), never persisted; unset names are skipped, not sent empty; supplied
values are set flagged as secret and overrideenvironmenton key collision.- No-op cleanly when the config declares none of these fields.
Part 2 — rsconnect sync command
Goal: apply the TOML config's Connect-side settings to already-deployed content
ad hoc, without rebuilding or redeploying a bundle. This is the "I edited the
config, push the settings to Connect" path.
Behavior:
rsconnect sync [PATH]—PATHdefaults to the current directory, like
redeploy.- Resolves the applicable
.posit/publishconfig (single,--config-name, or
entrypoint match) and the target content GUID from the matching deployment
record. - Server targeting: accept
--server/--name/--api-key; when none are
given, default to the server in the config / deployment record, resolving a
saved rsconnect-python credential by normalized URL (reuse
_find_saved_server_by_url, asredeploydoes). - Applies exactly the Part 1 post-deploy hook logic against the resolved content —
no bundle build, no upload, no new deployment record (though it may refresh
the record's timestamp/settings snapshot; TBD). - Errors clearly if there is no deployment record (nothing to sync to) and no
destination was supplied.
Shared code: Part 1 and Part 2 must call the same
config→(content-settings + env-vars)→API applier so behavior can't drift.
Acceptance criteria
- A config's
description,connect.runtime.*,connect.access.*, and
connect.kubernetes.*are applied to the content on deploy/redeploy
(Connect/SPCS only), best-effort. - A config's
environmentis applied as env vars on deploy/redeploy. -
secretsfollow Publisher's model: names only in the TOML; values sourced ad
hoc ($NAME/--secret NAME=VALUE), never persisted; unset names skipped;
supplied values set flagged as secret and overridingenvironmenton
collision. -
rsconnect sync [PATH]applies the same settings ad hoc to already-deployed
content, with no bundle rebuild. -
synctargets the config/record server by default and honors
--server/--name/--api-keyoverrides. - Server-side validation failures (limits, licensing, admin-only) warn clearly
without corrupting the deploy. - Tests cover the config→payload mapping, the deploy hook, and
sync
(including default vs. explicit server targeting). - CHANGELOG updated.
References
- PR: #830
- Publisher config→content-settings:
extensions/vscode/src/bundler/connectContentFromConfig.ts - Publisher env-var merge:
extensions/vscode/src/publish/publishShared.ts(mergeEnvVars) - Publisher secrets model (names in config, values in-memory per session, not persisted):
extensions/vscode/webviews/homeView/src/stores/home.ts(in-memorysecretsmap, reloaded with empty values),extensions/vscode/src/views/homeView.ts - Publisher publish sequence + preflight validation:
extensions/vscode/src/publish/connectPublish.ts - Already-implemented manifest side (integration_requests):
rsconnect/bundle.py(overlay_manifest),rsconnect/publisher/store.py(config_manifest_overlay)
- 主要言語
- Python
- スター
- 38
- フォーク
- 28
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 59
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
posit-dev/rsconnect-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
posit-dev/rsconnect-python#998 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
posit-dev/rsconnect-python#786 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
posit-dev/rsconnect-python#543 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Write no installer preference for uv.lock bundles対応中かも @tdstein が 2 日前に担当しました。 オープンenhancement ready-for-agent
posit-dev/rsconnect-python#996 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Evaluate Python dependency source precedence対応中かも @tdstein が 13 日前に担当しました。 オープンenhancement ready-for-agent
難易度 4/5 1〜2日 初心者へのやさしさ 52/100
posit-dev/rsconnect-python#975 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
posit-dev/rsconnect-python の issue をすべて見る
似ている issue
-
Task select patterns with uppercase letters never match対応中かも @manobhisriram が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
app: scripts status: backlog type: housekeeping
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
netbox-community/netbox-scripts#239 ·
メンテナーはふだん 1 日以内に返信
-
Lambda deploys fail once the bundle grows by about 254 KB対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
developmentseed/titiler-cmr#341 ·
メンテナーはふだん 1 日以内に返信
-
Card tables add "..." to every value in a DataFrame column when any value is longer than 30 characters対応中かも @omkarbandikatte が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信