Skip to content
trawler
Use Trawler

Plans for pull requests

A plan describes what the product does, not what one pull request changed. For a pull request, Trawler makes a plan of its own: it reads the pull request’s title, description and the paths of the files it touches, and a model called the lead chooses which of the plan’s people should try what the change means for a user, writes their new goals, and tells them in a few sentences what changed and what it should now do. A run for the pull request plays that plan and nothing else, unless you ask for more.

The people never see the pull request. They know what the lead tells them, and they get ordinary goals, phrased as outcomes, such as the invoices of last month are downloaded as one CSV file.

A run is planned for a pull request when it is started with a pull request that has a title, a description or changed files, and a plan mode other than regression. trawler-ci reads these from GitHub Actions; the Run API takes them in pullRequest. Without them, or from the app’s Start run, a run is not planned for a pull request, and its run page has no block about one.

--plan-mode of trawler-ci, or planMode of the API, says how the lead’s goals are used:

Mode The run plays
change, the default Only the lead’s goals, and only the people they belong to. At most as many people as the workspace’s plan allows in a run.
both The project’s plan as it is, and the lead’s goals added after it. The goals go to the people the lead chose.
regression The project’s plan as it is. The pull request is recorded with the run, and the lead is not asked.

Use change for a run on the change alone, both to keep checking the whole product while testing the change, and regression for the usual run.

The lead is a model that runs on Trawler’s own model, as setup does, with a budget of $0.10. It is paid by Trawler: its calls do not count toward the run’s cap, its cost, or the workspace’s monthly budget. It is given:

  • the pull request’s title and description, and the paths of the files it changed;
  • the description of the CI setup, if the repository has one;
  • the product’s features, as its plan lists them;
  • the plan’s people, with their briefs and the name of the test account each signs in with, if any — never a password;
  • the goals the project’s own plan plays, so as not to repeat them;
  • for a hosted run, the text of the product’s front page.

The pull request’s text, the description of the setup and the page are given to it as data, not as instructions: they cannot change who the people are, which accounts they use, which addresses may be visited, the cap or the model. The lead only chooses among the plan’s people, writes goals and a brief, and decides how people get their accounts.

It works out which feature the change touches and answers with turns, in the order the people play them: for each, a person and, it is told, 1 to 3 new goals. Trawler keeps at most 8 goals in all, each up to 300 characters. A person can have several turns, and when a goal needs something another person does first, that person’s turn comes before it. When people need an account to use the product, the lead starts with a short goal about getting in, so the plan does not lean on the sign-in check of the project’s plan. When trying the change needs something that may not exist yet — a board, a record, a member, a request waiting for a decision — it starts with a short preparation goal for the person whose role can create it, so the goals for the change find it; it keeps that to what the change needs, and with a description of the CI setup it knows what the setup may already have. A change that no user could see or do — documentation, tests, build files, a refactoring — gets no turns; see When nothing can be tested.

A goal may say what the change should do, in a user’s words: after Ola approves Kuba’s request, the charge no longer counts in the monthly total. It is dropped when it gives away the pull request: when it contains an address or a # number, names a changed file or a component, or uses a name from the code that the pull request quotes. A goal that would take a person past the limit of 20 goals, or past 240 goals in all, is dropped too.

Before the people start, the run waits for the lead. Its Timeline reads What this run checks with Trawler is reading PR #42 to choose who tries what. The run’s goals then include the lead’s — and in change mode its people are only those the goals belong to — and the people begin. If the lead takes more than 6 minutes the run goes on without it.

The lead marks one goal as the change’s promise: the main thing it promises a user, played as a user would use it. It is always in the plan, and early.

Most defects are in what a pull request does not list, so the lead also works out untried cases from what the change does, and gives each a goal:

  • Input checks. When the change checks what a user enters, the kinds of value the description does not name.
  • Decisions. When the change has more than one outcome, such as accept or refuse, each outcome, and after it the next thing a user would do with the same item.
  • Repeats. When something can be done more than once, doing it again after something changed since the first time.
  • Layout. When the change touches layout, the longest text a user would realistically enter, on a phone-width screen as well.

An untried case is written as what to try to break and what must still hold, not as a value to type, and it uses only what the product already offers. When goals run short, the promise goal stays, then the untried cases, and other cases the pull request lists are left out. A plan with no promise goal, or with goals but no untried cases, is asked for again.

With its goals the lead writes a brief, up to 1,200 characters in a user’s words, in three short parts: what changed; what it should do, only as far as the pull request promises it, with any limits it gives; and where to look for trouble, in one or two hints without the values to type. A brief that names a file, a component or an address is dropped, as a goal would be, and the run goes without one.

Every person of the run is given the brief before they start. They are told it describes the change, and is not instructions about how to work: it cannot change their account, their goals or where they may go. They treat it as what the change promises. When the product does not do what the brief says, that is a defect, even where the product’s own words promise nothing. The judge reads the brief too, and counts a result or detail it says the change should give as promised. The people who replay a defect are not given it: a replay is blind.

The run page shows the brief, see What the run page says.

A run for a pull request can bring accounts from the CI job, see Accounts from the CI job. The lead decides how people get accounts:

  • Everyone uses the account they have. This is the answer for nearly every pull request, and whenever the lead is unsure. Everyone who has an account, stored on the plan or handed over by the job, signs in with it, and all the effort goes to the change.
  • The people the lead names sign up or are invited for real. The lead answers so only when the pull request’s title, description or changed file paths clearly show that it changes how people sign up, sign in, are invited, reset their passwords, or get roles or permissions. It names who goes through that flow, and writes at least one goal for each of them about getting access, such as a new colleague joins the team and sees its workspace. A named person who would sign up on the plan then signs up in the run, instead of signing in with the account the job made. Everyone else keeps their account with everything it already has, so an owner who has to invite someone still signs in as that owner. People who have to sign in on the plan always keep their accounts. When the lead names nobody who can sign up, everyone uses the account they have.

The run page says when the second happens: This pull request touches how people get accounts, so Daniel goes through the real sign-up instead of using the CI account. Hover over the line to read the lead’s reason. When everyone uses the account they have, the page says nothing more than which people sign in with accounts from the job.

In change mode, a run that the lead gave no goals does not start. Its run page is headed Nothing to test in the UI. and says why under the heading. It has no tabs, and its details are shown directly:

Where It says Why
Under the heading, and the comment Nothing in this change can be tested through the product’s UI, so Trawler did not start a run. Nothing a user could see or do changes, or none of the lead’s goals survived.
Under the heading, and the comment This change cannot be seen in the app as CI runs it, so Trawler did not start a run. and a sentence on what is missing The change can only be seen with something the description of the CI setup says is not there: a licence, a mail server, an outside service.

Such a run spends nothing on your model key, though it still counts as one of the workspace’s runs of the day. It is listed as Skipped: nothing to test in the UI in the run lists and is not under Needs attention. trawler-ci passes the job and posts the comment. In both mode the project’s plan still runs, with a line saying the lead found nothing; see When the lead cannot plan.

Trawler keeps what the lead answered, as the plan of that pull request: one for each plan of a project, repository and pull request number, named PR #42 with a version, such as PR #42 · v2. In change mode the run is a run of that plan, and its page names it, Plan: PR #42 v2.

  • A later run for the same pull request reuses it, without asking the lead, while the pull request’s title, description and list of changed files are as they were when the plan was made, and so is the description of the CI setup. A change of whitespace or of the order of the files does not count. The people and accounts are copied from the project’s plan as it is now, so a change to their briefs or accounts since is in the run.
  • When the title, description, changed files or the setup description change, the lead is asked again and the new answer is stored as the next version. The old one is no longer used.
  • --replan of trawler-ci, or replan: true, asks the lead again although nothing changed, and stores a new version.
  • A plan is stored only when the lead gave at least one goal. When it gave none, or failed, nothing is stored, and the next run asks again.
  • A plan belongs to its repository and number: another pull request starts from nothing.
  • A project keeps the 30 pull request plans used most recently. A plan beyond them is deleted, unless a run of it is going; the runs that were made from it keep their reports.

The mode is not part of the plan. A plan made by a both run is reused by a change run, and the goals it adds are the same.

A run planned for a pull request shows its title in a line under the heading. The Details tab has the pull request as PR #42 · Add discount codes under Pull request, which opens it, with the repository, the branch and the first seven characters of the commit under it. When the lead added goals, a Pull request plan line under it, such as 3 goals Trawler wrote for PR #42, opens the section below.

The Timeline tab opens with What this run checked — What this run checks while the run is live:

  • one line on where the goals came from: Goals Trawler wrote for PR #42 from its title, description and changed files. Only these run; the project’s own plan does not. in change mode, or Goals Trawler wrote for PR #42, added to the project’s plan, which runs as it is. in both;
  • the lead’s brief as a quote, signed From PR #42, written by Trawler for the people;
  • each person who has a goal from the lead, with the letter and colour they have on the lanes, and their goals numbered in order. A goal whose person is not in the plan is listed under Anyone;
  • a last line naming the stored plan and its version, such as PR #42 v2, which opens the plan the run used, followed by written in this run or reused from Run 0014, which opens that run.

Before the lead has answered, the section says only Trawler is reading PR #42 to choose who tries what. A run that ended before the lead chose any goals says The run ended before Trawler chose goals for PR #42. When no goals were added for another reason, the section shows the line from the table below instead. When the pull request has no number, the lines say the pull request instead of PR #42, and the plan line reads Pull request plan v2. The version line is left out of a plan that was not stored.

In change mode, a lead that found nothing to test ends the run, as above. In every other case the run goes on with the project’s plan as it is, whatever the mode, with a line under What this run checked:

Line Why
Nothing in this pull request points at a feature, so the project’s plan ran as it is. In both mode, the lead found nothing a user could see or do, or none of its goals survived.
The lead could not plan for this pull request (…), so the project’s plan ran as it is. The lead’s model failed. The reason follows, up to 300 characters. When the model provider refuses Trawler’s own key or its account is out of credits, the reason says the model provider refused Trawler’s key; Trawler has been told or Trawler’s model account is out of credits; Trawler has been told.
The lead did not answer in time, so the project’s plan ran as it is. The lead had not answered 6 minutes after the run started.

An answer from an earlier version of the plan is not used instead: when the pull request has changed and the lead fails, the run is the project’s plan alone.

A project’s Pull requests tab, next to Plan and Runs, lists the pull requests that CI runs were started for and holds the plans Trawler made for them. The number beside the tab is the number of pull requests, counted by repository and pull request number. The tab opens with Each pull request gets its own plan, written by the lead from the change and read-only. The project’s own plans run on a pull request only with --plan-mode regression or both.

Below it, a table has one row for each pull request, newest run first, and shows the pull request’s latest run:

Column It says
PR The pull request’s number, such as #42.
Title The pull request’s title, which opens the pull request in a new tab when it has a web address; Pull request #42 when it has no title.
Plan What the latest run played. v2 is the pull request’s own plan, version 2, and opens it. When the run used one of the project’s plans, the column names it and opens it on the Plan tab. A plan that has been deleted is not a link. The column is not shown on a phone-width screen.
Latest run How the run ended, as in the table below.
Run The run, such as Run 0017, which opens it.

A project without a pull request says No pull requests yet. A run your CI job starts for a pull request is listed here.

It says The run
Queued Is waiting to start.
Live Is going now.
3 confirmed Ended Complete with 3 confirmed defects, not counting those marked not a bug and counting reports of the same defect once.
No defect confirmed Ended Complete without a confirmed defect.
Not checked: every replay failed Ended Complete, and the replay of every defect it reported failed before any could be judged.
Stopped at cap · 3 confirmed Ended Stopped at cap; what follows the dot is one of the three results above.
Skipped: nothing to test in the UI Was skipped.
Failed, Stopped Ended that way.

The cell is in bold when the run confirmed a defect, after Stopped at cap · too.

When some pull request plans have no row that opens them — a later run of the pull request played a project plan with --plan-mode regression, say — a line headed Earlier pull request plans lists them below the table, each as PR #42 · v2, or PR #42 (owner/repo) · v2 when two repositories have a pull request with that number.

Choosing a plan opens it under the Pull requests tab, with ← Pull requests above it to go back. It shows its people and what each of them wants, under Made by Trawler from the pull request; it is replaced when the pull request changes., and Runs of this plan, which lists its runs. It is a record: it has no start row, Start run at the top of its page opens the start page for the project’s first plan, and it cannot be edited, renamed or removed from the page.

The Plan tab does not list pull request plans. When the project has some, a line on it reads Pull request plans are written by the lead for each pull request and are read-only. Find them under Pull requests.

On a project’s Runs tab, a pull request plan is also a choice under All plans, for the eight used most recently.

The project’s Home shows the three pull requests whose runs are newest, with All 12 leading to this tab; see A project’s page.