Skip to content

Require GUIDs for Connect content; add --guid to deploy and preflight - #915

Open
nealrichardson wants to merge 3 commits into
mainfrom
npr-881
Open

nealrichardson wants to merge 3 commits into
mainfrom
npr-881

Conversation

@nealrichardson

Copy link
Copy Markdown
Contributor

Remove the legacy numeric content ID path (app_get, get_content_by_id, ContentItemV0) and use content_get directly. An explicit --app-id for a Connect target must be a content GUID.

Add --guid to the deploy commands and preflight as the Connect-specific way to target existing content. It conflicts with --app-id and --new, and is rejected for Connect Cloud and shinyapps.io targets.

Fixes #881
Fixes #885

🤖 Generated with Claude Code

Remove the legacy numeric content ID path (app_get, get_content_by_id,
ContentItemV0) and use content_get directly. An explicit --app-id for a
Connect target must be a content GUID.

Add --guid to the deploy commands and preflight as the Connect-specific
way to target existing content. It conflicts with --app-id and --new, and
is rejected for Connect Cloud and shinyapps.io targets.

Fixes #881
Fixes #885

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://posit-dev.github.io/rsconnect-python/pr-preview/pr-915/

Built to branch gh-pages at 2026-11-04 23:55 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@nealrichardson
nealrichardson marked this pull request as draft November 2, 2026 22:16
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
10998 9705 88% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/api.py 90% 🟢
rsconnect/main.py 86% 🟢
rsconnect/models.py 93% 🟢
rsconnect/preflight.py 87% 🟢
rsconnect/preflight_node.py 91% 🟢
TOTAL 89% 🟢

updated for commit: 4474bce by action🐍

Comment thread rsconnect/api.py Resolved
nealrichardson and others added 2 commits November 4, 2026 18:52
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ound

The GUID may come from --guid or --app-id, and --new cannot be combined
with either, so suggest omitting the ID instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nealrichardson
nealrichardson marked this pull request as ready for review November 4, 2026 23:55

@joshyam-k joshyam-k left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this all makes sense to me. only consideration that comes to mind is what kind of a version bump we should go with in the release given that this is a breaking change. It's not a huge change and there are instructions for what to do differently, but this will break scripts that rely on the prior behavior.

@mconflitti-pbc mconflitti-pbc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

Two minor things to consider:

  1. Numeric IDs from saved deployment records skip the GUID check. validate_explicit_app_id() checks only an explicit --app-id or --guid. In validate_app_mode(), an app_id that comes from app_store.resolve() gets no check. If an old deployment record has only a numeric app_id and no app_guid, a redeploy with no --app-id calls content_get("1234"). That call fails with a 404 and a "try --new" hint, but this path works on main today. You could apply the same GUID check to IDs from the record for Connect, with an error that names --guid or --new. Or you could note this case in the CHANGELOG. Records like this might not exist in practice.

  2. The SPCS --app-id behavior changes, but the CHANGELOG and tests do not show it. On main, SPCS with --app-id fails with "Unable to infer Connect client." because the isinstance check in validate_app_mode() does not include SPCSConnectServer. This PR fixes that path. A CHANGELOG line and a test would make the fix visible.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants