Skip to content

[nexus] fix up some uses of blueprints that were using the Debug impl#5413

Merged
sunshowers merged 4 commits into
mainfrom
sunshowers/spr/nexus-fix-up-some-uses-of-blueprints-that-were-using-the-debug-impl
Apr 5, 2024
Merged

[nexus] fix up some uses of blueprints that were using the Debug impl#5413
sunshowers merged 4 commits into
mainfrom
sunshowers/spr/nexus-fix-up-some-uses-of-blueprints-that-were-using-the-debug-impl

Conversation

@sunshowers

@sunshowers sunshowers commented Apr 4, 2024

Copy link
Copy Markdown
Contributor

Before we added the display() method, the way to get nicely formatted
blueprints was to use the Debug impl. While working on #5211, I noticed that
these callers were still using the old way to do things. Fix this up.

I tested this by making the Debug impl for Blueprint panic, then saw which
tests failed.

I also realized that we didn't have tests for omdb's blueprints. I believe at
the time it wasn't possible to write a test for this because we didn't have an
initial blueprint -- but now we do, so include a test.

(I also wanted to ensure that the actual blueprint ID was what we expected, so
I expanded the scope of redact_variable a bit. Introduce ExtraRedactions
so we can handle both fixed- and variable-length redactions, and use the same
logic for UUIDs.)

Created using spr 1.3.6-beta.1
@sunshowers

Copy link
Copy Markdown
Contributor Author

On second thought, maybe just the slice of pairs is okay. Happy to make that change if you think it makes sense.

Comment thread dev-tools/omdb/src/bin/omdb/nexus.rs
Comment thread dev-tools/omdb/tests/successes.out Outdated
Comment thread test-utils/src/dev/test_cmds.rs
@sunshowers

sunshowers commented Apr 4, 2024

Copy link
Copy Markdown
Contributor Author

Oh interesting... it looks like CI is failing because the length of the tmp path is different (which of course it is.) So we probably need to have two different constructors, one for fixed-length strings and one for variable-length strings. (And this justifies ExtraRedactions, a bit hard to do with just a slice of pairs!)

Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
@sunshowers sunshowers enabled auto-merge (squash) April 4, 2024 23:23
@sunshowers sunshowers merged commit d7d70d8 into main Apr 5, 2024
@sunshowers sunshowers deleted the sunshowers/spr/nexus-fix-up-some-uses-of-blueprints-that-were-using-the-debug-impl branch April 5, 2024 00:55
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.

2 participants