Skip to content

slash-commands: label cleanup + project status on /lgtm accept#17

Merged
localden merged 1 commit into
mainfrom
den/lgtm-accept-cleanup
Mar 28, 2026
Merged

slash-commands: label cleanup + project status on /lgtm accept#17
localden merged 1 commit into
mainfrom
den/lgtm-accept-cleanup

Conversation

@localden

Copy link
Copy Markdown
Contributor

Summary

When /lgtm (or /lgtm force) accepts a PR, optionally:

  • Remove staging labelsremove-labels-on-accept input takes a
    comma-separated list (e.g. in-review,draft,proposal). Missing
    labels are silently ignored.
  • Move the PR to Accepted in an org Projectproject-number
    input enables this. Resolves the project, its Status single-select
    field (configurable via project-status-field), and the Accepted
    option (configurable via project-accepted-option). Adds the PR to
    the project if not already present, then sets the field.

Both are opt-in — defaults are empty, so existing callers are unchanged.
Project update failures are warned, not thrown, so a missing permission
or misconfigured project doesn't block the approval flow.

New App permission required for project updates: Organization
Projects (write).

Test plan

  • Point spec repo workflow at @den/lgtm-accept-cleanup with
    remove-labels-on-accept: in-review,draft,proposal and the SEP
    Review Pipeline project number
  • /lgtm force on a PR with in-review label → label removed,
    accepted added, PR moved to Accepted in the project
  • /lgtm without project-number set → no project calls, labels
    still cleaned up
  • /lgtm with wrong project-number → warning logged, approval
    still succeeds

When /lgtm (or /lgtm force) accepts a PR:

- Remove configurable staging labels (remove-labels-on-accept input,
  e.g. in-review,draft,proposal). Missing labels are ignored via the
  existing 404-tolerant removeLabel helper.
- Move the PR to a configured status in an org-level Project V2
  (project-number / project-status-field / project-accepted-option
  inputs). Resolves project, field, and option IDs via GraphQL, adds
  the PR to the project if not already present (addProjectV2ItemById
  is idempotent), then sets the single-select field. All optional —
  project update is skipped when project-number is empty.

Requires the GitHub App to have Organization Projects:write for the
project update. Failures are non-fatal (warned, not thrown) so a
misconfigured project doesn't block the approval.

:house: Remote-Dev: homespace
@localden
localden merged commit 0d800ff into main Mar 28, 2026
2 checks passed
localden added a commit to modelcontextprotocol/modelcontextprotocol that referenced this pull request Mar 28, 2026
When /lgtm accepts a PR:
- Remove the in-review, draft, and proposal labels
- Move the PR to the Accepted column in the SEP Review Pipeline
  project (org project #12)

Depends on modelcontextprotocol/actions#17. Requires the MCP Commander
App to have Organization Projects:write permission.

:house: Remote-Dev: homespace
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