apiVersion: jenkins.io/v1 kind: PipelineActivity metadata: annotations: lighthouse.jenkins-x.io/cloneURI: https://github.com/greencapitaltrade/jarvis.git lighthouse.jenkins-x.io/job: release pipeline.jenkins-x.io/traceID: c95b5dd7e0c7b64b816864d7bc70e7f7 creationTimestamp: "2026-07-12T07:08:48Z" generation: 7 labels: branch: main build: "103" context: release created-by-lighthouse: "true" event-GUID: 84f44a7e-7dc0-11f1-9ae3-07485d9fa8d0 lighthouse.jenkins-x.io/baseSHA: f977bfadab4f53d54a142815cdad70a7f5cdf572 lighthouse.jenkins-x.io/branch: main lighthouse.jenkins-x.io/buildNum: "1783840128825" lighthouse.jenkins-x.io/context: release lighthouse.jenkins-x.io/id: capitaltrade-jarvis-main-release-2jkch lighthouse.jenkins-x.io/job: release lighthouse.jenkins-x.io/lastCommitSHA: f977bfadab4f53d54a142815cdad70a7f5cdf572 lighthouse.jenkins-x.io/refs.org: greencapitaltrade lighthouse.jenkins-x.io/refs.repo: jarvis lighthouse.jenkins-x.io/type: postsubmit owner: greencapitaltrade podName: capitaltrade-jarvis-main-release-g6wwq-from-build-pack-pod provider: github repository: jarvis tekton.dev/pipeline: capitaltrade-jarvis-main-release managedFields: - apiVersion: jenkins.io/v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:labels: f:branch: {} f:context: {} f:owner: {} f:provider: {} f:repository: {} f:spec: f:lastCommitMessage: {} f:lastCommitSHA: {} f:releaseNotesURL: {} f:version: {} manager: jx-changelog-0.10.22 operation: Update time: "2026-07-12T07:19:19Z" - apiVersion: jenkins.io/v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:lighthouse.jenkins-x.io/cloneURI: {} f:lighthouse.jenkins-x.io/job: {} f:pipeline.jenkins-x.io/traceID: {} f:labels: .: {} f:build: {} f:created-by-lighthouse: {} f:event-GUID: {} f:lighthouse.jenkins-x.io/baseSHA: {} f:lighthouse.jenkins-x.io/branch: {} f:lighthouse.jenkins-x.io/buildNum: {} f:lighthouse.jenkins-x.io/context: {} f:lighthouse.jenkins-x.io/id: {} f:lighthouse.jenkins-x.io/job: {} f:lighthouse.jenkins-x.io/lastCommitSHA: {} f:lighthouse.jenkins-x.io/refs.org: {} f:lighthouse.jenkins-x.io/refs.repo: {} f:lighthouse.jenkins-x.io/type: {} f:podName: {} f:tekton.dev/pipeline: {} f:spec: .: {} f:baseSHA: {} f:batchPipelineActivity: {} f:build: {} f:buildLogsUrl: {} f:completedTimestamp: {} f:context: {} f:gitBranch: {} f:gitOwner: {} f:gitRepository: {} f:gitUrl: {} f:message: {} f:pipeline: {} f:startedTimestamp: {} f:status: {} f:steps: {} manager: jx-build-controller operation: Update time: "2026-07-12T07:20:43Z" name: greencapitaltrade-jarvis-main-103 namespace: jx resourceVersion: "181604091" uid: 63f18c98-1a29-463b-a617-e4f1e05eb241 spec: baseSHA: f977bfadab4f53d54a142815cdad70a7f5cdf572 batchPipelineActivity: {} build: "103" buildLogsUrl: s3://logs-gct-prod-20260425045301534100000007/jenkins-x/logs/greencapitaltrade/jarvis/main/103.log completedTimestamp: "2026-07-12T07:20:36Z" context: release gitBranch: main gitOwner: greencapitaltrade gitRepository: jarvis gitUrl: https://github.com/greencapitaltrade/jarvis.git lastCommitMessage: | fix(jarvis-lib): isolate tests from Redis with fakeredis, drop dead root param jarvis_lib/tests called queue.enqueue()/claim() directly. Those functions now talk to Redis via get_redis(), which reads REDIS_URL from the environment -- so any test run where that var points at production (this sandbox can reach it directly) wrote real org/fury and test_pool tasks into prod Redis, where they looped forever on 404s from the stale-recovery loop. Add bin/jarvis_lib/tests/conftest.py: an autouse fixture that patches every module-level get_redis binding (redis_client, queue, ratelimit, and jarvis_daemon's own import) to a fakeredis.FakeRedis, so no test path can reach a real Redis instance regardless of REDIS_URL. Verified isolation holds even when REDIS_URL points at an unreachable host. Wire bin/jarvis_lib/tests/ into the PR pipeline (previously only bash tests/ ran; jarvis_lib's pytest suite was never exercised in CI at all) and install fakeredis + lupa (Lua-scripting backend fakeredis needs for the claim/acquire scripts) via pip in that step. Remove the dead `root` parameter from queue.py's public functions (enqueue, claim, find_duplicate, update_duplicate_context, dead_letter, recover_stale) -- it was already unused (the module said so), and tests were passing a tempdir believing it provided isolation. Update all callers in jarvis_workers.py and jarvis_daemon.py to match. While fixing the callers, found _has_queued_task() (WorkerPool) still globbed a dead filesystem path left over from the earlier filesystem->Redis queue migration, so it always returned False -- the stale-working sweep and backstop orphan scan could never see an already-queued task. Added queue.has_task_queued() (checks the dedup hash + processing hash) and wired _has_queued_task() to it; this is what the ticket-named test_stale_working_sweep.py failures were actually catching. Rewrote test_queue.py and test_ratelimit.py's assertions, which still checked a pre-Redis filesystem layout (pool directories, rate_limit.json) that hasn't existed since queue.py/ratelimit.py moved to Redis; they now assert against the real Redis key layout documented in queue.py. Not in scope here (flagged for a follow-up ticket): _execute_task's completion path (_handle_exit_code) still references the same dead processing-directory filesystem path when "deleting" a claim after a task finishes, retries, or is dropped as stale/duplicate -- so jarvis:processing: entries are never actually released on completion, and are only ever cleared by recover_stale() reclaiming them back onto the queue after the staleness window. Two test_shutdown.py/test_workers.py process-group-signal tests remain failing/flaky; verified via git stash that both predate this change and are unrelated to Redis. Co-Authored-By: Claude Sonnet 5 lastCommitSHA: 8760dd66d58676e02670b5942330eb7a2de9c131 message: 'Tasks Completed: 1 (Failed: 0, Cancelled 0), Skipped: 0' pipeline: greencapitaltrade/jarvis/main releaseNotesURL: https://github.com/greencapitaltrade/jarvis/releases/tag/v0.15.8 startedTimestamp: "2026-07-12T07:08:48Z" status: Succeeded steps: - kind: Stage stage: completedTimestamp: "2026-07-12T07:20:36Z" name: from build pack startedTimestamp: "2026-07-12T07:12:12Z" status: Succeeded steps: - completedTimestamp: "2026-07-12T07:12:13Z" name: Git Clone startedTimestamp: "2026-07-12T07:12:12Z" status: Succeeded - completedTimestamp: "2026-07-12T07:12:15Z" name: Next Version startedTimestamp: "2026-07-12T07:12:13Z" status: Succeeded - completedTimestamp: "2026-07-12T07:12:20Z" name: Jx Variables startedTimestamp: "2026-07-12T07:12:15Z" status: Succeeded - completedTimestamp: "2026-07-12T07:15:00Z" name: Build Test startedTimestamp: "2026-07-12T07:12:20Z" status: Succeeded - completedTimestamp: "2026-07-12T07:15:00Z" name: Check Registry startedTimestamp: "2026-07-12T07:15:00Z" status: Succeeded - completedTimestamp: "2026-07-12T07:18:57Z" name: Build Container Build startedTimestamp: "2026-07-12T07:15:01Z" status: Succeeded - completedTimestamp: "2026-07-12T07:19:19Z" name: Promote Changelog startedTimestamp: "2026-07-12T07:18:57Z" status: Succeeded - completedTimestamp: "2026-07-12T07:19:22Z" name: Promote Helm Release startedTimestamp: "2026-07-12T07:19:19Z" status: Succeeded - completedTimestamp: "2026-07-12T07:20:02Z" name: Promote Jx Promote startedTimestamp: "2026-07-12T07:19:22Z" status: Succeeded - completedTimestamp: "2026-07-12T07:20:36Z" name: Publish Org Kb startedTimestamp: "2026-07-12T07:20:02Z" status: Succeeded - kind: Promote promote: environment: production pullRequest: pullRequestURL: https://github.com/greencapitaltrade/mcu/pull/4727 startedTimestamp: "2026-07-12T07:19:59Z" status: Succeeded startedTimestamp: "2026-07-12T07:19:59Z" status: Succeeded version: 0.15.8 status: {}