fix: skip anti-pattern scan if already scanned today - #76
catastrophe-brandon wants to merge 5 commits into
Conversation
Check the memory server for existing test-scan tasks with today's date before producing a "start" result. Prevents redundant agent sessions (and wasted tokens) when the pod restarts within the same day. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #76 +/- ##
=========================================
Coverage ? 79.10%
=========================================
Files ? 10
Lines ? 1168
Branches ? 0
=========================================
Hits ? 924
Misses ? 244
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The `in` operator could false-positive if a repo name contained a date string matching today. Using endswith on the trailing date segment of the external_key prevents this. Also removes stray f-string prefix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Note: This fix should only be necessary until OpenShift-Fleet/rehor#428 is reviewed, approved, and merged. |
Matches the renamed source type in the rehor framework -- keda_scheduled exits after one cycle (letting KEDA handle scheduling), while scheduled preserves the existing loop-with-sleep behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
karelhala
left a comment
There was a problem hiding this comment.
Found one deployment-blocking issue with the new runner source.
| @@ -1,5 +1,5 @@ | |||
| workflow: ./workflows/quality-monitor | |||
| source: scheduled | |||
| source: run_and_exit | |||
There was a problem hiding this comment.
run_and_exit requires runner support that is not present in the pinned dev-bot submodule commit 47f7a53. This setting is therefore ignored, so the bot continues looping instead of executing one KEDA-triggered cycle. Update dev-bot to a commit containing rehor#428, or retain source: scheduled until that dependency is available.
|
/retest |
Summary
02-scan-test-anti-patterns.pythat queries the memory server for existingtest-scan:*:{today}tasks before producing astartresultskipinstead ofstart, preventing a redundant agent session (~$0.24/cycle wasted on a no-op)Test plan
test_skips_when_already_scanned_today)