Say what is wrong with a rejected workflow definition (#25)
CI / Lint (eslint) (pull_request) Successful in 20s
CI / Test (jest) (pull_request) Successful in 22s
CI / Security (npm audit) (pull_request) Successful in 13s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m32s
CI / Integration (api) (pull_request) Successful in 3m24s
CI / UI screenshots (before/after) (pull_request) Successful in 6s
CI / UI (playwright) (pull_request) Successful in 1m53s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 20s
CI / Test (jest) (pull_request) Successful in 22s
CI / Security (npm audit) (pull_request) Successful in 13s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m32s
CI / Integration (api) (pull_request) Successful in 3m24s
CI / UI screenshots (before/after) (pull_request) Successful in 6s
CI / UI (playwright) (pull_request) Successful in 1m53s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
The server answered a bad goto or condition with "Invalid workflow definition" and put the details in a problems array, which the UI never shows (lt.api keeps only `error`). The error now names them, e.g. "Invalid workflow definition: step check: no step with id "notify"" (up to five, then "and N more"); problems stays for API clients. The rest of #25 was already fixed by the UI rewrite; regression tests now cover the server's reason in the form and Escape closing the Run dialog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c5d2258f52
commit
e5d640dc1a
3 files changed
+43
-2
No files matched your search
@@ -256,3 +256,12 @@ test('a failure on one target fails the step, after every target has reported (#
|
||||
expect(outputs(ex).filter(o => o === 'ok')).toHaveLength(2);
|
||||
expect(outputs(ex)).not.toContain('should-not-run');
|
||||
});
|
||||
|
||||
test('a rejected definition says what is wrong in the error itself (#25)', async () => {
|
||||
const res = await sso('POST', '/api/workflows', { name: `bad-goto-${unique()}`, definition: { steps: [
|
||||
{ id: 'check', type: 'execute', command: 'true', goto: 'nope' },
|
||||
] } });
|
||||
expect(res.status).toBe(400);
|
||||
expect(res.json.error).toBe('Invalid workflow definition: step check: no step with id "nope"');
|
||||
expect(res.json.problems).toHaveLength(1);
|
||||
});
|
||||
Reference in new issue
Block a user