GitHub events

GitHub reaches Spotlight through the Spotlight GitHub App. Each delivery is routed to the workspace that connected the App installation it came from, and read into happenings. Lines react to happenings with their reactions; see spotlight_line.

Happenings

GitHub eventConditionHappeningSpoken
pull_requestaction opened, reopened or ready_for_reviewgithub.pull_request.openedno
pull_requestaction labeled, with a label namegithub.pull_request.labelledno
pull_requestaction closed, mergedgithub.pull_request.mergedno
pull_requestaction closed, not mergedgithub.pull_request.closed-unmergedno
pull_request_reviewreview state changes_requestedgithub.pull_request.changes-requestedyes
pull_request_reviewaction submitted, any other stategithub.pull_request.commentedyes
issue_commentaction createdgithub.pull_request.commentedyes
pull_request_review_commentaction createdgithub.pull_request.commentedyes
any of the four rows abovethe comment or review contains @also github.pull_request.mentionedyes
check_suiteaction completed, conclusion failuregithub.checks.failedno

A spoken happening carries the words of the comment or review, with the file and lines it is about where there are any. Those words can answer a task that awaits review; see Moves.

Each happening also has a label and a line of text written to the task's notes when the delivery carries no words:

HappeningLabelText
github.pull_request.openedPull request openedA pull request was opened for review.
github.pull_request.mergedPull request mergedThe pull request was merged.
github.pull_request.closed-unmergedPull request closed unmergedThe pull request was closed without being merged.
github.pull_request.changes-requestedChanges requestedChanges were requested on the pull request.
github.pull_request.commentedPull request commented onThe pull request was commented on.
github.pull_request.mentionedMentioned on a pull requestSomebody mentioned Spotlight on the pull request.
github.pull_request.labelledLabelled on a pull requestSomebody labelled the pull request for Spotlight.
github.checks.failedChecks failedThe checks failed on the pull request.

An installation delivery with action deleted disconnects the workspace from GitHub.

Deliveries from bots

A delivery counts as a bot's when its sender, comment author or review author has GitHub user type Bot. The happenings a bot's delivery raises are dropped, except github.pull_request.opened and github.pull_request.labelled. Spotlight adds no labels, so a label a bot adds is never Spotlight's own.

Marks

MarkHeld byValue
git.pull-requestThe task that opened the pull request, from the moment it opens.The pull request's URL.
github.reviewThe task that reviews the pull request.The pull request's URL.

Both are finding marks. A mark belongs to at most one task in a workspace.

How a happening finds its task

A happening names what it concerns: a branch, marks, or both.

ConcernTaken fromFinds
Branch spotlight/<taskId>The pull request's head branch, or the check suite's head branch.The task with that id.
git.pull-request markThe pull request's URL.The task that opened the pull request.

Every happening except opened, mentioned and labelled that names a pull request is also sent a second time, concerning the github.review mark of that pull request. The task that holds that mark hears it.

A branch outside spotlight/ finds no task by its name. A delivery that names neither a branch nor a pull request is refused.

Review tasks

github.pull_request.opened, github.pull_request.mentioned and github.pull_request.labelled ask for a review. A labelled happening carries the label's name, and a line takes it only if that name, without regard to case, is its review policy's label. Spotlight chooses a line that:

  • has role review;
  • has no repositories, or names the pull request's repository;
  • has a review policy (reviews) that takes the pull request.

Lines that name the repository come first, then lines in order of key.

If an unfinished task already holds the pull request's github.review mark, that task hears the happening. Otherwise a new task opens on the chosen line:

PropertyValue
StationThe line's first work station.
TitleThe pull request's title.
DescriptionReview <url>, then the pull request's description.
Markgithub.review with the pull request's URL.

A line's review policy (reviews) decides which pull requests it takes. See Review policy fields.

Built-in tools

The pull-request, review-comment and review tools are described in Built-in tools and skills.

Installation callback

After the App is installed, GitHub sends the browser to /github/installed on the Spotlight address, with these query parameters:

ParameterValue
installation_idThe installation's id.
setup_actionrequest when an organisation owner still has to approve the App.
stateThe workspace and team the install started from, set by Spotlight.

The page connects the installation with POST /api/workspaces/{slug}/github, body {"installationId": "<id>"}.

StatusWhen
204Connected.
403Not an owner or admin, or not an installation the person administers.
409The installation is already connected to another workspace.

One installation connects one workspace. The connection covers every team in the workspace. See GitHub connection for who may connect.

On this page