Repository navigation
FEAT: List the saved registry entries that couldn't be restored (part 5) #3965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
varunj-msft
wants to merge
172
commits into
microsoft:main
Choose a base branch
from
varunj-msft:varunj-msft/13178-Retry-Restore
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,209
−296
Open
Changes from all commits
Commits
Show all changes
172 commits
Select commit
Hold shift + click to select a range
f36db28
FIX: Reject path parameters by default when building components from …
varunj-msft 291c462
Leave out target types that require a path callers may not set
varunj-msft 797831b
Test a target whose required path is the server upload folder
varunj-msft 214a0fa
Merge origin/main
varunj-msft 521ec7e
TEST: Cover saved converter copies in the server path check
varunj-msft 66fd155
FEAT: Report the documents a storage listing cannot use
varunj-msft 2d8c465
Report non-files and missing containers instead of skipping them
varunj-msft 5dec828
Report an entry that can't be checked instead of failing the whole li…
varunj-msft bf662b7
FEAT: Read saved registry recipes
varunj-msft e8b0604
Merge the server path check for API input
varunj-msft 9143ea6
FEAT: Rebuild saved registry entries in dependency order
varunj-msft c29d812
FEAT: Restore saved registry entries and stay not ready if any fail
varunj-msft cfa4fc0
Limit technique descriptions like the create request and export the r…
varunj-msft 33735f1
Merge the recipe model limits and exports
varunj-msft 11d0519
Keep restore failure messages safe and complete, and check technique …
varunj-msft 8ab7116
Merge the restore message and credential fixes
varunj-msft b7bf012
Document the recipes setting in the example config and pin the restor…
varunj-msft e45865b
Test that a description at the limit is accepted
varunj-msft b6927a9
Merge the description limit test
varunj-msft c94ffbd
Show only the error type when a URL in it may carry credentials
varunj-msft ac849a9
Merge the safer failure messages
varunj-msft 26377ea
Point the restore message at where failures are listed and guard the …
varunj-msft 8663852
Cut failure messages at any URL query or fragment and hide any with u…
varunj-msft 4159905
Merge the stricter failure messages
varunj-msft 9a419b4
Escape text that isn't UTF-8 in restore reports so they can be sent a…
varunj-msft 8fb8095
Merge the report text escaping
varunj-msft 9a67367
Read error text as plain normalized text and say when part of it is h…
varunj-msft 82c957f
Merge the plain, normalized failure text
varunj-msft 274b4ce
Escape entry names in restore reports too
varunj-msft 95f9492
Merge the entry name escaping
varunj-msft a60323a
Show error text with its original characters
varunj-msft e7558a4
Test that a reference name that isn't valid text can still be reported
varunj-msft 0e8490c
Merge the original-character error text and escaped entry names
varunj-msft 686d475
Test that the runtime status can report a reference name that isn't v…
varunj-msft c391b0d
Escape report text only when it is sent as JSON
varunj-msft 0b44db6
Merge the JSON-only report escaping
varunj-msft f986da5
Check each character on its own so long error messages stay fast
varunj-msft 807a904
Merge the per-character check and JSON-only report escaping
varunj-msft c86bfe6
Check the exact message for every form of each mark and bound the wor…
varunj-msft 454d05b
Merge the exact look-alike message checks
varunj-msft 9f91282
Test that the runtime status can list a file name that isn't valid text
varunj-msft a455494
Pass the look-alike check's arguments by keyword
varunj-msft ce8b684
Test that a technique waits for a saved converter in either list and …
varunj-msft d48a12c
Merge the converter-list and attack-type tests
varunj-msft 74412fe
Test that restore runs after the startup scripts, at startup and on a…
varunj-msft 784cd45
Keep the offline browser fixture away from saved registry entries
varunj-msft 507567b
Check the opened file before reading it and skip links deleted since …
varunj-msft 9d37ba3
Merge the opened-file check
varunj-msft ff2c836
Merge the opened-file check
varunj-msft 3afdcaa
Merge origin/main
varunj-msft de2f4e3
Let restore set the path parameters a target lets callers set, as the…
varunj-msft e821e7e
Merge the opened-file check, main and the caller path parameters
varunj-msft a45ac23
Close a file that isn't regular before reporting it and report entrie…
varunj-msft 60477e8
Merge the file handle fix
varunj-msft 28f2262
Merge the file handle fix
varunj-msft ad21f0c
Give only targets the path parameters their class lets callers set
varunj-msft 3dc4768
Merge the file handle fix and the target-only caller paths
varunj-msft db245dc
Test a file replaced just before it's opened and stop a blocked read …
varunj-msft 5d3d2d0
Merge the opened-file tests
varunj-msft 07a617f
Merge the opened-file tests
varunj-msft 2b4f1cc
Merge the opened-file tests
varunj-msft 80754a2
Read saved recipes separately from building them
varunj-msft 7965020
Merge the separate recipe read
varunj-msft bd84ef0
Build restored entries on the runtime loop and read them in a worker …
varunj-msft 1a192f7
Show every signed-in user why saved registry entries couldn't be rest…
varunj-msft 4fb7f35
Retry restoring saved registry entries without a restart
varunj-msft 27ef572
Drop a late retry answer when the runtime failed again between polls
varunj-msft fa1ae56
Keep Retry in reach and say when the failure list couldn't be loaded
varunj-msft d1bdd82
List presets, suites, and initializers through the checked listing
varunj-msft f5ed760
Merge the shared document listing
varunj-msft 4b55b17
Merge the shared document listing
varunj-msft a1866d5
Merge the shared document listing
varunj-msft e8dc897
Merge the shared document listing
varunj-msft 76dbf9c
Report a preset, suite, or initializer folder that can't be read as u…
varunj-msft f823e4b
Merge the storage error mapping for unreadable folders
varunj-msft 99da684
Merge the storage error mapping for unreadable folders
varunj-msft 2c58145
Merge the storage error mapping for unreadable folders
varunj-msft 5a0afa6
Merge the storage error mapping for unreadable folders
varunj-msft 6800d15
Merge origin/main
varunj-msft 74839cd
Merge origin/main
varunj-msft 7d9ac2f
Log why storage is unavailable, without its path or URL
varunj-msft 7b5bfeb
Merge the storage error logging
varunj-msft 22806d8
Merge the storage error logging
varunj-msft 34011c9
Hide a restore message with a percent escape, which can hide a creden…
varunj-msft 8a0113f
Merge the storage error logging and the percent-escape fix
varunj-msft b85189b
Merge the storage error logging and the percent-escape fix
varunj-msft 031dc61
Merge origin/main
varunj-msft 7f8ab0d
Merge origin/main
varunj-msft 19205b1
Import the saved recipe models from their package, as main now requires
varunj-msft 0348a0b
Merge origin/main
varunj-msft bba3afd
Import from public packages, as main now requires
varunj-msft d4ccd50
Merge origin/main
varunj-msft 0e39617
Merge origin/main
varunj-msft 60d409b
Import from public packages, as main now requires
varunj-msft 622bbb8
Report storage failures with one error and answer them with 503
varunj-msft 1cae0b9
Merge the single storage error
varunj-msft eba7bf2
Escape file names once and simplify the saved recipe models
varunj-msft 9f24124
Merge the recipe model simplification
varunj-msft 2bbfc8f
Report restore bugs as build errors and log each failure once
varunj-msft 3735dbc
Merge the restore logging and build error fixes
varunj-msft ca7563d
Stay ready when a saved entry can't be restored, and hold its name
varunj-msft 8cf0c49
Merge the stay-ready restore
varunj-msft ea245b2
Drop Retry and show restore failures while the runtime is ready
varunj-msft 67416f1
Reset the registries between runtime tests, as a real startup does
varunj-msft d953906
Merge the runtime test isolation
varunj-msft 6ee84f0
Merge origin/main
varunj-msft d43a7e8
Merge origin/main
varunj-msft 0664063
Merge origin/main
varunj-msft 3b3ac59
Merge origin/main
varunj-msft ed358ba
Merge origin/main
varunj-msft 8614025
Use one recipe format version, keep the auth mode, and escape failure…
varunj-msft 5a3f18b
Merge the recipe format changes
varunj-msft b3c7847
Build restored entries with a builder the caller supplies
varunj-msft af4075f
Merge the restore builder changes
varunj-msft 061807a
Warn that writing saved entries is administrator authority, and test …
varunj-msft 773bdd2
Merge the restore builder changes
varunj-msft 428345c
Show restore failures in a compact banner inside the layout
varunj-msft 986cc90
Test the parser's depth limit without depending on the stack size
varunj-msft 1096925
Merge the parser depth test fix
varunj-msft f25b520
Merge the parser depth test fix
varunj-msft b7edc61
Merge the parser depth test fix
varunj-msft fb90af8
Read saved entries in a worker thread when restore isn't given what w…
varunj-msft c44d2ce
Merge the worker-thread read
varunj-msft abd116a
Stay not ready when a saved entry can't be restored, and let apply retry
varunj-msft f94e981
Merge the not-ready restore
varunj-msft 1fc0617
Show the restore failures while the runtime isn't ready
varunj-msft f59306e
Read saved recipes off the event loop by default, and harden URL reda…
richlundeen f1ff143
Keep an "@" in a URL's path when redacting URLs in text
richlundeen 009e761
Merge the restore read and redaction fixes
varunj-msft 94f8aa5
Merge the restore read and redaction fixes
varunj-msft 4d82205
Show the restore failures to administrators in Configuration
varunj-msft cc4ae4d
Merge main
varunj-msft 270a1f0
Merge main
varunj-msft 187191c
Answer suite readiness storage failures through the shared storage ha…
varunj-msft 3fb2e7a
Merge the readiness fix
varunj-msft 374c620
Merge main
varunj-msft 7ac059c
Answer suite readiness storage failures through the shared storage ha…
varunj-msft e08b67a
Merge main
varunj-msft 7fa4ca4
Expect storage errors from main's version-checked delete tests the wa…
varunj-msft 9bf5886
Merge main
varunj-msft 0e87a61
Merge main
varunj-msft c506195
Merge main
varunj-msft 1ba526f
Merge main
varunj-msft 9cdf7e7
Merge main
varunj-msft 40d36ed
Merge main
varunj-msft f1a2756
Merge main
varunj-msft 0e7a21f
Exempt the storage error handler from the keyword-only check
varunj-msft c35fa01
Merge keyword-only fixes
varunj-msft 953dcce
Merge keyword-only fixes
varunj-msft d6079a1
Merge keyword-only fixes
varunj-msft b01b213
Merge keyword-only fixes
varunj-msft bf97225
Log every problem with a saved file that isn't valid
varunj-msft 8ed0f33
Merge the full schema-validation log
varunj-msft 6cb8285
Drop the restore report once live apply starts replacing the runtime
varunj-msft 35199cc
Leave the error behind a storage failure out of the logs
varunj-msft f7857ab
Import torch off the event loop before building a HuggingFaceChatTarget
varunj-msft efcdfa9
Test a blob upload that fails with a transport or authentication error
varunj-msft 0fdebdc
Merge the storage log and restore report fixes
varunj-msft c413994
Merge the storage log and restore report fixes
varunj-msft c057e30
Merge the storage log and restore report fixes
varunj-msft 3614208
Merge the storage log and restore report fixes
varunj-msft 7f416de
Log the error behind a storage failure with URL credentials removed
varunj-msft 12239e6
Read use_cuda through its registered parameter before checking for CUDA
varunj-msft 1d98920
Say that live apply needs one backend worker and one replica
varunj-msft c9b795a
Merge main
varunj-msft 38c981c
Merge main
varunj-msft eb71448
Merge main
varunj-msft 1be067e
Merge main
varunj-msft 6ba4a7b
Merge main
varunj-msft 9ffacc7
Point the restore banner at the saved files, and let it wrap
varunj-msft afd9576
Keep the restore failure list and runtime status inside their column …
varunj-msft 81992d4
Keep the whole runtime bar multiline, since its text changes after it…
varunj-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
frontend/src/components/Configuration/RestoreFailures.styles.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { makeStyles } from '@fluentui/react-components' | ||
|
|
||
| export const useRestoreFailuresStyles = makeStyles({ | ||
| // The page doesn't scroll past the editor, so a long list scrolls on its own. It fills its column, and a long | ||
| // name or message wraps instead of widening the list past it. | ||
| list: { | ||
| alignSelf: 'stretch', | ||
| boxSizing: 'border-box', | ||
| maxWidth: '100%', | ||
| minWidth: 0, | ||
| maxHeight: '30vh', | ||
| overflowWrap: 'anywhere', | ||
| overflowY: 'auto', | ||
| }, | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import type { RegistryRecipeKind, RestoreFailure } from '@/types' | ||
|
|
||
| import { useRestoreFailuresStyles } from './RestoreFailures.styles' | ||
|
|
||
| const KIND_LABELS: Record<RegistryRecipeKind, string> = { | ||
| targets: 'Target', | ||
| converters: 'Converter', | ||
| scorers: 'Scorer', | ||
| techniques: 'Technique', | ||
| } | ||
|
|
||
| function describeFailure(failure: RestoreFailure): string { | ||
| const subject = failure.name === null ? `Saved ${failure.kind}` : `${KIND_LABELS[failure.kind]} ${failure.name}` | ||
| // The message usually names the entry it depends on already. | ||
| const dependency = failure.dependency && !failure.message.includes(`'${failure.dependency.name}'`) | ||
| ? ` (${KIND_LABELS[failure.dependency.kind].toLowerCase()} ${failure.dependency.name})` | ||
| : '' | ||
| return `${subject}: ${failure.message}${dependency}` | ||
| } | ||
|
|
||
| interface RestoreFailuresProps { | ||
| failures: RestoreFailure[] | ||
| } | ||
|
|
||
| export default function RestoreFailures({ failures }: RestoreFailuresProps) { | ||
| const styles = useRestoreFailuresStyles() | ||
| return ( | ||
| <div | ||
| role="region" | ||
| aria-label="Saved entries that couldn't be restored" | ||
| // Focusable so a long list can be scrolled from the keyboard. | ||
| tabIndex={0} | ||
| className={styles.list} | ||
| > | ||
| <ul> | ||
| {failures.map((failure) => ( | ||
| <li key={`${failure.kind}/${failure.name ?? ''}`}>{describeFailure(failure)}</li> | ||
| ))} | ||
| </ul> | ||
| </div> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.