fix(apiserver): job_status notnull filter matches every job (bug-1504)

`xcecli jobs list -a` returned "no job found" even when jobs existed.
FilterRows routes every condition on a bitmask field (job_status /
host_status) to MatchesBitmaskCondition, which only implemented OpEQ/OpNE
bitmask semantics — the `-a` filter compiles to `job_status notnull`
(OpNOTNULL), which fell through to `return false` and filtered out every
job. (The default list's `notin(EXIT,DONE)` is compiled to OpEQ(mask), so
it was unaffected.)

Add OpISNULL/OpNOTNULL branches to MatchesBitmaskCondition that test the
raw field value. New query_test.go: 3 regression tests (notnull matches
all, null matches none, bitmask notin path unaffected), RED->GREEN.
Verified live: `xcecli jobs list -a` now lists all jobs including DONE.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
lei.chen 2026-08-05 01:43:07 +00:00
parent 60ebf4af72
commit c630809116
4 changed files with 116 additions and 1 deletions

View file

@ -14797,5 +14797,24 @@
],
"occurrences": 1,
"last_seen": "2026-08-05"
},
{
"id": "bug-1504",
"timestamp": "2026-08-05",
"error_message": "xcecli jobs list -a \u8fd4\u56de \"no job found\"\uff08\u5e94\u663e\u793a\u5168\u90e8\u4f5c\u4e1a\u542b\u5df2\u5b8c\u6210\uff09\uff1b\u9ed8\u8ba4\u5217\u8868\u53ea\u663e\u793a RUN \u4f5c\u4e1a",
"file": "src/frontend/apiserver/store/query.go (MatchesBitmaskCondition) + query_test.go",
"root_cause": "FilterRows \u628a bitmask \u5b57\u6bb5 (job_status/host_status) \u7684\u6240\u6709\u6761\u4ef6\u90fd\u8def\u7531\u5230 MatchesBitmaskCondition\uff0c\u4f46\u8be5\u51fd\u6570\u53ea\u5b9e\u73b0 OpEQ/OpNE \u7684\u4f4d\u63a9\u7801\u8bed\u4e49\u3002 \u751f\u6210\u7684 (OpNOTNULL) \u843d\u5165 -> \u6240\u6709\u4f5c\u4e1a\u88ab\u8fc7\u6ee4\u3002\u9ed8\u8ba4\u5217\u8868\u7684 notin(EXIT,DONE) \u88ab\u7f16\u8bd1\u6210 OpEQ(mask) \u6240\u4ee5\u4e0d\u53d7\u5f71\u54cd\u3002",
"fix": "MatchesBitmaskCondition \u589e\u52a0 OpISNULL/OpNOTNULL \u5206\u652f\uff0c\u76f4\u63a5\u5728\u539f\u59cb\u5b57\u6bb5\u503c\u4e0a\u5224\u7a7a\u3002\u65b0\u589e query_test.go 3 \u4e2a\u56de\u5f52\u6d4b\u8bd5\uff08notnull \u5168\u5339\u914d / null \u7a7a\u5339\u914d / notin \u4f4d\u63a9\u7801\u8def\u5f84\u4e0d\u56de\u5f52\uff09\uff0cRED->GREEN \u9a8c\u8bc1\u3002",
"tags": [
"apiserver",
"xcecli",
"jobs-list",
"filter",
"bitmask",
"notnull"
],
"related_bugs": [],
"occurrences": 1,
"last_seen": "2026-08-05"
}
]