Conversation
|
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
| set_verbosity(verbose) | ||
| output_params(ctx, locals().items()) | ||
|
|
||
| if not server and not any([token, secret, account]): |
There was a problem hiding this comment.
Does this belong inside validate_connection_options (below)?
There was a problem hiding this comment.
it probably could, but it would require a decent amount of additional complexity because validate_connection_options is used across commands. We can't just blindly reject name only inputs in it because commands like rsconnect deploy -n my-server are perfectly valid.
There was a problem hiding this comment.
Oh, that's sad. Ok.
There was a problem hiding this comment.
Too much sadness in this pull request.
|
|
||
| def test_add_name_only_missing_server_and_credentials(self): | ||
| """Regression test: `rsconnect add -n x` should produce a validation error, not a TypeError.""" | ||
| original_api_key_value = os.environ.pop("CONNECT_API_KEY", None) |
There was a problem hiding this comment.
It makes me sad that you have to do this env management in every test manually.
|
That test failure is weird (and surely unrelated?). I was seeing it in #742 as well (which made slightly more sense), but it makes me wonder if it's really saying that something is wrong, not that literally the model isn't right or whatever. |
|
claude is recommending a package pin as a temporary fix. I'm going to try that before diving further into this update: hmm that passed. maybe we just stumbled upon an issue with vetiver and pydantic>=2? |
|
filed: rstudio/vetiver-python#241 |
Intent
Running
rsconnect addwith insufficient inputs (in this case only specifying the name) should result in a clearRSConnectExceptionfixes: #757
Type of Change
Approach
The add command supports three credential pathways, each requiring a different set of options:
Adds an early check at the top of the add command. It raises an
RSConnectExceptionwith a clear message if neither --server nor any of the shinyapps.io options are provided, before any downstream code can encounter None valuesNote: click resolves env vars before calling the function, so this won't screw us up in cases where things are being specified as env vars instead of inputs
Automated Tests
Added a unit test
test_add_name_only_missing_server_and_credentialsNew behavior
Checklist
rsconnect-python-tests-at-nightworkflow in Connect against this feature branch.