oxidecomputer / oxidecomputer/propolis

structured error codes should be in `propolis-client`

Open
#775 0 comments 0 reactions 1 assignee View on GitHub

@hawkw is already working on this.

Since Oct 1, 2024.

api enhancement server
Dominant language
Rust
Stars
270
Forks
42
Avg merge
4d 5h
Merged PRs (30d)
6

Description

Currently, propolis-server's API returns structured error codes for certain error conditions:
https://github.com/oxidecomputer/propolis/blob/f255595c642967c0d399baca73cc20b1e9b20f75/crates/propolis-api-types/src/lib.rs#L443-L485

These are parsed by sled-agent and used to detect particular error conditions, such as the propolis-server believing that an instance-ensure request has never been received. At present, the enum representing these error codes is defined in the propolis-api-types crate, which requires that sled-agent depend on it. The propolis-api-types dependency is not otherwise needed by sled-agent. It would be much nicer if sled-agent could get the definition of the error code values from its propolis-client dependency, instead. Ideally, these would be part of the OpenAPI document and generated by Progenitor when building the client, as discussed in https://github.com/oxidecomputer/omicron/pull/6726#discussion_r1781838972

Ideally, we would be able to define the error codes returned by these APIs as part of the Dropshot server and have them be included in the OpenAPI spec without requiring us to patch the document to include them. See oxidecomputer/dropshot#39 and oxidecomputer/dropshot#41 for related issues.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.