Skip to content

Conversation

@mslynch
Copy link
Member

@mslynch mslynch commented May 3, 2023

Intent

Adds support for deploy html and deploy manifest to deploy to Posit Cloud.

Resolves #420.

This includes the changes from https://github.com/mslynch/rsconnect-python/pull/1, plus versioned app store files and more tests.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change

Approach

Allows for static content to be deployed to Posit Cloud.

This PR also introduces file versioning to the app store files with an initial version of 1. For cloud deployments, app_id will now store the content id (as in https://posit.cloud/content/{content_id} (as opposed to the previous approach of storing the application id).

Also contains a refactor to Cloud's HTTP client to handle errors within the client and return the parsed response body from its calls.

Automated Tests

Added a test with rsconnect deploy manifest using a manifest for a static-appmode application. Also added several unit tests for CloudService.prepare_deploy to test deploy/redeploy/pre-versioned app store files.

Directions for Reviewers

To test this manually, you can use:

rsconnect deploy html \
          --account $YOUR_ACCOUNT \
          --token $YOUR_TOKEN \
          --secret $YOUR_SECRET \
          --server 'https://api.staging.posit.cloud' \
          'some_file.html'

To test compatibility with pre-versioned app store files,

  • do a deploy on the current version:
    rsconnect deploy shiny \
              --account $YOUR_ACCOUNT \
              --token $YOUR_TOKEN \
              --secret $YOUR_SECRET \
              --server 'https://api.staging.posit.cloud' \
              'my-shiny-app'
  • then check out main, reinstall, and run the command again.

Checklist

  • I have updated CHANGELOG.md to cover notable changes.
  • I have updated all related GitHub issues to reflect their current state.

@github-actions
Copy link

github-actions bot commented May 3, 2023

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
4196 2649 63% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/actions.py 35% 🟢
rsconnect/api.py 65% 🟢
rsconnect/main.py 53% 🟢
rsconnect/metadata.py 80% 🟢
TOTAL 58% 🟢

updated for commit: 1d2f973 by action🐍

@mslynch mslynch marked this pull request as ready for review May 4, 2023 15:20
@mslynch mslynch requested review from bcwu and omar-rs May 4, 2023 15:20
@mslynch
Copy link
Member Author

mslynch commented May 4, 2023

Closed https://github.com/mslynch/rsconnect-python/pull/1 in favor of this PR because all the tests are able to pass here.

import sys
import io
from rsconnect.exception import RSConnectException
from rsconnect.metadata import CURRENT_APP_STORE_VERSION
Copy link
Contributor

Choose a reason for hiding this comment

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

The testing strategy might be better if we have a scaffold of tests for each version. That way we can just add new tests when version advances instead of needing to modify or delete existing test. We also want to have tests for older versions.

@mslynch mslynch merged commit 6edf6ec into master May 9, 2023
@mslynch mslynch deleted the cloud-static-outputs branch May 9, 2023 19:27
@bcwu bcwu mentioned this pull request May 11, 2023
5 tasks
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.

Add support for deploying static content to Posit Cloud

4 participants