Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 28, 2022

Bumps dropshot from b562f4f to fef3a0e.

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

dependabot bot and others added 2 commits February 28, 2022 00:19
Bumps [dropshot](https://github.com/oxidecomputer/dropshot) from `b562f4f` to `0018f66`.
- [Release notes](https://github.com/oxidecomputer/dropshot/releases)
- [Commits](oxidecomputer/dropshot@b562f4f...0018f66)

---
updated-dependencies:
- dependency-name: dropshot
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Feb 28, 2022
@dependabot dependabot bot assigned ahl Feb 28, 2022
@dependabot dependabot bot force-pushed the dependabot/cargo/dropshot-fef3a0e branch from b7a6552 to 4bf75e2 Compare March 1, 2022 04:49
Bumps [dropshot](https://github.com/oxidecomputer/dropshot) from `b562f4f` to `fef3a0e`.
- [Release notes](https://github.com/oxidecomputer/dropshot/releases)
- [Commits](oxidecomputer/dropshot@b562f4f...fef3a0e)

---
updated-dependencies:
- dependency-name: dropshot
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/cargo/dropshot-fef3a0e branch from 4bf75e2 to f0bcf64 Compare March 2, 2022 17:26
@ahl ahl requested a review from davepacheco March 2, 2022 22:41
Copy link
Collaborator

@davepacheco davepacheco left a comment

Choose a reason for hiding this comment

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

Nothing major here but a few small suggestions. This is neat! I really like the way progenitor splits out the error cases, of which getting an explicit error HTTP response is only one.

let id = RegionId(region.id().to_string());
client.region_delete(&id).await
client.region_delete(&id).await.map_err(|_| {
// TODO we may want to more carefully consider errors from
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we keep at least the message from the underlying error so that if we see this in the field we'll know what it was?

Copy link
Contributor

Choose a reason for hiding this comment

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

can do

if rv.status().is_client_error() {
Error::invalid_request(&message)
} else {
Error::internal_error(&message)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Discussed offline: I think a 503 here should still be a 503 out the front door.

I understand if we don't want to bother being too pedantic here, but there are some other cases that probably shouldn't go straight out: 401 and 403, for example. It might be safer to have an allow-list of codes that we pass through (maybe: 400, 404, 409, 422, 503) and make everything else a 500?

Copy link
Contributor

Choose a reason for hiding this comment

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

With regard to the allow list: 1. I like it 2. it seems challenging to do robustly without some additional facilities from dropshot. For example, consider a 404 not found:

In the Error type it's represented like this:

ObjectNotFound { type_name: ResourceType, lookup_type: LookupType },

What we get from the progenitor/dropshot call is (effectively) a dropshot::HttpError which has a message field that was populated like this:

                let message = format!(
                    "not found: {} with {} \"{}\"",
                    t, lookup_field, lookup_value
                );
                HttpError::for_client_error(
                    Some(String::from("ObjectNotFound")),
                    http::StatusCode::NOT_FOUND,
                    message,
                )

So: in this impl From<progenitor::progenitor_client::Error<T>> for Error if we were to see that the status was 404 we would need to parse out the message field into the components for the ObjectNotFound variant. That seems both flaky for services within the nexus repo and completely untenable for external services such as crucible which e.g. populates the message field differently:

    Err(HttpError::for_not_found(
        None,
        format!("region {:?} snapshot {:?} not found", p.id, p.name),
    ))

All of this is to say that I agree that maintaining structured errors across service boundaries seems useful and I think we need some more infrastructure to build that robustly.

ahl and others added 3 commits March 4, 2022 14:34
Co-authored-by: David Pacheco <dap@oxidecomputer.com>
Co-authored-by: David Pacheco <dap@oxidecomputer.com>
Co-authored-by: David Pacheco <dap@oxidecomputer.com>
@ahl ahl enabled auto-merge (squash) March 5, 2022 16:12
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Mar 7, 2022

A newer version of dropshot exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

@ahl ahl merged commit 3847095 into main Mar 7, 2022
@ahl ahl deleted the dependabot/cargo/dropshot-fef3a0e branch March 7, 2022 22:42
smklein added a commit that referenced this pull request Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants