{% from '_rule_block.html' import pin_block, rule_mark, config_block with context %} {% from '_pin_sections.html' import suspended_pins, suspended_sentence with context %} {% set page_title = 'Handled' %} {% include '_header.html' %} {#- *Handled*, the index of every rule that stands (ADR-0135 decision 8), its sections the jobs — *In maintenance*, *Accepted* (ADR-0142) and *By a rule* (ADR-0137). In maintenance, **every pin** — a node's own, or one of its reasons' — with what it holds, how long is left, why, and who is behind it, read from the whole snapshot so it is depth- and filter-independent, the nodes whose pins stand longest first, so that the old ones are where the eye starts. Viewer-visible and bookmarkable; the band's pill and its popover's "+N more" link here, and `/maintenance` answers with it. A plain page (the check.html / events.html pattern), not polled — so an open editor has nothing to wait for. This page is what makes the popover's one-row-per-node summary safe: it is where *"what is in maintenance right now?"* is answered completely, so the capped surface is free to fold. **The same blocks as a node's own page** (ADR-0104 decision 6, `_rule_block.html`), grouped under each node's path: the node's own pin first, then its lines' in the check's order — which is information (severity, API order) that the order they were pinned in is not. Each is read here and, by an admin, changed here: *Edit* opens in the block, and a save or a clear comes back to this page with its node named — `?node=#pinned-node`, the shape `?reason=#pinned-reason` has on a node's own page. The named node's section, and only it, gets the id and the ring. The node travels in the query and not in the fragment because a refused write is answered *at* this page's own address: from there a link that differed only by its fragment would be a jump within the refusal, and load nothing. **Two texts, in two places.** What a pin covers is what its block's sentence opens with — *The whole node*, or the reason line itself — and why is the block's note, and they are not the same kind of thing. A line's block stands away from its line here, so it names the line and links to it on its node's page; the slug appears in neither as text: ADR-0036 makes it opaque, so it travels only in the link's `?reason=` value and in the field of the form that changes the pin. This is also the place with room for the pin's **whole** reading (ADR-0014) for everyone — *pinned by Anna three days ago, last changed by Ben an hour ago* — under the note; a node's own page keeps it in the editor. The second sentence appears only on a pin that has actually been edited; on the common untouched pin it would just repeat the first. **A pin whose node is not reported** (ADR-0109 decision 4) stands under its path like any other, and its section says so: the check stopped returning the node, or has not written it yet since the start. Such a pin holds nothing, so its block says what it will hold *when the node is reported*; the path is no link, there being no page to open, and a line's pin names no line, the lines having gone with the node. It is edited and cleared here, where nothing else shows it. -#}

Handled

{% if pins %} {%- set nodes = groups | length %}

{{ rule_mark('maintenance') }}In maintenance

{{ pins | length }} {{ 'pin' if pins | length == 1 else 'pins' }} on {{ nodes }} {{ 'node' if nodes == 1 else 'nodes' }}, the longest standing first.

{%- for path, group in groups %} {#- Whether the node is pinned whole: its lines' blocks then say they are in maintenance on their own as well, since they stay quiet when the node's pin ends. -#} {%- set covered = group | rejectattr('slug') | list | length > 0 %} {%- set back = url_for('handled', node=path) ~ '#pinned-node' %} {%- set place = loop.index %} {%- set suspended = group[0].suspended %}

{% if suspended %}{{ path }}{% else %}{{ path }}{% endif %}{% set shown = group[0] | node_title %}{% if shown %} {{ shown | markdown_inline(node=path) }}{% endif %}

{%- if suspended %}

{{ suspended_sentence(group) }}

{%- endif %}
{%- if suspended %} {{ suspended_pins(path, group, place, back, is_admin) }} {%- endif %} {%- for pin in group if not suspended %} {%- if pin.slug %} {#- The reason line as its node writes it — rendered, and whole: a member's text is often a link, and cutting it would leave raw syntax on the page. -#} {%- set subject %}{{ pin.line | markdown_inline(node=path) }} — this line{% endset %} {{ pin_block(pin.entry, 'line', path, pin.slug, 'pin-' ~ place ~ '-' ~ loop.index, is_admin, also=covered, subject=subject, record=true, next=back, of=path) }} {%- else %} {%- set subject %}The whole node{% endset %} {{ pin_block(pin.entry, 'node', path, '', 'pin-' ~ place ~ '-' ~ loop.index, is_admin, subject=subject, record=true, next=back, of=path) }} {%- endif %} {%- endfor %}
{%- endfor %}
{% elif not by_rule and not accepted %}

Nothing is handled: no node or line is in maintenance, seen or held by a rule.

{% endif %} {#- **Accepted** (ADR-0142): every *seen* that stands, grouped under its node's path as the pins are, the nodes whose acknowledgments stand longest first — each its block, with who marked it and when under its note, and for whoever may mark a failure seen *Edit* and *Clear*. A node's own is its own failure, and a line's names its line and links to it. One whose part is not reported now is listed too: it holds nothing until it is, and ends where a reading says its part is gone. -#} {%- if accepted %} {%- set marked = accepted | map(attribute=1) | map('length') | sum %}

{{ rule_mark('seen') }}Accepted

{{ marked }} seen on {{ accepted | length }} {{ 'node' if accepted | length == 1 else 'nodes' }}, the longest standing first.

{%- for path, group in accepted %} {%- set back = url_for('handled', node=path) ~ '#pinned-node' %} {%- set place = loop.index %}

{{ path }}{% set shown = group[0] | node_title %}{% if shown %} {{ shown | markdown_inline(node=path) }}{% endif %}

{%- for row in group %} {%- if row.slug %} {%- set subject %}{% if row.line %}{{ row.line | markdown_inline(node=path) }} — this line{% else %}A line not reported now{% endif %}{% endset %} {{ pin_block(row.entry, 'line', path, row.slug, 'seen-' ~ place ~ '-' ~ loop.index, may_seen, subject=subject, record=true, next=back, of=path) }} {%- else %} {%- set subject %}Its own failure{% endset %} {{ pin_block(row.entry, 'node', path, '', 'seen-' ~ place ~ '-' ~ loop.index, may_seen, subject=subject, record=true, next=back, of=path) }} {%- endif %} {%- endfor %}
{%- endfor %}
{%- endif %} {#- **By a rule** (ADR-0137): every configured rule, the longest standing first, each its block — what it makes of the part it picks, its note, where it is written and since when — and beneath it what it changes the count of now, each part linked to where it stands; or *changes nothing now* and what it missed: nothing picked, a rule written before it deciding where it picks, a path it would pick with case folded. No buttons: a configured rule is changed in the configuration. -#} {%- if by_rule %}

{{ rule_mark('aggregation') }}By a rule

{{ by_rule | length }} {{ 'rule' if by_rule | length == 1 else 'rules' }} configured, the longest standing first.

{%- for row in by_rule %}

{{ row.rule.name }}

{{ config_block(row.at, row.rule.level, '/', 'by-rule-' ~ loop.index, index=true) }}

{%- if row.acting %}It changes the count of {{ row.parts }} {{ 'part' if row.parts == 1 else 'parts' }} now: {% for path, lines in row.acting %}{{ path }}{% if lines %} — {{ lines }} {{ 'line' if lines == 1 else 'lines' }}{% endif %}{{ ', ' if not loop.last else '.' }}{% endfor %} {%- elif not row.picked and not row.folded %}It picks nothing now. {%- else %} {%- if row.picked %}It picks {{ row.picked }} {{ 'place' if row.picked == 1 else 'places' }} now and changes no count there{% if row.over %}: {% for path, name in row.over %}at {{ path }} the rule {{ name }}, written before it, decides{{ '; ' if not loop.last }}{% endfor %}{% endif %}.{% else %}It picks nothing now.{% endif %} {%- if row.folded %} With case folded it would pick {% for path in row.folded %}{{ path }}{{ ', ' if not loop.last }}{% endfor %}.{% endif %} {%- endif %}

{%- endfor %}
{%- endif %}
{% include '_page_end.html' %}