Commit 3baba22
Mark the pipeline step that actually failed and retire stale test results (#7852)
# Description of Changes
`PolicyRun.currentStep` is a 1-based cursor (0 before the run starts).
`PipelineBuilder` compared it against the graph's 0-based step index, so
the badges landed one node late.
Test a corrupt PDF through Rotate → Split: the rotate call is the one
that returns 400, but the graph puts a green tick on Rotate and the
error control on Split, and the strip reads "Failed after 1 of 2 steps"
when no step completed.
The same arithmetic is why a node added after a successful test shows as
done before it has ever run: run state is derived positionally and
nothing retires a result when the chain changes.
**Changes**
- `stepRunState` converts the cursor to a 0-based index before
comparing.
- The failed summary reports steps that actually completed, not the
cursor.
- A test result is cleared when the step chain it ran against is edited,
so badges cannot certify a chain that was never executed.
**Before:** step 1 fails → step 1 shows done, step 2 shows failed,
"Failed after 1 of 2 steps".
**After:** step 1 fails → step 1 shows failed, step 2 shows nothing,
"Failed after 0 of 2 steps".
Three cases added to `PipelineBuilder.test.tsx` covering a first-step
failure, a mid-chain run, and editing the chain after a passing test.
All three fail on `main` and pass here.
---
## Checklist
### General
- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [x] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [x] I have performed a self-review of my own code
- [x] Every comment I added says something the code does not
([guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/CODE_COMMENTS.md))
- [x] My changes generate no new warnings
### Testing (if applicable)
- [x] `npx vitest run src/portal` passes: 90 files, 583 tests
- [x] `tsc --noEmit` (proprietary variant), `oxlint --max-warnings=0`
and `oxfmt --check` all clean
Co-authored-by: James Brunton <jbrunton96@gmail.com>1 parent 3ab5f55 commit 3baba22
2 files changed
Lines changed: 96 additions & 3 deletions
Lines changed: 76 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
331 | 335 | | |
332 | 336 | | |
333 | 337 | | |
| 338 | + | |
| 339 | + | |
334 | 340 | | |
335 | 341 | | |
336 | 342 | | |
| |||
889 | 895 | | |
890 | 896 | | |
891 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
892 | 968 | | |
893 | 969 | | |
894 | 970 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
728 | 740 | | |
729 | 741 | | |
730 | 742 | | |
| |||
956 | 968 | | |
957 | 969 | | |
958 | 970 | | |
| 971 | + | |
959 | 972 | | |
960 | 973 | | |
961 | 974 | | |
| |||
1167 | 1180 | | |
1168 | 1181 | | |
1169 | 1182 | | |
1170 | | - | |
1171 | | - | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
1172 | 1186 | | |
1173 | 1187 | | |
1174 | 1188 | | |
| |||
1205 | 1219 | | |
1206 | 1220 | | |
1207 | 1221 | | |
1208 | | - | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
1209 | 1226 | | |
1210 | 1227 | | |
1211 | 1228 | | |
| |||
0 commit comments