oxidecomputer / oxidecomputer/omicron
Be more consistent with `ZoneKind` -> string methods
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_prefixuses underscores. These strings are used by sled-agent both to name zones and to find the{zone_prefix}.tar.gzfilenames in the install dataset.service_prefixis almost the same, except crucible pantry iscrucible/pantryinstead ofcrucible_pantry(presumably due to SMF namespace organization?)name_prefixiszone_prefixwith all the underscores swapped to dashesreport_striszone_prefixexcept it has separateboundary_ntpandinternal_ntpvalues, instead of usingntpfor bothartifact_namematches theArtifactId::namevalues from the unpacked composite control plane artifact in a TUF repo. These come from theoxide.json'spkgvalue 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-zonesuffix)
Can we collapse some of these (with work to make the users of them use more consistent names)?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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