Commit d267ea3
committed
fix(replay): revert_csv handler delegates to revert_csv_pipeline (build 663)
RELEASE-BLOCKER FIX: _execute_replay_revert_csv in bin/wl_replay.py had
three production bugs in dead code that's wired into REPLAY_HANDLERS:
1. Line 226: `get_versions_dir()` called with no arguments, but the
function signature in wl_versions.py:40 requires `csv_path: str`.
Always raises TypeError caught by broad except → "revert_failed".
2. Line 236: `read_version_manifest(csv_file)` passed the filename
instead of the resolved CSV path. The function would silently
create a `_versions/` directory in cwd and return ({}, error).
3. Line 219/247: reads "version_id" from request_item, but the
approval queue stores "version_filename" (see wl_handler.py:6768).
Manifest schema also has no "version_id" field — the iteration
at line 246-249 would fail even if reached.
Additionally, REPLAY_HANDLERS["revert_csv"] was wired but the handler's
process_approval path uses action_type="revert" (no _csv suffix, see
wl_handler.py:6761) — dispatch keys didn't match.
The fix replaces the entire broken body (109 lines) with a delegation
to revert_csv_pipeline, matching the pattern used by create_rule /
delete_rule / delete_csv handlers. This makes the replay path
bit-for-bit identical to the direct-handler revert path and eliminates
the dual-source-of-truth that allowed the bugs to ship.
Changes:
- bin/wl_replay.py: rewrite _execute_replay_revert_csv (109 → 85 lines)
- bin/wl_replay.py: add "revert" alias in REPLAY_HANDLERS
- bin/wl_replay.py: add "revert" to _csv_required_actions precondition set
- default/app.conf: build 662 → 663
- appserver/static/whitelist_manager.js: urlArgs _b=662 → _b=663
- tests/unit/test_replay.py: replace TestRevertCsvHandlerKnownBug
(which pinned the broken behavior) with TestRevertCsvHandler — 6
tests covering happy path, missing version_filename, pipeline
failure, pipeline exception, legacy payload-nested submissions, and
the new "revert" alias
Production impact at the user-facing path: ZERO, because the handler
short-circuits revert approvals at wl_handler.py:6761 by calling
self._revert_csv directly (it never routes through
execute_approved_action for reverts). The bugs were dormant. But the
REPLAY_HANDLERS dispatch table is part of the architectural contract
that future refactors will trust — leaving broken entries in it sets
a trap for the next contributor who tries to consolidate replay paths.
Coverage delta on bin/wl_replay.py: 79% → 92% (+13pp, on top of the
+59pp from G3 batch 3c). Tests: 734 → 738 passed (+4 net after
replacing 2 KnownBug pins with 6 fixed-behavior tests).
Doc-drift: OK (checked 33 docs against build 663).1 parent 11cf760 commit d267ea3
4 files changed
Lines changed: 180 additions & 117 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
208 | | - | |
| 209 | + | |
209 | 210 | | |
210 | | - | |
211 | | - | |
212 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
213 | 215 | | |
214 | | - | |
215 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
216 | 220 | | |
217 | 221 | | |
218 | 222 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
| 223 | + | |
267 | 224 | | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
274 | 242 | | |
275 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
276 | 254 | | |
277 | | - | |
278 | | - | |
279 | | - | |
| 255 | + | |
280 | 256 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
| 257 | + | |
| 258 | + | |
285 | 259 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
290 | 268 | | |
291 | 269 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
| 270 | + | |
297 | 271 | | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
| 272 | + | |
| 273 | + | |
303 | 274 | | |
304 | | - | |
305 | | - | |
306 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
307 | 278 | | |
308 | 279 | | |
309 | | - | |
| 280 | + | |
310 | 281 | | |
311 | 282 | | |
312 | | - | |
313 | | - | |
| 283 | + | |
| 284 | + | |
314 | 285 | | |
315 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
316 | 293 | | |
317 | 294 | | |
318 | 295 | | |
| |||
523 | 500 | | |
524 | 501 | | |
525 | 502 | | |
| 503 | + | |
526 | 504 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
634 | 630 | | |
635 | 631 | | |
636 | 632 | | |
637 | 633 | | |
638 | 634 | | |
639 | 635 | | |
640 | | - | |
641 | | - | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
642 | 677 | | |
643 | 678 | | |
644 | 679 | | |
645 | 680 | | |
646 | 681 | | |
647 | 682 | | |
648 | 683 | | |
649 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
650 | 704 | | |
651 | | - | |
652 | 705 | | |
653 | 706 | | |
654 | | - | |
| 707 | + | |
655 | 708 | | |
656 | | - | |
657 | | - | |
| 709 | + | |
| 710 | + | |
658 | 711 | | |
659 | 712 | | |
660 | 713 | | |
661 | 714 | | |
662 | | - | |
663 | | - | |
664 | | - | |
| 715 | + | |
| 716 | + | |
665 | 717 | | |
666 | 718 | | |
667 | 719 | | |
668 | 720 | | |
669 | | - | |
| 721 | + | |
670 | 722 | | |
671 | | - | |
672 | | - | |
673 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
674 | 759 | | |
675 | 760 | | |
676 | 761 | | |
| |||
0 commit comments