oxidecomputer / oxidecomputer/omicron

Change the `version` field in artifacts.json to semver

Open
#1,992 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

We know we're going to probably want something a little more descriptive than an incrementing integer in artifacts.json, and now is the best time to make that change rather than while we have an existing updates repo.

Here is the struct we use to parse artifacts.json:

https://github.com/oxidecomputer/omicron/blob/d8ce624cbe94e88a37bd3a5a87c422acd708afe3/nexus/src/updates.rs#L16-L26

This version field should probably be a String or Option<semver::Version>, to prevent parsing problems from breaking the entire artifact.json being deserialized (for the same reason that kind here is in an Option); the idea is that we should skip over artifacts we don't know how to reason about, because perhaps a future version of Nexus might be able to reason about them.

Here is the struct we use when Nexus tells Sled Agent to apply an update, confusingly named the same thing:

https://github.com/oxidecomputer/omicron/blob/d8ce624cbe94e88a37bd3a5a87c422acd708afe3/common/src/api/internal/nexus.rs#L80-L86

This can be more rigid since, for now, Nexus and Sled Agent are going to be built from the same omicron-common crate and agree on what the data should look like over the wire.

Contributor guide

Open the contributing guide

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.

Research direction

Start with the artifact parsing struct in nexus/src/updates.rs and the update struct in common/src/api/internal/nexus.rs, following how each version field is deserialized and sent over the wire. Decide how unknown or invalid artifact versions are skipped while preserving the stricter Nexus-to-Sled Agent representation; done means both structs use the intended semver-compatible behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.