Review an agent's change stack

A change stack is generated only for runs at a station with diffs set, on a line that points at a repository. The built-in Review line's Review station has it. For a Delivery task, set diffs = true on the station whose work you want to review, such as Implementation, as in Change a line's stations.

Open the stack

Open it in one of these ways:

  • On the task page, select Changes under Properties. It shows the lines added and removed, and opens the task's change stack page, with the newest stack of each repository.
  • On the task's pull request, open the Change stack comment and follow open the change stack in Spotlight. This opens the same page, on the pull request's repository.
  • On a run's page, add /changes to the end of the address. This opens the stack of that run in particular.

Right after a run, the page reads Generating the change stack for a short while. If it reads Sorry, the change stack couldn't be generated, review the diff on the pull request instead; the message under it says why, or reads Generation stopped before it finished. when Spotlight has no reason.

When the task changed more than one repository, pills at the top name each one. Select a repository to switch to its stack.

Read it in order

The left pane lists cohorts, each a group of hunks that belong together, and under each cohort its layers, numbered in the order to read them. Point at a cohort's title to see what it is for and how much it changes. When that text starts with Incidental, the cohort contains hunks kept apart from the main work, such as formatting, and its files start collapsed.

Select the first layer. The right pane shows its title, a summary, and the files it touches, each with Spotlight's note on what the layer does to that file. Files with more than 800 changed lines start collapsed; select a file's name to open or close it, or use Collapse all and Expand all. When you reach the end of a layer, the buttons at the bottom take you to the previous or next one.

Answer the questions

Some layers end with Check your understanding: questions on what the layer does. Write your answer in Your answer… and select Check, or select I don’t know. Spotlight grades the answer Right, Partly right or Missed, says why, shows the Expected answer, and links the places in the code that answer the question.

When an answer is not right, the layer is marked Read again in the left pane. You answer each question once for a task's repository: the answer stays with later stacks of that repository while the question and its expected answer stay the same.

After a push to the pull request

When a person pushes to the task's pull request, Spotlight makes a new stack from the pull request's diff at the pushed commit. The page then shows Pushed by and the GitHub account of the person who pushed. Point at it to see the commit.

The new stack is made from the stack before it:

  • A layer that changed is marked Changed, and a new layer New. Point at the mark for what it means.
  • Layers that the new stack no longer has are listed under Removed since the previous stack.
  • When a question's expected answer changed, your earlier answer stays under it with the note The code changed after you answered. Please answer again. Answer it again to have it graded.

Spotlight makes a stack for a push only when the task already has a stack for that repository, and not for its own pushes: the agent's runs make those stacks. A runner of the line reads the push, so the line's runners must be able to reach the repository.

After several pushes in a short time, the page ends on the stack of the latest push. When no runner reads a push within an hour, Spotlight makes no stack for that push.

Check results

If the station also has a check command, the results are on the pull request's Change stack comment, not on this page. Each layer that failed the check is marked does not build, and layers still being checked are marked checking. A line under the list names the command, and says why if the layers could not be checked on their own. To set a check up, add check to the station as in Change a line's stations.

Comment on lines

Point at a line in a file's diff and select the + beside its number, or drag across line numbers to comment on a range. Write in the box that opens, then select Add to review (or press Ctrl+Enter, or Cmd+Enter on a Mac). To comment on a whole file, select Comment on this file at the right of the file's name. To answer Spotlight's note on a file, select Reply… under it.

A new comment is a Draft: only you see it until you finish the review. Your own comments carry Edit and Delete.

Finish the review

Select Finish review at the top right. The number beside it counts your drafts in the repository shown. A run that changed several repositories has a review for each: choose the repository at the top right first.

Write a summary in Leave a summary (optional) if you want one.

Choose Comment, Approve or Request changes. A comment or a request for changes needs a summary or at least one draft.

Select Submit review.

The review goes to the task's pull request, with your line comments on their lines. Spotlight posts it as you when it can act for your GitHub account, and otherwise as the Spotlight App, signed with your name. GitHub does not let an account approve or request changes on a pull request it opened itself; in that case the review is posted as a comment that starts with your verdict.

Each comment's label follows it: On GitHub once posted (select it to open the comment there), Sending to GitHub while it is being posted, Posts when the pull request opens while the task has none yet, and Not posted to GitHub if posting failed. Point at Not posted to GitHub to see why.

Reply to a comment

Under a comment that has been submitted, select Reply…, write, and select Reply. A reply is not a draft: it goes to the pull request straight away.

Question a decision

If the station has decisions set, the agent's recorded decisions appear beside the files they concern, marked Decision, each with the reason the agent gave. Detailed reasoning steps opens the steps of the run the decision rests on.

To dispute one, select Reply… under the decision, say why you disagree, and select Reply. Your objection appears under the decision on the pull request's decisions comment, and the next run on the task is told about it in its briefing.

On this page