-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verify location before addition #188
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #188 +/- ##
==========================================
- Coverage 99.89% 99.45% -0.44%
==========================================
Files 40 41 +1
Lines 3746 3680 -66
==========================================
- Hits 3742 3660 -82
- Misses 4 20 +16 ☔ View full report in Codecov by Sentry. |
f8a39a5
to
e26864e
Compare
That coverage report from codecov is out of date and not being updated for its own mysterious reasons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, especially since it means it will perform and cache authentication when adding the location, not randomly later on.
I would expect this to do a bit more than just calling authorize()
. If you hit the root of the API there's a basic JSON document:
dput(orderly_location_packit("https://packit.dide.ic.ac.uk/reside/")$client$request("/"))
#> list(status = "success", data = list(schema_version = "0.1.1"), errors = NULL)
Checking the status is good enough. This should work on both packit and outpack_server.
For a path location it should retain the existing root_open
behaviour.
if (type == "path") { | ||
assert_scalar_character(args$path, name = "path") | ||
root_open(args$path, require_orderly = FALSE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell this means there's no more validation of path locations, since the location_path class does not have an authorize
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there was, but it was not at all obvious. I've added a verify
method which makes this much less weird, though we'll need to add that to the other location types (e.g., ssh) soon too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hit the wrong radio button
Merge after #185, contains those commits.
This PR adds new arguments
verify
andquiet
toorderly_location_add
:verify
will try and connect to the location before addition, erroring (and therefore making no changes) if it is misconfiguredquiet
uses the same approach as Make pulling metadata more chatty #185 for controlling how chatty we are while we do thisThis PR also fixes a small logic error in
save_token
where we say "Defaults toTRUE
ifNULL
" - this looks to have been lost at some point and it remains asNULL
until referenced withinif ()
at which point we threw an error. Now set setsave_token
to the value ofis.null(token)