Skip to content

Conversation

@sunshowers
Copy link
Contributor

@sunshowers sunshowers commented Jul 16, 2025

There are no major code changes in this PR -- it's pure movement + replacing println! calls with writeln!.

There's one minor change, which is that the warning about errors now goes to stdout. I think it's okay.

Tests are coming in the next PR as part of adding support to reconfigurator-cli.

Part of #8611.

Created using spr 1.3.6-beta.1
Comment on lines 111 to 116
if self.include_sleds {
display_sleds(&self.collection, f)?;
}
if self.include_orphaned_datasets {
display_orphaned_datasets(&self.collection, f)?;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a behavior change we don't want? The old code was:

    if filter.include_sleds() {
        inv_collection_print_sleds(&collection);
    } else if matches!(filter, CollectionsShowFilter::OrphanedDatasets) {
        inv_collection_print_orphaned_datasets(&collection);
    }

If we print sleds, that already includes the orphaned datasets for each sled. CollectionsShowFilter::OrphanedDatasets was a way to say "I only want to see the orphaned datasets from each sled, not all the other details", because we want to be able to do this during the R16 upgrade as a check for any unexpected orphans without all the noise of the normal sled details.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh gotcha, will update and explain in a comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Created using spr 1.3.6-beta.1

fn include_orphaned_datasets(&self) -> bool {
match self {
Self::All => true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be false? Although I think it maybe doesn't matter in practice thanks to the else if?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I tried first, and I thought it was more confusing for "All" to return false here than for us to use else. Logically we are including orphaned datasets, it's just part of the sled config.

@sunshowers sunshowers enabled auto-merge (squash) July 17, 2025 18:45
@sunshowers sunshowers merged commit 01f14b6 into main Jul 17, 2025
17 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/30n-omdb-move-inventory-collection-display-to-nexus-types branch July 17, 2025 20:34
sunshowers added a commit that referenced this pull request Jul 18, 2025
Use the display logic implemented in #8613 to show inventory collections
in reconfigurator-cli.

I had to change some of the timestamps to be in RFC 3339 format to allow
redactions to work properly.

Kind of addresses #8611, in the sense that we now have tests that render
collection output and ensure it looks reasonable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants