Skip to content

Conversation

@nealrichardson
Copy link
Contributor

Intent

Following #731, I saw some more that could be removed and thought I'd push forward. Removed here:

  • applications/:id/config: the server just appends things to the dashboard_url on the content record, we can do that here too.
  • applications/search: the only place this was actually used was to detect name collisions. Swapped to use the v1/content?name= query, which has been around much longer than the v1/search/content endpoint, and actually suits this use case better anyway.

If we remove support for numeric app ids in the CLI, we can remove applications/:id too. I left a comment about deprecating that. For now, it is encapsulated in only one calling site.

Approach

Claude-assisted refactoring. Stopped a few times to do some GitHub code search to confirm that functions were unused outside of the package and could be safely removed.

Automated Tests

This seems to be covered by some tests. I can run the full integration tests with latest Connect too. It would be ideal to have a short test suite that can run across historical versions using with-connect, as discussed in #649.

Checklist

  • I have updated CHANGELOG.md to cover notable changes.
  • I have updated all related GitHub issues to reflect their current state.
  • I have run the rsconnect-python-tests-at-night workflow in Connect against this feature branch.

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

PR Preview Action v1.6.3
Preview removed because the pull request was closed.
2025-12-03 20:49 UTC

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
5188 3954 76% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/api.py 78% 🟢
rsconnect/models.py 92% 🟢
TOTAL 85% 🟢

updated for commit: c9acc8e by action🐍


# If name exists, append suffix and try again
if len(results) > 0:
suffix = 1
Copy link
Collaborator

@amol- amol- Dec 2, 2025

Choose a reason for hiding this comment

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

I suggest we consider using a short hash for the suffix instead of an incremental number.
As there is no locking involved appending an incremental is still subject to two people getting the same unique name if they are deploying together.
An hash wouldn't absolutely prevent that, but the chances for a collision are greatly reduced.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is existing behavior, I wasn't trying to change it here. I can make an issue about changing it in a followup, if you'd like.

I agree that a hash would be more robust, but I'm not sure it matters actually. I saw this in the API docs:

Note: content names are unique within the owning user's account, so a request that specifies a non-empty name and owner_guid will return at most one content item.

So you would only run the risk of collision with this method if you were concurrently using the same user's credentials trying to create multiple items with the same name. And worst case, IIUC, if two concurrent jobs with the same user's credentials picked the same unique name, one of them would be rejected by the server.

@nealrichardson nealrichardson merged commit 8f9e8cb into main Dec 3, 2025
13 checks passed
@nealrichardson nealrichardson deleted the more-rm-v0-apis branch December 3, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants