Show queue length in show-*-queue targets - #722
Conversation
PR Summary by QodoShow queue length in show-*-queue Makefile targets
AI Description
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
7 rules 1. LLEN failure masked
|
| define show_queue | ||
| @echo "=== $(1)_todo (ymir_todo, priority — popped first) ===" | ||
| @oc exec deployment/valkey -- valkey-cli --raw LRANGE $(1)_todo 0 -1 | jq -r '(.metadata.jira_issue // .metadata.issue // empty) | if type=="object" then (.key // empty) else . end' | $(TAC) | ||
| @echo "length: $$(oc exec deployment/valkey -- valkey-cli --raw LLEN $(1)_todo)" |
There was a problem hiding this comment.
1. Llen failure masked 🐞 Bug ☼ Reliability
The new length lines run oc exec ... LLEN inside echo $$(...), so if oc exec/valkey-cli fails the recipe still exits successfully and can print an empty/partial length. This undermines the Makefile’s intent to surface oc exec failures and can mislead operators when the length query fails but the target appears to succeed.
Agent Prompt
### Issue description
The queue length is printed via `echo "length: $$(oc exec ... LLEN ...)"`. In bash, `echo` typically returns success even if the command substitution fails, so `oc exec`/`valkey-cli` errors can be masked and the make target can appear successful while printing an empty/incorrect length.
### Issue Context
This Makefile explicitly sets bash + `pipefail` to avoid masking failures in `oc ... | jq | tac` pipelines, but the new `LLEN` calls are not pipelines and therefore don’t benefit from that protection.
### Fix Focus Areas
- openshift/Makefile[13-28]
### Suggested change
Replace the command substitution with a form that returns the `oc exec` exit status, e.g.:
- `@printf 'length: '; oc exec deployment/valkey -- valkey-cli --raw LLEN $(1)_todo`
- `@printf 'length: '; oc exec deployment/valkey -- valkey-cli --raw LLEN $(1)`
- `@printf 'length: '; oc exec deployment/valkey -- valkey-cli --raw LLEN $(1)`
(or `@echo -n 'length: '; oc exec ...`), applied consistently to all three added length lines.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
majamassarini
left a comment
There was a problem hiding this comment.
LGTM. I think we can live even without length output.
Assisted-by: Claude Opus 4.6
2d4fb1a to
74a5dd6
Compare
No description provided.