issueflow-reconcile — the board discriminator is .pull_request == null, not has(), or this forge has no issues (#210) #211

Merged
andres merged 4 commits from build/210-discriminator into main 2026-08-05 15:49:31 +00:00
Showing only changes of commit 5b78d29201 - Show all commits

View file

@ -1852,23 +1852,44 @@ check "...and the sweep still completes" 0 "" \
# The THIRD site is reconcile_issue_pass's per-issue payload check. Same key, # The THIRD site is reconcile_issue_pass's per-issue payload check. Same key,
# scalar rather than a list: null means issue, an object means PR. # scalar rather than a list: null means issue, an object means PR.
# The scalar site, driven through the REAL path rather than through the jq # THE SCALAR SITE, ISOLATED. `BOARD_RECORDS` filters an object-valued row out
# expression it contains — asserting the expression in isolation is what let # of the LIST before the per-issue guard ever sees it, so a board fixture alone
# the regression through (@codex-reviewer-andresmgsl, #210 review). Same board # cannot prove the scalar stand-down (@codex-reviewer-andresmgsl, #210 review).
# harness, one row flipped: null-valued reconciles, object-valued stands down. #
# The fixture that isolates it: the LIST row is null-valued, so the board
# gather admits it — and the INDIVIDUAL payload the sweep then fetches is
# object-valued. Only reconcile_issue_pass's own guard can stand that down.
printf '%s\n' \ printf '%s\n' \
'[{"number":64,"pull_request":{"merged":false},"labels":[],"title":"a PR wearing an issue row"}]' \ '[{"number":65,"pull_request":null,"labels":[],"title":"list says issue, payload says PR"}]' \
>"$FORGEJO_BOARD/repos_owner_repo_issues_state_open.json" >"$FORGEJO_BOARD/repos_owner_repo_issues_state_open.json"
jq -n --arg at "$(iso_at "$INOW")" \ jq -n --arg at "$(iso_at "$INOW")" \
'{number:64,user:{login:"triage-one"},created_at:$at,body:"", '{number:65,user:{login:"triage-one"},created_at:$at,body:"",
pull_request:{merged:false},labels:[],assignees:[]}' \ pull_request:{merged:false},labels:[],assignees:[]}' \
>"$FORGEJO_BOARD/repos_owner_repo_issues_64.json" >"$FORGEJO_BOARD/repos_owner_repo_issues_65.json"
printf '[]\n' >"$FORGEJO_BOARD/repos_owner_repo_issues_64_comments.json" printf '[]\n' >"$FORGEJO_BOARD/repos_owner_repo_issues_65_comments.json"
fjb3_out="$(forgejo_board_run)" fjb3_out="$(forgejo_board_run)"
check "an object-valued row is not reconciled as an issue by the pass" 1 "" \ check "the per-issue guard stands down an object-valued payload" 1 "" \
grep -qE '^issueflow: #64' <<<"$fjb3_out" grep -qE '^issueflow: #65: needs-triage' <<<"$fjb3_out"
check "...and the sweep reports the board as empty of ISSUES, correctly" 0 "" \ check "...and the sweep still completes" 0 "" \
grep -qF 'issueflow: no open issues.' <<<"$fjb3_out" grep -qF 'issueflow: reconciled.' <<<"$fjb3_out"
# The same fixture with a null-valued payload MUST reconcile — otherwise the row
# above would pass on a guard that stands everything down.
jq -n --arg at "$(iso_at "$INOW")" \
'{number:65,user:{login:"triage-one"},created_at:$at,body:"",
pull_request:null,labels:[],assignees:[]}' \
>"$FORGEJO_BOARD/repos_owner_repo_issues_65.json"
fjb4_out="$(forgejo_board_run)"
check "...while a null-valued payload at the same site reconciles" 0 "" \
grep -qE '^issueflow: #65: needs-triage' <<<"$fjb4_out"
# And the GitHub shape — key absent entirely — is still an issue.
jq -n --arg at "$(iso_at "$INOW")" \
'{number:65,user:{login:"triage-one"},created_at:$at,body:"",labels:[],assignees:[]}' \
>"$FORGEJO_BOARD/repos_owner_repo_issues_65.json"
fjb5_out="$(forgejo_board_run)"
check "...and a github-shaped payload (key absent) reconciles too" 0 "" \
grep -qE '^issueflow: #65: needs-triage' <<<"$fjb5_out"
# -- the rule is pinned at the source, because a comment did not hold -------- # -- the rule is pinned at the source, because a comment did not hold --------
# `.pull_request == null` is stated in this file's own header AND at # `.pull_request == null` is stated in this file's own header AND at