Skip to content

fix(ci): project-sync should not fail when merged PR has no closing keyword#341

Merged
ajianaz merged 1 commit into
developfrom
fix/project-sync-merge-no-closes-keyword
Jul 16, 2026
Merged

fix(ci): project-sync should not fail when merged PR has no closing keyword#341
ajianaz merged 1 commit into
developfrom
fix/project-sync-merge-no-closes-keyword

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Problem

When PR #338 was merged, the sync (project-board) workflow failed with exit 1 — visible as a red check on an otherwise all-green PR.

Root cause

PR #338 referenced its issue via Refs #335 (not Closes #335), so its closingIssuesReferences were empty. That empty case then called get_item_id() under set -e. When the GraphQL response had an unexpected shape (e.g. node: null from a token/permission quirk), the inline python raised TypeError, the function returned non-zero, and set -e aborted the script before the intended exit 0.

A merged PR with no closing keyword is a legitimate, non-error outcome — the script treated it as a hard failure.

Fix

  1. Defensive python in get_item_id() and the LINKED query — use .get() chains and fall back to [] so null/unexpected shapes never raise.
  2. Guarded call sites in the empty-LINKED branch with || true so a missing board item can never abort the job.

The job is already continue-on-error: true (non-critical), but this eliminates the spurious red check entirely.

Testing

  • YAML structure preserved (only inline-script python changed).
  • Logic trace: merged PR with Refs #N → empty LINKED → get_item_id returns "" (no throw) → no set_doneexit 0. ✅
  • Merged PR with Closes #N → LINKED populated → unchanged happy path. ✅

Refs #338

…eyword

A merged PR that references issues via "Refs #N" (not "Closes #N") has no
closingIssuesReferences — a legitimate non-error outcome. Previously the
script could abort with exit 1 under 'set -e' when get_item_id() hit an
unexpected GraphQL response shape (e.g. node: null), surfacing as a red
'sync' check on otherwise-green PRs (e.g. PR #338 merge).

- Make get_item_id() and the LINKED query python defensive against null/unexpected shapes
- Guard the empty-LINKED branch call sites with '|| true' so a missing board item never aborts the job
@ajianaz
ajianaz merged commit 8808b0d into develop Jul 16, 2026
10 checks passed
@ajianaz
ajianaz deleted the fix/project-sync-merge-no-closes-keyword branch July 16, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant