Skip to content

project-sync.yml: board lookups break at >100 items, stale DONE_OPTION_ID, and set -e silent death #181

Closed

Description

@ajianaz

What

Three defects in .github/workflows/project-sync.yml found on 2026-10-05 while investigating a red sync check on develop 33ef984 (issue #175 close event, run 37290785785):

  1. get_item_id scans only the first 100 project items. The CodeCororaDev Roadmap board currently holds 541 items — any issue whose item sits beyond the first page is never found. The failure then hits the add_to_project fallback, and when the item already exists on the board the script exits 1 with Could not resolve project item for issue #N.
  2. DONE_OPTION_ID is stale. The workflow uses 98236657, but the live Status field options are Backlog=d7cda047, Planned=def9805f, In Progress=347f7471, Testing=26f694ff, Done=35897fb3 (verified via GraphQL on 2026-10-05). Every set_done driven by the old id fails with The single select option Id does not belong to the field.
  3. Silent death under set -e. item_id=$(get_item_id ...) fails inside command substitution; with bash -e the step dies before printing anything — the run log jumps straight from Issue #175 closed — setting Status to Done to Process completed with exit code 1 (~0.9s gap, zero diagnostics).

Why

Net effect (verified live): every issue closed this week has an empty Status on the board (#175, #176, #171, #165, #163, #161, #159, #155, #147, #146, #145, #144, #143, #134, #137, #172) even though the issues are closed. The board no longer reflects reality. The sync check on develop 33ef984 is red from defect 1+3.

Board was repaired manually on 2026-10-05 (all 16 entries set to Done via GraphQL with option 35897fb3); this issue tracks the workflow fix so it stops recurring.

Proposed fix

  • get_item_id: look up from the content side (issue.projectItems / pullRequest.projectItems, first: 50, match project id) instead of scanning board items — O(items-on-content), no pagination trap.
  • set_done: resolve the Done option id by name from the live Status field at runtime; keep the env/vars value only as fallback.
  • Stop swallowing errors on the critical path (2>/dev/null), guard command substitutions with || true so set -e cannot kill mid-lookup, and print the GraphQL error before exiting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions