Skip to content

Add project board Status automation and fix duplicate comments#149

Open
edmundmiller wants to merge 4 commits into
mainfrom
claude/zealous-euler-t4ba8b
Open

Add project board Status automation and fix duplicate comments#149
edmundmiller wants to merge 4 commits into
mainfrom
claude/zealous-euler-t4ba8b

Conversation

@edmundmiller

Copy link
Copy Markdown
Contributor

Summary

This PR enhances the proposal approval automation to mirror approval status onto GitHub Project (v2) boards, and fixes a race condition that could create duplicate status comments.

Key Changes

  • Project Board Integration: Added updateProjectStatus() method to automatically set the Status field on the pipelines project board (and optionally RFC/SIG boards) based on approval status:

    • proposed for pending proposals
    • accepted for approved proposals
    • turned-down for rejected proposals
    • timed-out for timed-out proposals
  • Duplicate Comment Fix: Enhanced updateStatusComment() to detect and delete duplicate status comments that can be created by a race condition between the opened event and labeled events fired by issue templates. The method now:

    • Filters comments safely (checking for null body)
    • Keeps the first status comment and deletes any duplicates
    • Continues with normal update logic
  • Workflow Concurrency: Added concurrency configuration to all three approval workflows (pipeline_proposals.yml, rfc_approval.yml, sig_approval.yml) to serialize runs per issue, preventing the race condition that creates duplicate comments

  • Documentation: Added .github/AUTOMATION_SETUP.md with setup instructions for org owners, including:

    • Token permission requirements (project read/write access)
    • Optional issue types configuration
    • Instructions for enabling project board automation on RFC and SIG boards
  • Tests: Added comprehensive test coverage for:

    • Duplicate status comment deletion
    • Null body handling
    • Project status updates with case-insensitive option matching
    • Error handling (best-effort approach)
  • README Updates: Updated documentation to reflect the new project board automation and link to setup instructions

Implementation Details

  • The project status update is best-effort: any errors (missing token scope, unknown option names, missing fields) are logged and swallowed so they don't break the core label/comment automation
  • Status option names are matched case-insensitively with whitespace trimming
  • The implementation uses GraphQL queries to resolve the project, its Status field, and issue node ID, then adds the issue to the board (idempotent) and sets the Status field
  • Requires bot token with organization project read/write permissions (classic PAT project scope or fine-grained Projects → Read and write)

https://claude.ai/code/session_01DGsyWUGbsvfkJDgdcaYLxv

claude added 3 commits June 16, 2026 13:31
The issue templates declare labels (e.g. new-pipeline, proposed) and a
project, so opening a proposal fires the issues 'opened' event plus several
'labeled' events almost simultaneously. With no concurrency control, multiple
approval workflow runs raced and each created its own status comment, leaving
duplicate '## Approval status: Pending' comments (e.g. issue #148).

- Add a per-issue concurrency group to the pipeline, RFC and SIG approval
  workflows so runs for the same issue execute serially instead of racing.
- Make updateStatusComment self-healing: it now deletes any extra duplicate
  status comments and guards against comments with no body.
- Add tests for duplicate cleanup and null comment bodies.
Auto-set the project board Status (project 104) from the pipeline approval
automation, replacing the manual curator step documented in the README:

- Add ApprovalManager.updateProjectStatus(projectNumber, statusOptionName),
  which resolves the project's Status single-select field via the Projects v2
  GraphQL API, ensures the issue is on the board, and sets the option matching
  the approval state (proposed / accepted / turned-down / timed-out). It is
  best-effort: missing project scope, field, option, or board membership is
  logged and swallowed so labels/comments are never affected.
- Wire it into pipeline_proposals.yml at the opened, timed-out and main paths.
- Add tests for the matching, no-op and error-handling behaviour.

Prep native issue types (org-owner action required before merge):

- Add a type: key to the pipeline / RFC / SIG issue-form templates.
- Document the one-time org setup (issue types + bot project scope) in
  .github/AUTOMATION_SETUP.md and reference it from the README.
Issue types are redundant with the existing templates, labels and project
boards, and referencing not-yet-created org types in the templates would break
issue creation. Remove the type: keys and reframe the issue-types section of
the setup doc as an optional, not-currently-enabled enhancement.
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Metric Coverage Status
Statements 96.49%
Branches 89.47% ⚠️
Functions 100%
Lines 96.29%

Tests: 110 statements covered out of 114

🎉 Excellent coverage!

Collapse the numbered list items onto single lines so prettier no longer
emits 3-space continuation indents, which editorconfig-checker rejected
(indent_size = 2 requires left-padding to be a multiple of 2).
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.

2 participants