oxidecomputer / oxidecomputer/omicron

Be more consistent with `ZoneKind` -> string methods

Open
#8,510 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

ZoneKind currently has five different methods converting &self to &'static str, each of which is slightly different and is used in different contexts. This is confusing at best. Some examples of differences:

  • zone_prefix uses underscores. These strings are used by sled-agent both to name zones and to find the {zone_prefix}.tar.gz filenames in the install dataset.
  • service_prefix is almost the same, except crucible pantry is crucible/pantry instead of crucible_pantry (presumably due to SMF namespace organization?)
  • name_prefix is zone_prefix with all the underscores swapped to dashes
  • report_str is zone_prefix except it has separate boundary_ntp and internal_ntp values, instead of using ntp for both
  • artifact_name matches the ArtifactId::name values from the unpacked composite control plane artifact in a TUF repo. These come from the oxide.json's pkg value inside each zone's tarball, and are an eclectic bunch that don't map neatly to the other methods (some use underscores, some use dashes, and some append a -zone suffix)

Can we collapse some of these (with work to make the users of them use more consistent names)?

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

Locate the ZoneKind conversion methods named zone_prefix, service_prefix, name_prefix, report_str, and artifact_name, then inspect their call sites and the related artifact and zone naming constraints. Done means identifying which methods can be consolidated and updating their users to use consistent names without breaking sled-agent, SMF organization, reporting, or artifact lookup.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.