You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(github): project sync's board lookup and field provisioning fail closed on a failed read #1376
scope/githubGitHub Projects v2, Views, Milestones, Labels, and PR automationsource/agentFiled by an agenttype/bugType bug: the code does not do what it must
devops gh project sync still reads the board's fields through _fetch_existing_fields_by_name (github/projects.py). It returns {} when gh project field-list exits non-zero or prints nothing, so sync takes every template field as missing and runs field-create for each. link_project_to_repository turns a failed link into linked=False and drops the error. find_remote_project's reads (_find_project_via_repo, _find_project_via_rest, _find_project_via_cli) treat a failed read as 'not found', so a transient failure can create a duplicate board. #892 made reconcile's field read fail closed (it uses the roadmap store's FieldListingPayload with its totalCount check) but left sync's provisioning and lookup reads as they were.
Proposed remedy
Read the fields through field_list_args and FieldListingPayload, as reconcile does. Raise on a non-zero exit or malformed output in the board lookup, distinguishing 'no such board' from 'could not read'. Report a failed link with gh's error. Sync should then exit 1 instead of guessing. Fold this into #999 if that item takes over sync's provisioning.
Found on 2026-10-08 while implementing #892. Filed directly with no priority; the roadmap service's intake sets Priority, Value and Effort.
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
Priority: P2-Medium. A correctness bug that can create duplicate boards and fields, but only under transient read failures and the damage is recoverable.
Value: Medium. Prevents silent data corruption (duplicate boards/fields) that would require manual cleanup, but only manifests during transient API failures.
Effort: Medium. Requires changing multiple functions (_fetch_existing_fields_by_name, link_project_to_repository, find_remote_project) to raise or report errors instead of returning defaults, and distinguishing 'not found' from 'read failed'.
Linked: #983 and #999. #983's GitHubNotFoundError and GitHubUnreadError are this item's split; #999 keeps provisioning in projects.py, so read fields through the store's fail-closed _read_fields (roadmap/github_store.py:2373), not the builders #999 deletes. Found by the 2026-10-08 backlog review.
Amendment (2026-10-18): two more silent project failures, found in #983 PR 3's review
Both are in base code, not regressions, and they fit this item's "fail closed on a failed read":
Field and link provisioning swallow a missing scope as False. With a token that has read:project but not project, _provision_single_field and link_project_to_repository (src/devops_cli/github/projects.py) return False silently. sync_remote_project on an existing board then reports linked=False and fields_provisioned=[] and raises nothing. Only create_remote_project raises, and then as an unclassified GitHubOperationError. After refactor(github): the github session owns transport, ledger, error classes and link pagination #983 PR 3, route their non-zero gh exits through classify_gh_failure, so a missing scope raises GitHubScopeError naming the scope.
Project listing hides failures, and an @me fallback caches the wrong owner.
_list_projects_via_rest and _list_projects_via_cli (devops gh project list) report any failure as "No GitHub Projects v2 boards found".
After a successful @me fallback, _run_project_cli stores _PROJECT_OWNER_ARG_CACHE[org] = "@me". An organisation owner is then answered with the viewer's boards for the rest of the process.
A failed listing should raise, and the cache should hold @me only for an owner that is the viewer.
scope/githubGitHub Projects v2, Views, Milestones, Labels, and PR automationsource/agentFiled by an agenttype/bugType bug: the code does not do what it must
Activity
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
A correctness bug that can create duplicate boards and fields, but only under transient read failures and the damage is recoverable.Prevents silent data corruption (duplicate boards/fields) that would require manual cleanup, but only manifests during transient API failures.Requires changing multiple functions (_fetch_existing_fields_by_name, link_project_to_repository, find_remote_project) to raise or report errors instead of returning defaults, and distinguishing 'not found' from 'read failed'.dan-petty commentedon Oct 8, 2026
Linked: #983 and #999. #983's
GitHubNotFoundErrorandGitHubUnreadErrorare this item's split; #999 keeps provisioning inprojects.py, so read fields through the store's fail-closed_read_fields(roadmap/github_store.py:2373), not the builders #999 deletes. Found by the 2026-10-08 backlog review.dan-petty commentedon Oct 18, 2026
Amendment (2026-10-18): two more silent project failures, found in #983 PR 3's review
Both are in base code, not regressions, and they fit this item's "fail closed on a failed read":
read:projectbut notproject,_provision_single_fieldandlink_project_to_repository(src/devops_cli/github/projects.py) return False silently.sync_remote_projecton an existing board then reportslinked=Falseandfields_provisioned=[]and raises nothing. Onlycreate_remote_projectraises, and then as an unclassifiedGitHubOperationError. After refactor(github): the github session owns transport, ledger, error classes and link pagination #983 PR 3, route their non-zero gh exits throughclassify_gh_failure, so a missing scope raisesGitHubScopeErrornaming the scope.@mefallback caches the wrong owner._list_projects_via_restand_list_projects_via_cli(devops gh project list) report any failure as "No GitHub Projects v2 boards found".@mefallback,_run_project_clistores_PROJECT_OWNER_ARG_CACHE[org] = "@me". An organisation owner is then answered with the viewer's boards for the rest of the process.@meonly for an owner that is the viewer.fix(github): project sync's board lookup and field provisioning fail …