spotlight_line
The spotlight_line resource, and the line resource of the API: a team's
workflow, made of its stations, the reactions that move tasks between them, and
the repositories its runs work in.
| Kind | Endpoint | Terraform | Address |
|---|---|---|---|
line | /api/v1/resources/teams/{teamId}/lines | spotlight_line | <team key>/<key> |
The request body is the line definition. A read returns teamId, key and
definition, the definition with every default filled in, beside the
common fields. See
Built-in lines for the lines Spotlight opens
for the first team of a workspace created in the web app.
In Terraform, each element of repositories, stations and reactions is a
repository, station or reaction block, and reviews, maintenance, replayCheck, search and
source are reviews, maintenance, replay_check, search and source blocks. Within a station block, judge and search are judge and search blocks, a station's search.agent is an agent block, and each element of
alerts is an alert block.
Example
resource "spotlight_line" "core_delivery" {
team_id = spotlight_team.core.id
key = "delivery"
name = "Delivery"
role = "delivery"
runners = ["vpc-internal"]
default_assignee = "ada@example.com"
repository {
name = "acme/api"
image = "ghcr.io/acme/api-runner:main"
setup = "npm ci"
}
station {
key = "backlog"
name = "Backlog"
kind = "backlog"
passes_to = ["implementation"]
}
station {
key = "implementation"
name = "Implementation"
harness = "claude-code"
profile = spotlight_harness_profile.core_careful.key
prompt = file("${path.module}/prompts/core/delivery/implementation.md")
check = "npm test"
diffs = true
decisions = true
memories = true
tools = ["${spotlight_integration.core_acme.integration}.comment", "pull-request"]
skills = [spotlight_skill.core_grafana.key]
runners = ["gpu"]
passes_to = ["code-review"]
judge {
claims = [
"The change adds a test that fails without it.",
"The change touches only what the task names.",
]
}
alert {
measure = "sent_back_rate"
rises_by = 0.2
over = 20
}
search {
ceiling = 20
iterations = 4
objective = "cost"
agent {
harness = "claude-code"
effort = "high"
}
}
}
station {
key = "code-review"
name = "Code review"
harness = "claude-code"
passes_to = ["implementation"]
ends = true
}
station {
key = "completed"
name = "Completed"
kind = "completed"
}
reaction {
happening = "github.checks.failed"
from = "implementation"
to = "implementation"
}
maintenance {
station = "implementation"
max_open = 2
file = "ask"
}
replay_check {
max_regressions = 0
ceiling = 10
currency = "USD"
min_gain = 0.05
}
search {
monthly_ceiling = 100
currency = "USD"
ceiling = 10
period = "7d"
on_alert = true
cooldown = "3d"
}
source {
repository = "acme/platform"
path = "teams/core/delivery.tf"
}
}The same line as a request body:
{
"key": "delivery",
"name": "Delivery",
"role": "delivery",
"runners": ["vpc-internal"],
"defaultAssignee": "ada@example.com",
"repositories": [
{ "name": "acme/api", "image": "ghcr.io/acme/api-runner:main", "setup": "npm ci" }
],
"stations": [
{ "key": "backlog", "name": "Backlog", "kind": "backlog", "passesTo": ["implementation"] },
{
"key": "implementation",
"name": "Implementation",
"harness": "claude-code",
"profile": "careful",
"prompt": "Implement the task.",
"check": "npm test",
"diffs": true,
"decisions": true,
"memories": true,
"tools": ["acme.comment", "pull-request"],
"skills": ["grafana"],
"runners": ["gpu"],
"passesTo": ["code-review"],
"judge": { "claims": ["The change adds a test that fails without it."], "passThreshold": 1 },
"alerts": [{ "measure": "sent_back_rate", "risesBy": 0.2, "over": 20 }],
"search": {
"ceiling": 20,
"iterations": 4,
"objective": "cost",
"agent": { "harness": "claude-code", "effort": "high" }
}
},
{
"key": "code-review",
"name": "Code review",
"harness": "claude-code",
"passesTo": ["implementation"],
"ends": true
},
{ "key": "completed", "name": "Completed", "kind": "completed" }
],
"reactions": [
{ "happening": "github.checks.failed", "from": "implementation", "to": "implementation" }
],
"maintenance": { "station": "implementation", "maxOpen": 2, "file": "ask" },
"replayCheck": { "maxRegressions": 0, "ceiling": 10, "currency": "USD" },
"search": {
"monthlyCeiling": 100,
"currency": "USD",
"ceiling": 10,
"period": "7d",
"onAlert": true,
"cooldown": "3d"
},
"source": { "repository": "acme/platform", "path": "teams/core/delivery.tf" }
}A reviews block, on a line whose role is review:
reviews {
start = "opened"
mention = "@spotlight"
label = "spotlight"
skip {
spotlight = true
drafts = true
authors = ["dependabot[bot]", "renovate[bot]"]
}
}Line fields
| Field | Type | Default | Description |
|---|---|---|---|
key | string | required | Names the line within its team. Lowercase words joined by dashes, at most 64 characters. Immutable: an update that changes it is rejected; Terraform replaces the resource. |
name | string | required | What the line is called. At most 100 characters. |
role | string | none | The role the line plays for its team, as in delivery or review. Lowercase words joined by dashes, at most 64 characters. A role names one line per team. |
repositories | array of objects | [] | The repositories the line works on. See repositories. |
stations | array of objects | required | The stations, in order. At least one. See stations. |
reactions | array of objects | [] | Moves a task when something happens. See reactions. |
reviews | object | none | The review policy: which pull requests the line reviews. Only on a line whose role is review. See review policy fields. |
runners | array of strings | [] | Runner labels the line's work is placed on. Empty: any runner of the workspace qualifies. See placement. |
warmSandboxes | number | 0 | How many warm sandboxes the hosts keep ready for the line. A whole number from 0 to 5. 0: none. Terraform: warm_sandboxes. A read always returns it. Another value is refused with 422 at warmSandboxes: Warm sandboxes must be a whole number from 0 to 5. |
defaultAssignee | string | none | The email of the team member that a task opened on the line by a happening is assigned to when the happening names no member of the team: a member's sign-in email or an email they verified. A task is assigned to the member that opens.assignBy.email names, else to this member, else to nobody, and then its questions wait for the team. An email that matches no member of the team assigns nobody; the write does not fail. Terraform: default_assignee. A read leaves it out when none is set. At most 254 characters, without the spaces around it. A blank value is refused with 422 at defaultAssignee: Default assignee is the email of a team member, and it is empty. A value that is not an email address is refused with Default assignee must be an email address, like ada@example.com, not "<value>". |
maintenance | object | see maintenance fields | How Spotlight turns the corrections people make on the line's runs into patterns and maintenance tasks. Without it, every default applies. A read leaves it out when none is written. See maintenance fields. |
replayCheck | object | none | How a planned change of a station on this line must do to pass spotlight replay check. Without it, no planned change of the line is checked. See replay check fields. |
search | object | see search fields | How Spotlight searches the line's work stations for a better config on its own, and how much it may spend. Without it, every default applies, so every work station is searched. A read leaves it out when none is written. See search fields. |
source | object | none | Where the line's Terraform lives, which Spotlight opens a config pull request against when a search finds a better station config. See source fields. |
Station fields
| Field | Type | Default | Description |
|---|---|---|---|
key | string | required | Names the station within the line, and is what a run hands a task on to. Lowercase words joined by dashes, at most 64 characters. Not review or done. |
name | string | required | What the station is called on the board. At most 100 characters. |
kind | string | work | backlog, work or completed. |
color | string | #a3a8b0 | A six-digit hex colour, as in #6d78d5. Stored in lower case. |
description | string | none | What the station is for. At most 500 characters. |
harness | string | none | The harness that works tasks here: claude-code, cursor or codex. At most 60 characters. A station without one runs nothing, and no run may hand a task on to it. |
model | string | none | The model the harness uses. At most 60 characters. Without it, the harness uses its own default. |
effort | string | none | low, medium, high, xhigh or max. Without it, the harness uses its own default. |
profile | string | none | The key of a team harness profile. A run at a station naming a profile the team does not have fails with the code refused. |
prompt | string | none | Markdown handed to the agent that works the station. At most 20,000 characters. |
check | string | none | A command each layer of a change stack generated at this station is checked with, as in npm test. A shell command or script of one or more lines, at most 65,536 characters. Write a script of many lines as a heredoc (<<-EOT). See checks. |
runners | array of strings | none | Runner labels this station's work is placed on. Without it, the line's runners apply. See placement. |
diffs | boolean | false | Whether a change stack is generated from each run's diff. See Change stacks and decisions. |
decisions | boolean | false | Whether the briefing asks the agent to record each decision that shaped the change with spotlight decide. Without it, spotlight decide refuses a decision. See decisions. |
memories | boolean | false | Whether the briefing asks the agent, before it hands over, to propose what later runs should know with spotlight remember, for the team to approve in the inbox. Without it, the agent can still propose a memory. See memory. |
tools | array of strings | [] | The tools the station enables for its agent. See tool names. Each tool once. |
skills | array of strings | [] | The skills the station enables for its agent: a team skill key, or a catalog skill as catalog.<name>@<x.y.z>. Each skill once. A key starting spotlight- is rejected. |
passesTo | array of strings | [] | The keys of the stations a run here may hand a task on to. |
ends | boolean | false | Whether a run here may finish the task by handing over with done. From any other station, done goes to a person instead. |
judge | object | none | Claims the judge checks on each replay of the station, beside its built-in question. Only on a work station. See judge fields. A read leaves it out when none is set. |
alerts | array of objects | [] | Thresholds on a measure of the station's runs, kept in the order written. Only on a work station. See alert fields. |
search | object | none | Changes the line's search for this station. Only on a work station. See station search fields. A read leaves it out when none is set. |
Spotlight checks catalog tools and skills against what the workspace's plan
includes when the line is written. It does not check at write time that a
harness exists or that a profile, a team skill or an integration tool is
there.
Tool names
| Form | Example | Tool |
|---|---|---|
| a built-in name | pull-request, checks, review-comment, review | Spotlight's own. |
<integration>.<tool> | acme.comment | A tool an integration of the team offers. |
catalog.<name>@<x.y.z> | catalog.web-search@1.1.0 | A catalog tool at an exact version. |
See Built-in tools and skills for the built-in and catalog tools, and Agent commands for how an agent calls a tool.
Judge fields
The judge scores every replay of a work
station. It asks whether the replay's change does what the change people
accepted for the task did, with or without a judge block. A judge block adds
claims, which the judge checks on each replay on their own. Live task runs are
never judged.
| Field | Type | Default | Description |
|---|---|---|---|
claims | array of strings | required | Checkable claims the judge answers yes or no about each replay, in order: 1 to 20, each not empty and at most 500 characters, with surrounding spaces trimmed. |
passThreshold | number | 1 | The share of claims a replay must meet to pass, above 0, up to 1. 1 means every claim. Terraform: pass_threshold. |
A replay passes the judge when the answer to the built-in question is yes and
the share of the question and the claims met is at least passThreshold. See
Results.
judge {
claims = [
"The change adds a test that fails without it.",
"The change touches only what the task names.",
]
pass_threshold = 1
}An export writes claims in the block, one claim to a line. It writes
pass_threshold only when it is not 1.
The judge is part of the station's config: a run records one SHA-256 of its claims and pass threshold together. A change to either changes the config fingerprint.
| Message | Cause |
|---|---|
Judge claims must list 1 to 20 claims. | claims is empty or has more than 20. |
Judge claims each must not be empty. | A claim is empty or only whitespace. |
Judge claims each must be at most 500 characters. | A claim is longer. |
Judge passThreshold must be above 0, up to 1. | passThreshold is 0 or less, or above 1. |
Each is returned with 422 at the path stations[<n>].judge.<field>.
Alert fields
| Field | Type | Default | Description |
|---|---|---|---|
measure | string | required | sent_back_rate, accepted_rate, checks_failed_rate, failed_rate, merged_rate or cost_per_run. |
risesBy | number | none | The measure over the last over runs is this much higher than over the over runs before. |
fallsBy | number | none | The measure over the last over runs is this much lower than over the over runs before. |
above | number | none | The measure across the last over runs is higher than this. |
below | number | none | The measure across the last over runs is lower than this. |
over | number | required | How many runs are compared, and how many further measured runs an alert that went off must stay within its threshold to recover. A whole number, at least 1. |
In Terraform, risesBy and fallsBy are rises_by and falls_by. An alert
sets exactly one of risesBy, fallsBy, above and below; a read returns
the others as null.
| Measure | Unit | risesBy, fallsBy | above, below |
|---|---|---|---|
The five _rate measures | A share from 0 to 1, so 0.2 is 20 percentage points. | Above 0, at most 1. | 0 to 1. |
cost_per_run | An amount in the workspace's currency. | Above 0. | 0 or more. |
A station may have any number of alerts, but not two on the same measure with
the same kind of threshold: of two alerts that both set risesBy on
sent_back_rate, the later one is rejected.
Alerts are not part of the station's config, so changing them does not change
the config fingerprint. Alerts
are kept with the line, exported, listed on the Station page, and checked as
the station's runs end and are measured. See
Station alerts.
| Message | Cause |
|---|---|
Alert measure must be one of sent_back_rate, accepted_rate, checks_failed_rate, failed_rate, merged_rate, cost_per_run. | measure is another value. |
Alert must set exactly one of risesBy, above, fallsBy, below. | None, or more than one, is set. Returned at the path of the alert. |
Alert "rises by" value must be a share above 0 and at most 1. | risesBy on a rate is out of bounds. |
Alert "falls by" value must be a share above 0 and at most 1. | fallsBy on a rate is out of bounds. |
Alert "is above" value must be a share from 0 to 1. | above on a rate is out of bounds. |
Alert "is below" value must be a share from 0 to 1. | below on a rate is out of bounds. |
Alert "rises by" value must be an amount above 0. | risesBy on cost_per_run is 0 or less. |
Alert "falls by" value must be an amount above 0. | fallsBy on cost_per_run is 0 or less. |
Alert "is above" value must be an amount of 0 or more. | above on cost_per_run is below 0. |
Alert "is below" value must be an amount of 0 or more. | below on cost_per_run is below 0. |
Alert must compare a whole number of runs, at least 1. | over is not a whole number of at least 1. |
Alert for "<measure> <rises by, is above, falls by or is below>" already exists on this station. | An earlier alert at the station has the same measure and sets the same one of risesBy, above, fallsBy and below. Returned at the path of the later alert. |
Each is returned with 422 at the path stations[<n>].alerts[<n>], followed
by .<field> where the message names one. Paths and messages use the API's
field names, as in risesBy, also for a line written in Terraform.
Repository fields
| Field | Type | Default | Description |
|---|---|---|---|
name | string | required | owner/name. Each repository once per line. |
image | string | none | The runner image every station of the line runs in, as in ghcr.io/acme/api-runner:main. Without it, the host's default image. Lower case except the tag, at most 255 characters, with an optional tag or @sha256: digest. The image is built FROM ghcr.io/usespotlightai/spotlight-runner and holds the harness of each station. |
setup | string | none | A command run in the checkout, as the agent, before a run's agent starts, and before a change stack check wherever a layer changes a lockfile. A sandbox skips it when it already ran it with success for the same command, dependency files and secrets in its environment: see Setup. A shell command or script of one or more lines, at most 65,536 characters. |
The repositories of one line name at most one distinct image. A read returns
repositories sorted by name.
Reaction fields
| Field | Type | Default | Description |
|---|---|---|---|
happening | string | required | What happens, integration name first, as in github.checks.failed. Matches ^[a-z0-9]+(\.[a-z0-9][a-z0-9_-]*)+$. |
from | string | none | The key of the station the task must be at for the reaction to apply. Without it, the reaction applies at any station. |
to | string | required | The key of the station the task moves to. While the task has a current run, the move waits until the run ends, and is dropped if the run passes the task on. A move to the completed station applies at once and stops the run. While the run waits on a person's answer to its question, a move to another station applies at once and the question closes. See Moves. |
See GitHub events for the happenings GitHub raises. An integration raises its own.
Review policy fields
The review policy (reviews) decides which pull requests a review line takes.
See Review tasks for how a line
is chosen and the task it opens.
| Field | Type | Default | Description |
|---|---|---|---|
start | string | mentioned | mentioned: take a pull request when the mention handle appears in a comment or review on it. opened: also take every pull request as it opens. |
mention | string | @spotlight | The handle that requests a review. Matches ^@[A-Za-z0-9][A-Za-z0-9_-]*(\[bot\])?$. Matched as a whole word, without regard to case. |
label | string | spotlight | The pull request label that requests a review, whatever start is. 1 to 50 characters. Matched without regard to case. |
skip.spotlight | boolean | true | Skip pull requests Spotlight opened: a head branch under spotlight/ or that is a task's branch, or a pull request a task opened. |
skip.drafts | boolean | true | Skip draft pull requests when they open. A mention or a label on a draft is still taken. |
skip.authors | array of strings | [] | GitHub logins whose pull requests are skipped, as in dependabot[bot]. Compared, stored and sorted in lower case, each once. |
Maintenance fields
How Spotlight turns the corrections people make on the line's runs into patterns and maintenance tasks. See How maintenance works.
Without a maintenance block, maintenance is on only for a line with exactly
one work station, with every default, and that station takes the maintenance
tasks. A line with more than one work station and no block has maintenance
off, and its section on the Insights Patterns tab asks for
maintenance.station. Write the block with station to turn it on.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Whether patterns surface on the line, in the inbox and on the Insights Patterns tab. |
station | string | none | The key of the work station that takes maintenance tasks. A line with more than one work station must set it. Without it, the line's one work station takes them. |
maxOpen | number | 2 | How many maintenance tasks may be open on the line at one time, a whole number from 1 to 20. Terraform: max_open. |
file | string | ask | How a codebase pattern becomes a maintenance task: ask, when a person files it, or automatic, when Spotlight files it as soon as it surfaces. |
maintenance {
station = "implementation"
max_open = 2
file = "ask"
}With file = "automatic", Spotlight files a pattern only while a slot is
free and the line has a work station for it. A pattern it does not file waits
for a person, as with ask. station and process patterns always wait for
a person.
| Message | Cause |
|---|---|
Maintenance station must be a station key. | station is not a station key. |
Maintenance station names <key>, which is not a work station of the line. | station names no work station of the line. |
Maintenance station must name the station for maintenance tasks on a line with more than one work station. | The block is written with enabled true, the line has more than one work station, and station is not set. |
Maintenance maxOpen must be a whole number from 1 to 20. | maxOpen is outside 1 to 20, or not a whole number. |
Maintenance file must be one of ask, automatic. | file is another value. |
Each is returned with 422 at the path maintenance.<field>.
Replay check fields
The replay check (replayCheck, in Terraform replay_check) sets the threshold
that a planned change of one of the line's work stations must meet in
spotlight replay check.
A check reads it from the line as it is applied, never from the plan. A line
read through the team's GET /api/teams/{teamId}/lines carries it as
replayCheck, and a replay set's page shows it in the ⓘ of its "Checks" panel.
See Replay checks API.
| Field | Type | Default | Description |
|---|---|---|---|
maxRegressions | number | 0 | How many tasks a planned change may regress on and still pass. A whole number, 0 or more. A search of one of the line's work stations also marks a candidate whose regressions on its searched and held-out tasks together are more than this, and Spotlight opens no config pull request for such a candidate. In Terraform, max_regressions. |
ceiling | number | 10 | The most each replay a check starts may spend, above 0 and at most 1,000: the planned change's replay, and the baseline replay when the station's replay set has none for the live config, scaled to the baseline's repeats. See Ceiling. |
currency | string | USD | The three-letter currency ceiling is counted in. Stored in upper case. |
minGain | number | 0.05 | The smallest gain in success rate that counts as more than noise, as a share above 0 and at most 1. A gain over the baseline or the live config reads better only when its whole 95% interval is above 0 and it is at least this, and worse in the same way for a loss. It is read by the replays, searches and checks of the line's work stations; a line without replay_check reads them against 0.05. A candidate of a search must do better than the live config on the held-out tasks by this before Spotlight opens a config pull request for it. It does not decide whether a check passes. See Gains. In Terraform, min_gain. |
| Message | Path |
|---|---|
Replay check maxRegressions must be a whole number from 0. | replayCheck.maxRegressions |
Replay check ceiling must be above 0 and at most 1,000. | replayCheck.ceiling |
Replay check minGain must be a share above 0 and at most 1. | replayCheck.minGain |
Replay check currency must be a three-letter currency code, as in USD. | replayCheck.currency |
Search fields
The search policy (search) decides when Spotlight searches the line's work
stations for a better config, and how much the searches may spend. Spotlight
starts each search itself and opens a config pull request for a candidate that
did better than the live config. See
How Spotlight improves a station.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Whether Spotlight searches the line's work stations on its own. Applying false stops every running search of the line's stations that does not turn it back on in its own search. |
monthlyCeiling | number | 50 | The most all searches of the line's stations may spend in one calendar month (UTC), in currency. Above 0. In Terraform, monthly_ceiling. |
currency | string | USD | The three-letter currency of monthlyCeiling, ceiling and a station's ceiling. Stored in upper case. |
ceiling | number | 10 | The most one search may spend, in currency. Above 0, at most 1,000 and at most monthlyCeiling. |
period | string | 7d | The longest time between two searches of a station. A duration from 1h to 365d. |
onAlert | boolean | true | Whether a station alert that goes off starts a search of its station before period ends. In Terraform, on_alert. |
cooldown | string | 3d | The shortest time between the starts of two searches of a station, and between a person closing one of the station's config pull requests on GitHub and the next search. A duration from 1h to 365d, at most period. |
A duration is a whole number followed by m (minutes), h (hours) or d
(days), as in 90m, 12h or 7d. A read returns every field, defaults
filled in, when the line has a search block.
Spotlight skips a search when what the line's searches started this month
spent, plus the search's ceiling, is more than monthlyCeiling. It also
skips a search inside cooldown. A search stopped because its policy was turned
off opens no config pull request. A skipped
search has a recorded reason; see
When Spotlight skips a search.
| Message | Path |
|---|---|
Search monthly_ceiling must be above 0. | search.monthlyCeiling |
Search ceiling must be above 0 and at most 1,000. | search.ceiling |
Search ceiling must be at most the monthly_ceiling, <amount> <currency>. | search.ceiling |
Search currency must be a three-letter currency code, as in USD. | search.currency |
Search period must be a whole number of minutes, hours or days, as in 90m, 12h or 7d. | search.period |
Search period must be from 1h to 365d. | search.period |
Search cooldown must be a whole number of minutes, hours or days, as in 90m, 12h or 7d. | search.cooldown |
Search cooldown must be from 1h to 365d. | search.cooldown |
Search cooldown must be at most the period, <period>. | search.cooldown |
Each is returned with 422.
Station search fields
A station's search changes the line's search for that station. A field it
leaves out comes from the line's search, or from its default when the line
has none. agent, iterations, repeats and objective are set only
here; when one is left out, Spotlight picks it.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | boolean | the line's | Whether Spotlight searches this station on its own. Applying false stops a running search of the station. |
ceiling | number | the line's | The most one search of this station may spend, in the line's currency. Above 0, at most 1,000 and at most the line's monthlyCeiling. |
period | string | the line's | The longest time between two searches of this station. A duration from 1h to 365d. |
onAlert | boolean | the line's | Whether an alert that goes off on this station starts a search. In Terraform, on_alert. |
cooldown | string | the line's | The shortest time between the starts of two searches of this station. A duration from 1h to 365d, at most the station's period. |
agent | object | the station's own | The agent that proposes candidate configs: harness (required), model and effort (low, medium, high, xhigh or max). Without it, the station's own harness, model and effort. |
iterations | number | 3 | How many iterations one search runs. A whole number from 1 to 10. |
repeats | number | 1 | How many times a search replays each task. A whole number from 1 to 5. |
objective | string | from the set's health | What a search improves: success or cost. Without it, cost when the live config succeeded on more than 95% of the replay set in its latest replay, and success otherwise. |
| Message | Path |
|---|---|
Search ceiling must be above 0 and at most 1,000. | stations[<n>].search.ceiling |
Search period must be from 1h to 365d. | stations[<n>].search.period |
Search cooldown must be from 1h to 365d. | stations[<n>].search.cooldown |
Search iterations must be a whole number from 1 to 10. | stations[<n>].search.iterations |
Search repeats must be a whole number from 1 to 5. | stations[<n>].search.repeats |
Line station <station> search ceiling must be at most the line's monthly_ceiling, <amount> <currency>. | stations[<n>].search.ceiling |
Line station <station> search cooldown must be at most its period, <period>. | stations[<n>].search.cooldown |
A malformed period or cooldown reads as on the line. Each is returned
with 422. <station> is the station's key.
Source fields
The source (source) names the file that contains this spotlight_line
resource. When a search of one
of the line's work stations finds a better config, Spotlight opens a config
pull request against it.
| Field | Type | Default | Description |
|---|---|---|---|
repository | string | required | The GitHub repository, owner/name. Spotlight's GitHub App must be installed on it. |
path | string | required | The .tf file, from the repository's root, with forward slashes and no leading slash, as in teams/core/delivery.tf. 1 to 1,024 characters, with no empty, . or .. part. |
For Spotlight to edit the station, the file must contain exactly one
resource "spotlight_line" with the line's key written as a plain string,
and in it exactly one station block with the station's key written the same
way. An attribute a search may change that is read from a file must be read
as file("${path.module}/<path>"); a plain file("<path>") cannot be
followed.
See The pull request.
| Message | Path |
|---|---|
Config source repository must be a GitHub repository as owner/name, not <repository>. | source.repository |
Config source path must be 1 to 1,024 characters. | source.path |
Config source path must be a path from the repository root with forward slashes, as in teams/core/delivery.tf. | source.path |
Config source path must not contain empty, . or .. parts. | source.path |
Config source path must end in .tf. | source.path |
Source commit
When the provider creates or updates a line in a GitHub Actions job, it sends
the commit the job runs on as the Spotlight-Source-Commit header,
<owner>/<name>@<sha>. It reads GITHUB_REPOSITORY and GITHUB_SHA, and
sends the header only when GITHUB_SERVER_URL is empty or
https://github.com. Without these variables, it sends no header. The header
does not change the resource's schema or plan.
Spotlight keeps the commit of each apply that changes a line. When a station's
config changes, Spotlight looks for the change's config pull request, first
among the config pull requests it opened itself, and then as the pull request
of the commit that applied the change. It finds the pull request that merged
the commit, else the first pull request that has it, through its GitHub App.
When it finds none, it looks again after 1, 5 and 30 minutes, because GitHub
can list the pull request of a new commit late. When no pull request has the
commit after the last look, for example because the App is not installed on
the repository, the change has no pull request. A header that is not
<owner>/<name>@<sha>, with a 40 or 64 character hexadecimal sha, records
nothing.
The pull request gets a comment with the change's outcome verdict when its window closes.
Placement
A run at a station goes to a runner that carries at least one of the station's
runners labels. A station's runners, when set, are the only labels that
apply. A station without runners uses the line's. With neither, any runner of
the workspace qualifies.
A label is one a runner pool or runner trust
assigns to the runners it accepts. A pool's key is not a label. Each entry,
trimmed of surrounding whitespace, is shaped as a label is, lowercase words joined by dashes of at most 64
characters, and named once; any other entry is rejected.
| Message | Cause |
|---|---|
Runners must each name a pool or trust label in lowercase words joined by dashes, at most 64 characters, such as vpc-internal. | An entry is not shaped as a label. |
Runners must name <label> only once. | An entry is named twice. |
Each is returned with 422 at the path runners, or
stations[<n>].runners for a station.
Where the line's repositories name an image, the runner must also run that
image. Where they name none, the runner must run its host's default image.
See Host settings for the
images a host serves.
Layout rules
A line's stations are rejected unless they follow every rule below.
- A line must have at least one station.
- Each station key must be used once.
- A line must have exactly one
backlogstation, and it must be first. - A line must have exactly one
completedstation, and it must be last. - The
completedstation must not pass to any station. - A station must not pass to itself.
- A station must not list one station twice in
passes_to. - A station must pass only to
workstations. - A reaction's
toandfrommust be stations on the line. - A line must not have two reactions with the same
happeningandfrom. - If any station has both
checkanddiffs: true, every repository must havesetup. - A line must name
reviewsonly if itsroleisreview. - Only a
workstation may have ajudge,alertsorsearch. On a backlog the error readsLine <line> station <station> is a backlog and has no runs to judge., and on the completed stationLine <line> station <station> is the completed station and has no runs to judge.; for alerts both endand has no runs to alert on., and for a searchand has no runs to improve.<line>and<station>are keys. The error is returned atstations[<n>].judge,stations[<n>].alertsorstations[<n>].search.
Reserved station keys
| Key | A run that hands over to it |
|---|---|
review | hands its task over to a person |
done | finishes its task |
Update and delete
| Operation | Behaviour |
|---|---|
| update | Replaces the whole definition. A station whose key is kept keeps its identity and the tasks at it. Changing key fails with 422. Dropping a station that has any task fails with 409 in-use, naming the stations and how many tasks are at each. |
| delete | Fails with 409 in-use while the line has any task. |
A second line claiming a role another line of the team has fails with
422 on role.