oxidecomputer / oxidecomputer/omicron
want `omdb db sitrep list`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
Presently, the only way to list sitreps is using the omdb db sitrep history command, which gives you a table of sitreps that are part of the fm_sitrep_history table, ordered by versions. This is, of course, very useful for looking at the sitrep history, which is useful for debugging the operation of diagnosis engines, or for trying to use the fault management system's history to diagnose a problem. However, there are some situations where it is also desirable to be able to list sitreps which are not part of the history, either because they are orphans that were never committed, or because they were pruned from the end of the history after #9384 is implemented. This may be necessary for debugging the garbage collection of orphaned and abandoned sitreps.
We should probably add an omdb command that can list all sitreps, whether or not they are committed. It would be especially nice if this command had options like:
--orphaned: show only orphaned sitreps that are not part of the sitrep history (it might be nice if this was a bool, for combination with other filters)--creator-id: show only sitreps that were created by a particular Nexus ID (or list of Nexus IDs)--before/--after: filter by time ranges
This probably belongs in its own thing separate from omdb db sitrep history. While we could, theoretically, reimplement omdb db sitrep history using a sitrep list command, provided that it has a combination of flags that allow you to say "filter only non-orphaned sitreps and order by version", I think that having a single command that just does that is still better, as it's one of the more common operations you'll probably want to do.
We will want to either be careful implementing the queries for this command to ensure that they don't do full table scans (which probably means adding them to nexus-db-queries so they can be tested outside of omdb), or allow full scans while doing these queries.
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
Start with the existing omdb db sitrep history command and inspect the nexus-db-queries area mentioned in the issue. Trace how sitrep history is queried, then define the all-sitrep filters for orphan status, creator IDs, and time ranges; done means the new command lists committed and uncommitted sitreps without unintended full table scans.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100