Skip to content

Prefrontal-cortex sync - PullRequestState integration #4

@jordanpartridge

Description

@jordanpartridge

Overview

Sync PR lifecycle events with prefrontal-cortex cloud.

Events to Track

  • PR created
  • PR updated (commits pushed)
  • PR reviewed
  • PR checked (gate)
  • PR merged
  • PR closed

API Integration

// Sync PR state to cloud
$client->post('/api/pr/sync', [
    'repo' => $this->getRepo(),
    'pr_number' => $prNumber,
    'state' => $state,
    'sha' => $sha,
    'author' => $author,
    'reviewers' => $reviewers,
    'checks' => $checks,
]);

Commands

pr sync                   # Sync all open PRs
pr sync 123              # Sync specific PR
pr sync --push           # Push local state to cloud
pr sync --pull           # Pull cloud state

State Machine (PullRequestState)

Leverages Laravel Verbs state machine in prefrontal-cortex:

  • PullRequestOpened
  • PullRequestUpdated
  • PullRequestReviewed
  • PullRequestChecked
  • PullRequestMerged
  • PullRequestClosed

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