Skip to content

reconcile project

Terminal window
holocron reconcile project [board] [--dry-run]

Reads every item of each board that providers.projects declares, and sets the item’s status where one of these rules applies. It touches status only, never priority or any other field, and re-running it changes nothing that is already right.

The item is Rule
open, with an open blocker, not in blocked set to the template’s blocked status
open, in blocked, with no open blocker set to planned (Todo); the status it held before is unknown
closed or merged, not in done set to the template’s done status
open, with no status reported, not set: it needs a decision, not a rule
open, with an open linked pull request set to the template’s active status (In Progress)
open, its pull request’s required checks are green set to the template’s review status (In Review)
in review, a required check failed set back to active

The pull-request rules (spec tech-board-status-automation) read the pull requests that close the item (BoardItem.pullRequests; GitHub’s closedByPullRequestsReferences, so a pull request in another repository counts as far as GitHub reports it) and whether the required checks are green on each open one’s head commit: success is green, failure is a failure, a required check that is queued, in progress, cancelled or has not posted yet is pending, and an empty or unknown list is none. Only the required checks decide; an optional check that fails does not hold back review. A draft pull request is a pull request: it moves the item to active, and the draft state never holds back review. The pull requests are read in a second step, one small query per open issue a rule could still move (not done, not blocked, no open blocker), four at a time, never nested in the board’s items query (GitHub refuses that as over its resource limit). An issue whose read fails is reported (#N pull requests could not be read (...): their rules were not applied) and keeps its status; the other rules and items are unaffected. A pending verdict leaves the status alone, so a push and re-run does not flicker the board; with no linked pull request nothing changes and the status a person set stays. With several open pull requests the item is review when any one is green, else active. The rules run after the first four and only on items those left alone, so a blocker always wins, a closed item goes to done, and an item whose status those recently changed settles on the next run. They never change a status that is done or blocked.

Where the list of required checks comes from depends on the repo’s ci.aggregate. A repo that keeps the ci / Required checks aggregate reads that one check on the head commit, with no ruleset read. A repo with ci.aggregate: "none" has no such check, so the command reads the live ruleset’s required checks through the source provider and uses the config’s own list when that cannot be read, and prints one row saying which (required checks, from the live ruleset: ... or required checks, from the config (<why>): ...). It then lists each open pull request’s check runs once, and its commit statuses only when a required check is a status, and decides with the same rule close work uses.

A rule names a status category, not a spelling: where a template has several statuses of one category the first in the template’s order is used, and where it has none the item is reported and left alone. A closed item is set to done whatever its blockers say, and an open item with no status is reported even when it has a blocker.

v5 (roadmap)
✓ set #1782 Todo → Blocked (has an open blocker)
✓ set #1790 Blocked → Todo (no open blocker left)
✓ set #1701 In Progress → Done (closed)
✓ set #1802 Todo → In Progress (a pull request is open)
✓ set #1803 In Progress → In Review (its pull request is green)
⚠ #1795 has no status: needs a decision, left as it is
5 ok, 0 fail, 0 skipped

[board] limits the run to one declared board, by name. --dry-run prints the plan with would set and calls no mutator. A refusal from the provider (a Jira workflow can refuse a transition) is a reported failure and the run goes on with the next item; the exit code is non-zero if any status could not be set. A provider without items or setStatus is skipped cleanly.

The rules are two pure functions, planReconcile() and planPullRequestStatus(), so Sentinel can supply the same rules later; the command only reads, plans and applies.

The job is the task reconcile-projects, like check-tokens: a registry task, a reusable workflow template (ci/workflows/reconcile-projects.yml) and a thin caller generated from the tasks: list (add "reconcile-projects" to enable it in a repo that declares boards). Hourly, and on demand, it runs holocron reconcile project and then holocron doctor project. The reconcile output goes into the run’s summary. A failure of either step fails the run, and the run reaches #alerts through platform.notifications.yml, which lists the workflow as reconcile-projects. What reconcile changed is not an alert.

GITHUB_TOKEN cannot write an organization project, so the run mints the GitHub App’s installation token with actions/create-github-app-token. Two things are done once, by a person:

  • Give the App the organization Projects permission (read and write); setup cannot grant it.
  • Add the Actions variable SENTINEL_GITHUB_APP_ID (the App’s id, which is public; a secret of that name is still read when no variable is set) and the secret SENTINEL_GITHUB_APP_PRIVATE_KEY (the private key; the workflow still reads the old SENTINEL_APP_ID and SENTINEL_APP_PRIVATE_KEY when the new ones are not set) at the organization scope, for example through repo.variables.sync and repo.secrets.sync.

The event-driven path (Sentinel reconciling on issue_dependencies and on closes) follows when Sentinel is back in production; it adds speed only, because this schedule is the net for a missed delivery.