Skip to content

Conversation

@mslynch
Copy link
Member

@mslynch mslynch commented Apr 11, 2023

Resolves #356.

Intent

This change adds support for specifying a --visibility flag to shinyapps.io deploys. Visibility can be public or private.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change

Approach

If the deploy creates a new application and --visibility is provided, the visibility is set. If we're updating an existing application and --visibility is provided, we get the existing visibility, compare it to the provided visibility, and update it if the values differ.

Automated Tests

Updated the automated tests to pass --visibility and added/updated HTTP mocks to match the change in API calls.

Directions for Reviewers

Important cases to test are:

  • new deploy on shinyapps.io with --visibility
  • redeploy on shinyapps.io with --visibility

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 Apr 11, 2023

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
4191 2656 63% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/api.py 66% 🟢
rsconnect/main.py 54% 🟢
TOTAL 60% 🟢

updated for commit: 790f3c4 by action🐍

@mslynch mslynch marked this pull request as ready for review April 11, 2023 17:03
@mslynch mslynch requested review from bcwu, mbaynton and omar-rs April 11, 2023 17:03
@mslynch mslynch requested a review from scubastevew June 5, 2023 17:48
@mslynch
Copy link
Member Author

mslynch commented Jun 5, 2023

@scubastevew Take a look at this change when you get a chance.

@scubastevew
Copy link

scubastevew commented Jun 7, 2023

Tested:

  • deploying to shinyapps.io with no flag -> defaults to public
  • deploying to shinyapps.io with with visibility public -> sets application to public
  • deploying to shinyapps.io with with visibility private -> sets application to private
  • updating a public application on shinyapps.io with with visibility private -> sets application to private
  • updating a private application on shinyapps.io with with visibility public -> sets application to public

@mslynch mslynch requested review from mmarchetti and removed request for bcwu June 16, 2023 19:16
if visibility != application["deployment"]["properties"]["application.visibility"]:
self._rstudio_client.update_application_property(
application["id"], "application.visibility", visibility
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to call handle_bad_response?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes :) thanks for catching that.

@mslynch mslynch merged commit 70c23c0 into master Jun 20, 2023
@mslynch mslynch deleted the cloud-shinyapps-visibility branch June 20, 2023 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add visibility flag for deploying to shinyapps/cloud

6 participants