Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
302 commits
Select commit Hold shift + click to select a range
a45ac23
Close a file that isn't regular before reporting it and report entrie…
varunj-msft Nov 3, 2026
60477e8
Merge the file handle fix
varunj-msft Nov 3, 2026
28f2262
Merge the file handle fix
varunj-msft Nov 3, 2026
ad21f0c
Give only targets the path parameters their class lets callers set
varunj-msft Nov 3, 2026
3dc4768
Merge the file handle fix and the target-only caller paths
varunj-msft Nov 3, 2026
db245dc
Test a file replaced just before it's opened and stop a blocked read …
varunj-msft Nov 4, 2026
5d3d2d0
Merge the opened-file tests
varunj-msft Nov 4, 2026
07a617f
Merge the opened-file tests
varunj-msft Nov 4, 2026
2b4f1cc
Merge the opened-file tests
varunj-msft Nov 4, 2026
80754a2
Read saved recipes separately from building them
varunj-msft Nov 4, 2026
7965020
Merge the separate recipe read
varunj-msft Nov 4, 2026
bd84ef0
Build restored entries on the runtime loop and read them in a worker …
varunj-msft Nov 4, 2026
1a192f7
Show every signed-in user why saved registry entries couldn't be rest…
varunj-msft Nov 4, 2026
4fb7f35
Retry restoring saved registry entries without a restart
varunj-msft Nov 4, 2026
27ef572
Drop a late retry answer when the runtime failed again between polls
varunj-msft Nov 4, 2026
fa1ae56
Keep Retry in reach and say when the failure list couldn't be loaded
varunj-msft Nov 5, 2026
1af1d00
Stop a scan whose launch scripts would replace a saved entry
varunj-msft Nov 5, 2026
17d6fe0
Report a saved-entry clash when a launch script wraps the refusal
varunj-msft Nov 5, 2026
b829bb8
Merge origin/main
varunj-msft Nov 5, 2026
a230568
Refuse saved targets that would authenticate with a key
varunj-msft Nov 5, 2026
232857e
Check where saved targets send requests
varunj-msft Nov 5, 2026
034522d
Accept only plain addresses and paths as saved target destinations
varunj-msft Nov 5, 2026
d10f3cf
Save targets created through the API
varunj-msft Nov 5, 2026
0cbed4c
Count targets that a restart doesn't bring back as Temporary
varunj-msft Nov 5, 2026
d1bdd82
List presets, suites, and initializers through the checked listing
varunj-msft Nov 5, 2026
f5ed760
Merge the shared document listing
varunj-msft Nov 5, 2026
4b55b17
Merge the shared document listing
varunj-msft Nov 5, 2026
a1866d5
Merge the shared document listing
varunj-msft Nov 5, 2026
e8dc897
Merge the shared document listing
varunj-msft Nov 5, 2026
09a98af
Merge the shared document listing
varunj-msft Nov 5, 2026
5ce5bb9
Merge the shared document listing
varunj-msft Nov 5, 2026
84ac7c2
Merge the shared document listing
varunj-msft Nov 5, 2026
76dbf9c
Report a preset, suite, or initializer folder that can't be read as u…
varunj-msft Nov 5, 2026
f823e4b
Merge the storage error mapping for unreadable folders
varunj-msft Nov 5, 2026
99da684
Merge the storage error mapping for unreadable folders
varunj-msft Nov 5, 2026
2c58145
Merge the storage error mapping for unreadable folders
varunj-msft Nov 5, 2026
5a0afa6
Merge the storage error mapping for unreadable folders
varunj-msft Nov 5, 2026
6bb9aec
Merge the storage error mapping for unreadable folders
varunj-msft Nov 5, 2026
a4790e9
Merge the storage error mapping for unreadable folders
varunj-msft Nov 5, 2026
35ed34c
Merge the storage error mapping for unreadable folders
varunj-msft Nov 5, 2026
d70837c
Test each saved target URL rule on its own
varunj-msft Nov 5, 2026
4ce3214
Describe what a saved target can use more precisely
varunj-msft Nov 5, 2026
5669748
Merge the saved target rule tests and doc
varunj-msft Nov 5, 2026
1ef0838
Describe saving targets more precisely
varunj-msft Nov 5, 2026
b3b8ac5
Test the remaining saved target URL rules on their own
varunj-msft Nov 6, 2026
8a44952
Say which saved target addresses are checked
varunj-msft Nov 6, 2026
14125fc
Merge the remaining saved target rule tests and doc
varunj-msft Nov 6, 2026
078dc72
Describe what saving a target refuses more precisely
varunj-msft Nov 6, 2026
6800d15
Merge origin/main
varunj-msft Nov 6, 2026
74839cd
Merge origin/main
varunj-msft Nov 6, 2026
ee3e64f
Merge origin/main
varunj-msft Nov 6, 2026
15e7a9e
Take out the restore retry changes merged here by mistake
varunj-msft Nov 6, 2026
368b914
Merge origin/main
varunj-msft Nov 6, 2026
fd7bd4a
Merge origin/main
varunj-msft Nov 6, 2026
844a424
Say a Temporary target is also gone after a reinitialization
varunj-msft Nov 6, 2026
ebd1042
Say which target types can be saved, and mark a refused save
varunj-msft Nov 6, 2026
d3a8d2e
Save targets from the New Target dialog and label where each comes from
varunj-msft Nov 6, 2026
7d9ac2f
Log why storage is unavailable, without its path or URL
varunj-msft Nov 7, 2026
7b5bfeb
Merge the storage error logging
varunj-msft Nov 7, 2026
22806d8
Merge the storage error logging
varunj-msft Nov 7, 2026
34011c9
Hide a restore message with a percent escape, which can hide a creden…
varunj-msft Nov 7, 2026
8a0113f
Merge the storage error logging and the percent-escape fix
varunj-msft Nov 7, 2026
8d51b6c
Merge the storage error logging and the percent-escape fix
varunj-msft Nov 7, 2026
6ddd960
Merge the storage error logging and the percent-escape fix
varunj-msft Nov 7, 2026
91bb36b
Merge the storage error logging and the percent-escape fix
varunj-msft Nov 7, 2026
ad7cb29
Merge the storage error logging and the percent-escape fix
varunj-msft Nov 7, 2026
dc4125c
Stop a launch whose script catches the duplicate-name error for a sav…
varunj-msft Nov 7, 2026
febc8c3
Merge the duplicate-name refusal for saved entries
varunj-msft Nov 7, 2026
303dfa8
Merge the duplicate-name refusal for saved entries
varunj-msft Nov 7, 2026
6abde9f
Merge the duplicate-name refusal for saved entries
varunj-msft Nov 7, 2026
e03fd18
Merge origin/main
varunj-msft Nov 7, 2026
36462db
Merge origin/main
varunj-msft Nov 7, 2026
37f9522
Merge origin/main
varunj-msft Nov 7, 2026
031dc61
Merge origin/main
varunj-msft Nov 8, 2026
7f8ab0d
Merge origin/main
varunj-msft Nov 8, 2026
19205b1
Import the saved recipe models from their package, as main now requires
varunj-msft Nov 8, 2026
0348a0b
Merge origin/main
varunj-msft Nov 8, 2026
bba3afd
Import from public packages, as main now requires
varunj-msft Nov 8, 2026
d4ccd50
Merge origin/main
varunj-msft Nov 8, 2026
ed01798
Merge origin/main
varunj-msft Nov 8, 2026
98766ec
Record a saved entry's name clash wherever a launch script can catch it
varunj-msft Nov 8, 2026
6fb1e00
Merge origin/main
varunj-msft Nov 8, 2026
405c2bd
Import from public packages, as main now requires
varunj-msft Nov 8, 2026
d35eea9
Merge origin/main
varunj-msft Nov 8, 2026
9afbd2c
Merge origin/main
varunj-msft Nov 8, 2026
13bd3ab
Check a target that takes no credentials as the default auth mode
varunj-msft Nov 8, 2026
2b97d83
Merge origin/main
varunj-msft Nov 8, 2026
aaf2c15
Merge origin/main
varunj-msft Nov 8, 2026
622bbb8
Report storage failures with one error and answer them with 503
varunj-msft Nov 9, 2026
1cae0b9
Merge the single storage error
varunj-msft Nov 9, 2026
eba7bf2
Escape file names once and simplify the saved recipe models
varunj-msft Nov 9, 2026
9f24124
Merge the recipe model simplification
varunj-msft Nov 9, 2026
2bbfc8f
Report restore bugs as build errors and log each failure once
varunj-msft Nov 9, 2026
3735dbc
Merge the restore logging and build error fixes
varunj-msft Nov 9, 2026
ca7563d
Stay ready when a saved entry can't be restored, and hold its name
varunj-msft Nov 9, 2026
a9dfc86
Merge the stay-ready restore
varunj-msft Nov 10, 2026
67416f1
Reset the registries between runtime tests, as a real startup does
varunj-msft Nov 10, 2026
e6e419e
Merge the runtime test isolation
varunj-msft Nov 10, 2026
81c0317
Stop a launch whose script takes the name of a saved entry that failed
varunj-msft Nov 10, 2026
6ee84f0
Merge origin/main
varunj-msft Nov 10, 2026
d43a7e8
Merge origin/main
varunj-msft Nov 10, 2026
0664063
Merge origin/main
varunj-msft Nov 10, 2026
3b3ac59
Merge origin/main
varunj-msft Nov 10, 2026
04fe60f
Merge origin/main
varunj-msft Nov 10, 2026
6911327
Merge origin/main
varunj-msft Nov 10, 2026
ee45962
Refuse OpenAI targets while the server sets OPENAI_CUSTOM_HEADERS
varunj-msft Nov 10, 2026
6a98d17
Merge origin/main
varunj-msft Nov 10, 2026
4a3f2e5
Use final origin names, record startup entries at registration, and t…
varunj-msft Nov 10, 2026
9f5d390
Merge the saved target origin and naming changes
varunj-msft Nov 10, 2026
51d4fff
Explain that a credential refusal also covers using this server's cre…
varunj-msft Nov 10, 2026
a3d4f92
Merge the credential explanation
varunj-msft Nov 10, 2026
3c7a918
Merge the credential explanation
varunj-msft Nov 10, 2026
8614025
Use one recipe format version, keep the auth mode, and escape failure…
varunj-msft Nov 10, 2026
5a3f18b
Merge the recipe format changes
varunj-msft Nov 10, 2026
b3c7847
Build restored entries with a builder the caller supplies
varunj-msft Nov 10, 2026
af4075f
Merge the restore builder changes
varunj-msft Nov 10, 2026
061807a
Warn that writing saved entries is administrator authority, and test …
varunj-msft Nov 10, 2026
1740964
Merge the restore builder changes
varunj-msft Nov 10, 2026
01d99d7
Merge the restore builder changes
varunj-msft Nov 10, 2026
600717f
Merge the restore builder changes
varunj-msft Nov 10, 2026
095e76b
Merge the restore builder changes
varunj-msft Nov 10, 2026
7a547aa
Say restore can't tell who wrote a saved file
varunj-msft Nov 10, 2026
f71259b
Merge the saved file wording
varunj-msft Nov 10, 2026
986cc90
Test the parser's depth limit without depending on the stack size
varunj-msft Nov 10, 2026
1096925
Merge the parser depth test fix
varunj-msft Nov 10, 2026
f25b520
Merge the parser depth test fix
varunj-msft Nov 10, 2026
1845b64
Merge the parser depth test fix
varunj-msft Nov 10, 2026
bd2224b
Merge the parser depth test fix
varunj-msft Nov 10, 2026
b454e75
Merge the parser depth test fix
varunj-msft Nov 10, 2026
83a0bca
Merge the parser depth test fix
varunj-msft Nov 10, 2026
fb90af8
Read saved entries in a worker thread when restore isn't given what w…
varunj-msft Nov 10, 2026
c44d2ce
Merge the worker-thread read
varunj-msft Nov 10, 2026
abd116a
Stay not ready when a saved entry can't be restored, and let apply retry
varunj-msft Nov 10, 2026
0bfa6cc
Drop the refusal of held names from launches
varunj-msft Nov 10, 2026
c62118f
Merge the not-ready restore
varunj-msft Nov 10, 2026
c0aa46d
Merge the not-ready restore
varunj-msft Nov 10, 2026
f59306e
Read saved recipes off the event loop by default, and harden URL reda…
richlundeen Nov 10, 2026
7d90d68
Merge the not-ready restore
varunj-msft Nov 10, 2026
0f0c53d
Treat a class a launch script puts in place of another as temporary
varunj-msft Nov 10, 2026
26e1d0e
Merge the not-ready restore
varunj-msft Nov 10, 2026
f1ff143
Keep an "@" in a URL's path when redacting URLs in text
richlundeen Nov 10, 2026
009e761
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
21f22a4
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
e9103ff
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
57b069a
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
7c88228
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
cc4ae4d
Merge main
varunj-msft Nov 10, 2026
9f4c71e
Merge main
varunj-msft Nov 10, 2026
5121026
Merge main
varunj-msft Nov 10, 2026
d15f7fd
Merge main
varunj-msft Nov 11, 2026
84ad3fe
Merge main
varunj-msft Nov 11, 2026
be0b885
Use the dialog's save button in the new tests from main
varunj-msft Nov 11, 2026
187191c
Answer suite readiness storage failures through the shared storage ha…
varunj-msft Nov 11, 2026
ee8162c
Give the HTTPTarget save test the connection field a create now needs
varunj-msft Nov 11, 2026
bb2a620
Merge the readiness and save test fixes
varunj-msft Nov 11, 2026
db7451a
Merge the readiness and save test fixes
varunj-msft Nov 11, 2026
b200c92
Merge the readiness and save test fixes
varunj-msft Nov 11, 2026
4c42a6b
Merge the readiness and save test fixes
varunj-msft Nov 11, 2026
374c620
Merge main
varunj-msft Nov 11, 2026
7ac059c
Answer suite readiness storage failures through the shared storage ha…
varunj-msft Nov 11, 2026
e08b67a
Merge main
varunj-msft Nov 11, 2026
7fa4ca4
Expect storage errors from main's version-checked delete tests the wa…
varunj-msft Nov 11, 2026
9bf5886
Merge main
varunj-msft Nov 11, 2026
626d2d4
Merge main
varunj-msft Nov 11, 2026
4a86017
Merge main
varunj-msft Nov 11, 2026
9568edb
Merge main
varunj-msft Nov 11, 2026
54e4374
Merge main
varunj-msft Nov 11, 2026
e34258c
Fit the explicit-target E2E from main to the dialog's save button and…
varunj-msft Nov 11, 2026
c506195
Merge main
varunj-msft Nov 11, 2026
1ba526f
Merge main
varunj-msft Nov 11, 2026
9cdf7e7
Merge main
varunj-msft Nov 11, 2026
40d36ed
Merge main
varunj-msft Nov 11, 2026
6a52054
Merge main
varunj-msft Nov 11, 2026
23a7ec1
Merge main
varunj-msft Nov 11, 2026
70fbc3d
Merge main
varunj-msft Nov 11, 2026
a1e79d1
Merge main
varunj-msft Nov 11, 2026
8c517d0
Use the dialog's save button in main's endpoint tests
varunj-msft Nov 11, 2026
0e7a21f
Exempt the storage error handler from the keyword-only check
varunj-msft Nov 11, 2026
c35fa01
Merge keyword-only fixes
varunj-msft Nov 11, 2026
953dcce
Merge keyword-only fixes
varunj-msft Nov 11, 2026
d6079a1
Merge keyword-only fixes
varunj-msft Nov 11, 2026
21556ed
Merge keyword-only fixes
varunj-msft Nov 11, 2026
14004e9
Merge keyword-only fixes
varunj-msft Nov 11, 2026
3abc824
Merge keyword-only fixes
varunj-msft Nov 11, 2026
623fd40
Merge keyword-only fixes
varunj-msft Nov 11, 2026
bf97225
Log every problem with a saved file that isn't valid
varunj-msft Nov 11, 2026
5e6faed
Merge the full schema-validation log
varunj-msft Nov 11, 2026
7625f89
Merge the full schema-validation log
varunj-msft Nov 11, 2026
8dbd4c2
Merge the full schema-validation log
varunj-msft Nov 11, 2026
5c7223a
Merge the full schema-validation log
varunj-msft Nov 11, 2026
35199cc
Leave the error behind a storage failure out of the logs
varunj-msft Nov 12, 2026
efcdfa9
Test a blob upload that fails with a transport or authentication error
varunj-msft Nov 12, 2026
0fdebdc
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
c413994
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
c057e30
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
dc97ec7
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
a9478df
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
dc0c058
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
8f27c91
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
c9b795a
Merge main
varunj-msft Nov 12, 2026
38c981c
Merge main
varunj-msft Nov 12, 2026
eb71448
Merge main
varunj-msft Nov 12, 2026
1be067e
Merge main
varunj-msft Nov 12, 2026
162fc2a
Merge main
varunj-msft Nov 12, 2026
6c0c3dd
Merge main
varunj-msft Nov 12, 2026
3d0950d
Merge main
varunj-msft Nov 12, 2026
8b59c5d
Merge main
varunj-msft Nov 12, 2026
4e8d9c2
Return 409 when a suite's launch scripts would replace a saved entry
varunj-msft Nov 12, 2026
b1bbbe6
Merge the suite launch conflict status
varunj-msft Nov 12, 2026
9ce29cb
Merge the suite launch conflict status
varunj-msft Nov 12, 2026
4e0e640
Merge the suite launch conflict status
varunj-msft Nov 12, 2026
15e00de
Merge main
varunj-msft Nov 12, 2026
0c5baa8
Merge main
varunj-msft Nov 12, 2026
a3f65ad
Merge main
varunj-msft Nov 12, 2026
d4337d8
Merge main
varunj-msft Nov 12, 2026
48bc6d1
Merge main
varunj-msft Nov 12, 2026
9789264
Merge main
varunj-msft Nov 12, 2026
805ca2a
Merge main into part 7
varunj-msft Nov 13, 2026
b9c50e1
Merge part 7 into part 8
varunj-msft Nov 13, 2026
5363c0b
Merge part 8 into part 9
varunj-msft Nov 13, 2026
cdbe6ad
Keep the recipe storage setup apart from the saved target requirements
varunj-msft Nov 13, 2026
450b1e5
Merge part 7 into part 8
varunj-msft Nov 13, 2026
699ab5b
Move saving a target into the registry library
varunj-msft Nov 13, 2026
7d914b1
Merge part 8 into part 9
varunj-msft Nov 13, 2026
713f7d1
Merge main into part 8
varunj-msft Nov 13, 2026
793316a
Merge part 8 into part 9
varunj-msft Nov 13, 2026
048283e
Merge main into part 8
varunj-msft Nov 13, 2026
6c243b6
Merge part 8 into part 9
varunj-msft Nov 13, 2026
f273bff
Merge main into part 8
varunj-msft Nov 14, 2026
d692b25
Merge main into part 9
varunj-msft Nov 14, 2026
54d9332
Check saved entries against restore's inputs and settle cancelled saves
varunj-msft Nov 14, 2026
0529525
Merge part 8 into part 9
varunj-msft Nov 14, 2026
d0bb066
Ask the backend whether a target's values can be saved
varunj-msft Nov 14, 2026
c05e125
Check saveability with a request that registers nothing
varunj-msft Nov 14, 2026
e47689c
Wrap the saveability note in the backend README
varunj-msft Nov 14, 2026
e6cfbd9
Answer the saveability check in the numeric controls end-to-end mocks
varunj-msft Nov 14, 2026
87de386
Bound the URL scheme when redacting text
varunj-msft Nov 14, 2026
96361e5
Merge part 9
varunj-msft Nov 14, 2026
33650ff
Merge main into part 8
varunj-msft Nov 17, 2026
87a4abf
Merge main into part 9
varunj-msft Nov 17, 2026
b369843
Merge main into part 9
varunj-msft Nov 17, 2026
ed3141f
Merge main into part 9
varunj-msft Nov 18, 2026
f691ba6
Keep saveability available as a target name
varunj-msft Nov 18, 2026
2c15d96
Merge main into part 9
varunj-msft Nov 19, 2026
d055396
Keep the class save rule in the library and answer with the cause alone
varunj-msft Nov 19, 2026
ca4324b
Create targets only you can use, or that allow credential updates, as…
varunj-msft Nov 19, 2026
d9a66f6
Give each reason a target stays Temporary as its cause only, and drop…
varunj-msft Nov 19, 2026
8bc4161
Say the saveability check runs create's checks on the type, parameter…
varunj-msft Nov 19, 2026
fa087b1
Merge main into part 9
varunj-msft Nov 19, 2026
0dc92aa
Merge main into part 9
varunj-msft Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions doc/gui/0_gui.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,31 @@ Editing a preset preserves unchanged parameter values exactly, including commas
and whitespace inside list entries, empty lists, duplicates, and their order.
Editing a list field uses the comma-separated format shown in the editor.

Targets, converters, and techniques added only to the live registry must be
recreated after a backend restart or reinitialization. Use
**New Target** saves the target, so it comes back after the backend restarts or
is reinitialized. Give it a registry name of lowercase letters, digits, and
underscores that starts with a letter; the dialog suggests one from the target
type and model. Saved targets are kept in `registry_recipes_source`
(`~/.pyrit/registry_recipes` unless set in your `.pyrit_conf`). To remove a saved
target, delete its file (`targets/<name>.json`) there, and the file of any saved
round robin that uses it, then restart the backend. If a startup initializer later
registers a target under a saved target's name, the saved one isn't restored and
the backend isn't ready until that file is renamed or removed and the backend
Comment thread
varunj-msft marked this conversation as resolved.
Resolved
restarted. Before that restart, update or remove the file of each saved round
robin that uses the old name: restore finds its members by name, so it would
otherwise send to the initializer's target in place of the saved one.

Saved targets can't hold credentials yet, so choose Identity-based or No key
authentication when the target supports it. A target that needs an API key or
another credential value, a type that can't be saved, a round robin that uses a
Temporary target, or a target that only you can use or that allows credential
updates is created as **Temporary** instead, and the dialog says why.
A Temporary target is gone after the backend restarts or is reinitialized.

The Targets table labels each target **Saved**, **From configuration**
(registered by an initializer at startup), or **Temporary**.

Converters and techniques added only to the live registry must be recreated
after a backend restart or reinitialization. Use
[initializers](../code/setup/0_setup.md) for repeatable component setup.

Use **Auto-detect capabilities** to select targets and run live checks. Results
Expand Down
46 changes: 41 additions & 5 deletions frontend/e2e/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ test.describe("Target Registry Page", () => {

// Dialog should open
await expect(page.getByText("Create New Target")).toBeVisible();
await expect(page.getByText("Create Target")).toBeVisible();
await expect(page.getByRole("button", { name: "Save Target" })).toBeVisible();
});

test("should update targets after a visible minute without a Refresh control", async ({ page }) => {
Expand Down Expand Up @@ -406,12 +406,14 @@ test.describe("Create Target Dialog", () => {
await expect(selectedDetails).toContainText("Supported authentication: API key");
});

test("should create a target through the dialog", async ({ page }) => {
test("should save a target through the dialog", async ({ page }) => {
let createdTarget: FlatTarget | null = null;
let createBody: Record<string, unknown> | null = null;

await page.route(/\/api\/targets/, async (route) => {
if (route.request().method() === "POST") {
const body = JSON.parse(route.request().postData() ?? "{}");
createBody = body;
createdTarget = {
target_registry_name: "new-target-1",
target_type: body.type,
Expand All @@ -429,6 +431,35 @@ test.describe("Create Target Dialog", () => {
await route.fulfill(mockTargetsList(items));
}
});
// Registered last, so it answers the type list instead of the route above.
await page.route(/\/api\/targets\/types(?:\?.*)?$/, async (route) => {
await route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({
items: [
{
target_type: "OpenAIChatTarget",
parameters: [
{ name: "endpoint", type_name: "str", required: true, default: null },
{ name: "model_name", type_name: "str", required: true, default: null },
],
supported_auth_modes: ["api_key", "identity", "none"],
saveable_auth_modes: ["identity", "none"],
not_saveable_reason: null,
},
],
}),
});
});
// Also registered after the broad route, so the dialog's save check isn't taken for a create.
await page.route(/\/api\/targets\/saveability$/, async (route) => {
await route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({ not_saveable_reason: null }),
});
});

await goToTargets(page);

Expand All @@ -453,11 +484,16 @@ test.describe("Create Target Dialog", () => {
// Fill model name
await dialog.getByPlaceholder("e.g. gpt-4o, my-deployment").fill("gpt-4o-test");

// Click Create Target
await dialog.getByRole("button", { name: "Create Target" }).click();
await dialog.getByRole("button", { name: "Save Target" }).click();

// Dialog should close and target should appear in the list
await expect(page.getByText("Create New Target")).not.toBeVisible({ timeout: 5_000 });
expect(createBody).toMatchObject({
name: "openai_chat_gpt_4o_test",
type: "OpenAIChatTarget",
auth_mode: "identity",
persist: true,
});
await expect(page.getByText("gpt-4o-test", { exact: true })).toBeVisible({ timeout: 10_000 });
await expect(page.getByText("OpenAIChatTarget")).toBeVisible();
});
Expand Down Expand Up @@ -496,7 +532,7 @@ test.describe("Create Target Dialog", () => {
await expect(page.getByText("Create New Target")).toBeVisible();

const dialog = page.locator('[role="dialog"]');
const createBtn = dialog.getByRole("button", { name: "Create Target" });
const createBtn = dialog.getByRole("button", { name: "Save Target" });
await expect(createBtn).toBeDisabled();

await selectTargetType(
Expand Down
1 change: 1 addition & 0 deletions frontend/e2e/numeric-controls.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ async function mockNumericControlApis(page: Page): Promise<void> {
items: [makeTarget({ target_registry_name: 'mock-target' })],
pagination: { limit: 200, has_more: false },
},
'/api/targets/saveability': { not_saveable_reason: null },
'/api/targets/types': {
items: [
{
Expand Down
26 changes: 26 additions & 0 deletions frontend/e2e/registry.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,32 @@ test("creates and selects a runtime technique with the real backend @seeded", as
expect(promptRequests).toEqual([]);
});

test("saves a target from the New Target dialog and still lists it as Saved after a reload @seeded", async ({ page, request }) => {
const name = `saved_chat_${Date.now()}`;
await page.goto("/registry/targets");
await page.getByRole("button", { name: "New Target", exact: true }).click();
const dialog = page.getByRole("dialog");
const picker = dialog.getByRole("combobox", { name: "Target Type" });
await expect(picker).toBeEnabled();
await picker.click();
await page.getByRole("option", { name: /Implementation: OpenAIChatTarget/ }).click();
await dialog.getByRole("radio", { name: /^No key/ }).check();
await dialog.getByPlaceholder("https://your-resource.openai.azure.com/").fill("http://127.0.0.1:9/v1");
await dialog.getByPlaceholder("e.g. gpt-4o, my-deployment").fill("local-test");
await dialog.getByRole("textbox", { name: /Registry Name/ }).fill(name);
await expect(dialog.getByText("This target can't be saved")).toHaveCount(0);
await dialog.getByRole("button", { name: "Save Target" }).click();
await expect(dialog).toHaveCount(0);

await expect(page.getByTestId(`target-row-${name}`).getByText("Saved", { exact: true })).toBeVisible();
const saved = await request.get(`/api/targets/${name}`, { headers: compatibilityHeaders() });
expect(saved.ok(), await saved.text()).toBe(true);
expect((await saved.json()).origin).toBe("saved");

await page.reload();
await expect(page.getByTestId(`target-row-${name}`).getByText("Saved", { exact: true })).toBeVisible();
});

interface RegisteredConverter {
converter_id: string;
identifier: {
Expand Down
13 changes: 11 additions & 2 deletions frontend/src/components/Config/CreateTargetDialog.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,17 @@ export const useCreateTargetDialogStyles = makeStyles({
border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,
borderRadius: tokens.borderRadiusMedium,
},
warningMessage: {
width: '100%',
// DialogBody is a grid with the actions in its third row; while the warning shows, it takes that row and the
// actions move below it.
temporaryWarning: {
gridRowStart: 3,
gridRowEnd: 3,
gridColumnStart: 1,
gridColumnEnd: 4,
},
actionsBelowWarning: {
gridRowStart: 4,
gridRowEnd: 4,
},
warningMessageBody: {
whiteSpace: 'normal',
Expand Down
Loading
Loading