fix: mark the failed key published so retry work can consume it - #23
Merged
Conversation
The 1.0.0 published-marker gate makes `work` refuse any key without a `<key>:published` marker. record_failed_files populates the failed key (SPECBANDIT_KEY_FAILED) via queue.push, which never sets the marker, so a retry `work --key <failed-key>` pass crashes with 'was never published'. Mark the failed key published right after recording its files.
beagleknight
marked this pull request as ready for review
July 2, 2026 06:20
fcsonline
approved these changes
Jul 2, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
v1.0.0 added a published-marker gate:
workrefuses to run a key unless a<key>:publishedmarker exists in Redis, written only byspecbandit push.The flaky-retry flow records failing batches onto a failed queue (
SPECBANDIT_KEY_FAILED) viarecord_failed_files→queue.push(...), which never marks the key published. So a retry pass (work --key <failed-key>) crashes with 'was never published'. This broke Factorial CI's backend/frontend flaky-retry once the 1.0.0 packages went out.Fix
record_failed_filesnow callsqueue.mark_published(key_failed, ttl: key_ttl)right after pushing the failed files, so a laterworkpass can consume the failed queue. (The empty-fallback —extract_failed_files(result) || files+return if empty— was already correct here.)Tests
mark_published(key_failed, ttl:)is called after a failing batch, and not when the batch passes.mark_publishedon the queue double by default so existing push specs tolerate the new call.Ships as v1.0.1 via the Release workflow after merge.