Skip to content

Commit afd60db

Browse files
authored
Merge pull request openSUSE#325 from mimi1vx/docu_refresh2
docs: align README, config reference, and FAQ with current tool
2 parents 621cf70 + 07ecd6b commit afd60db

3 files changed

Lines changed: 204 additions & 70 deletions

File tree

Documentation/cfg.rst

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,128 @@ Used e.g. in lock files.
268268
.. __: https://docs.python.org/2/library/getpass.html#getpass.getuser
269269

270270

271+
``mcp.max_output_bytes``
272+
~~~~~~~~~~~~~~~~~~~~~~~~
273+
| **type**
274+
| int (bytes)
275+
| **default**
276+
| 100000
277+
278+
Caps the size of a single ``mtui-mcp`` tool result. Output beyond the cap
279+
is truncated with a one-line notice pointing at the ``offset``/``limit``
280+
paging on the testreport read tools. A value of ``0`` disables the cap.
281+
Ignored outside the MCP server. See :doc:`mcp`.
282+
283+
284+
``mcp.session_cap``
285+
~~~~~~~~~~~~~~~~~~~
286+
| **type**
287+
| int
288+
| **default**
289+
| 32
290+
291+
Maximum number of concurrent client sessions the ``mtui-mcp`` ``http``
292+
transport will create; a tool call that would exceed the cap fails with a
293+
clear error instead of spawning unbounded SSH connections and worker
294+
threads. Must be a positive integer. Ignored under the ``stdio``
295+
transport. See :doc:`mcp`.
296+
297+
298+
``mcp.session_idle_timeout``
299+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
300+
| **type**
301+
| int (seconds)
302+
| **default**
303+
| 1800
304+
305+
Seconds of inactivity after which an idle ``mtui-mcp`` ``http`` session is
306+
swept and its hosts disconnected. Because the MCP SDK provides no
307+
per-session teardown callback, this sweep is what releases the SSH
308+
connections of a client that simply disconnected. Must be a positive
309+
integer; set to ``0`` to disable reaping. Ignored under the ``stdio``
310+
transport. See :doc:`mcp`.
311+
312+
313+
``mcp.tool_profile``
314+
~~~~~~~~~~~~~~~~~~~~
315+
| **type**
316+
| enum: ``full``, ``core``
317+
| **default**
318+
| ``full``
319+
320+
Selects which synthesised tools the ``mtui-mcp`` server exposes.
321+
``full`` keeps every command tool. ``core`` exposes only the curated
322+
everyday subset (load/inspect/run/install, report editing, approve/reject,
323+
the ``testreport_*`` and ``job_*`` tools), roughly halving the per-request
324+
tool-list payload the model must carry. Fine-tune either profile with
325+
``mcp.tools_allow`` and ``mcp.tools_deny``. See :doc:`mcp`.
326+
327+
328+
``mcp.tools_allow``
329+
~~~~~~~~~~~~~~~~~~~
330+
| **type**
331+
| list: comma-separated tool names
332+
| **default**
333+
| (empty)
334+
335+
Tool names added back on top of the selected ``mcp.tool_profile``. Applied
336+
before ``mcp.tools_deny``. See :doc:`mcp`.
337+
338+
339+
``mcp.tools_deny``
340+
~~~~~~~~~~~~~~~~~~
341+
| **type**
342+
| list: comma-separated tool names
343+
| **default**
344+
| (empty)
345+
346+
Tool names removed from the exposed set last, after the profile and
347+
``mcp.tools_allow`` have been applied (deny always wins). See :doc:`mcp`.
348+
349+
350+
``obs.api_url``
351+
~~~~~~~~~~~~~~~
352+
| **type**
353+
| URL
354+
| **default**
355+
| ``https://api.suse.de``
356+
357+
OBS/IBS API that mtui acts against for native ``SUSE:Maintenance`` and
358+
Product Increment review actions (``assign``, ``unassign``, ``approve``,
359+
``reject``, ``comment``). No credentials live here: the acting user and
360+
the SSH signing key are read from the user's ``~/.oscrc`` (see
361+
``obs.conffile``), and this value must match a section header in that
362+
oscrc. OBS TLS verification is governed by ``mtui.ssl_verify``, not by
363+
oscrc's own TLS options.
364+
365+
Must be an ``http://`` or ``https://`` URL with a host (an explicit
366+
port must be numeric); an invalid value is rejected when the
367+
configuration is read and the default is used instead.
368+
369+
370+
``obs.conffile``
371+
~~~~~~~~~~~~~~~~
372+
| **type**
373+
| pathname
374+
| **default**
375+
| (empty; ``~/.oscrc``)
376+
377+
Path to the oscrc from which the native OBS backend reads the acting user
378+
and SSH ``sshkey``. An empty value (the default) uses ``~/.oscrc``.
379+
380+
381+
``obs.request_timeout``
382+
~~~~~~~~~~~~~~~~~~~~~~~
383+
| **type**
384+
| int (seconds)
385+
| **default**
386+
| 180
387+
388+
Coarse wall-clock budget checked **between** the individual HTTP calls a
389+
native OBS operation makes; each call is itself bounded by the shared HTTP
390+
timeout. This is not a mid-call hard kill. Must be a positive integer.
391+
392+
271393
``openqa.baremetal``
272394
~~~~~~~~~~~~~~~~~~~~
273395
| **type**
@@ -478,6 +600,18 @@ Example
478600
template_dir = /path/to/where/you/want/to/store/test-reports
479601
480602

603+
[obs]
604+
api_url = https://api.suse.de
605+
request_timeout = 180
606+
607+
608+
[mcp]
609+
session_cap = 32
610+
session_idle_timeout = 1800
611+
tool_profile = full
612+
max_output_bytes = 100000
613+
614+
481615
[openqa]
482616
openqa = https://openqa.suse.de
483617

Documentation/faq.rst

Lines changed: 60 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,51 @@ Example:
3636

3737
.. code-block:: sh
3838
39-
# EDITOR=nano mtui -r SUSE:Maintenance:3601:126030
39+
# EDITOR=nano mtui -a SUSE:Maintenance:3601:126030
4040
4141
Is there a way to easily distinguish among different updates?
4242
=============================================================
4343

4444
When you are testing different updates at the same time, you can load several
45-
test reports into a single MTUI session as templates and switch between them.
46-
The bottom toolbar shows the active template's RRID together with the total
47-
number of loaded templates, so the prompt stays unambiguous. See
48-
`load_template`, `switch`, and `list_templates` in the interactive commands
49-
reference.
45+
test reports into a single MTUI session as templates. Each ``load_template``
46+
adds another RRID to the session; ``list_templates`` shows the loaded set,
47+
``switch`` changes the active one, and ``unload`` drops one (closing only its
48+
host connections). The bottom toolbar shows the active template's RRID together
49+
with the total number of loaded templates, so the prompt stays unambiguous.
50+
51+
Action commands fan out across every loaded template by default, each acting on
52+
that template's own hosts (or report), with each template's output prefixed by
53+
an ``=== <RRID> ===`` banner. Scope a single command to one template with
54+
``-T RRID``/``--template RRID``, or force fan-out explicitly with
55+
``--all-templates``. See `load_template`, `list_templates`, `switch`, and
56+
`unload` in the interactive commands reference.
57+
58+
Example::
59+
60+
mtui> load_template -a SUSE:Maintenance:3601:126030
61+
mtui> load_template -a SUSE:Maintenance:3602:126040
62+
mtui> list_templates
63+
* SUSE:Maintenance:3602:126040 hosts: 2 workflow: manual
64+
SUSE:Maintenance:3601:126030 hosts: 3 workflow: manual
65+
mtui> switch SUSE:Maintenance:3601:126030
66+
67+
Which update should I pick up next?
68+
===================================
69+
70+
The ``updates`` command lists the update queue live from the TeReGen API,
71+
sorted by priority. By default it shows the actionable pickup queue:
72+
**unassigned** updates that are **in testing**, so you can grab the next one
73+
without wading through released entries. Each row shows priority, status, kind,
74+
deadline and the RRID.
75+
76+
Pass ``--status all`` for the full queue (every status and assignee), or use
77+
the assignment filters ``--mine`` (updates assigned to you), ``--assignee
78+
<user>``, or ``--all-assignees``. Restrict to a review group with
79+
``--review-group`` and cap the row count with ``--limit``.
80+
81+
Example::
82+
83+
mtui> updates --review-group qam-sle --limit 5
5084

5185
Can I run MTUI without loading a test report?
5286
=============================================
@@ -306,6 +340,23 @@ Example::
306340
info: connecting to craig.qam.suse.cz
307341

308342

343+
How can I search the reference-host inventory without connecting?
344+
=================================================================
345+
346+
The ``list_refhosts`` command queries the same inventory ``add_host``
347+
resolves through, but reads it offline: it makes no SSH connection, takes no
348+
lock, and needs no loaded test report. Filter by hostname glob (``--name``),
349+
arch (``--arch``), base product (``--product``), version (``--version``),
350+
addon (``--addon``), or a full testplatform query (``--testplatform``). Add
351+
``--free`` to additionally probe each matched host's live lock state (the only
352+
part that goes on the wire), ``--pool`` to group by test-target slot, or
353+
``--json`` for structured output.
354+
355+
Example::
356+
357+
mtui> list_refhosts --product sles --version 15-SP6 --arch x86_64
358+
359+
309360
How can I override refhosts mentioned in the test report?
310361
=========================================================
311362

@@ -316,12 +367,12 @@ machines, the host list could be overwritten with the ``-s`` option.
316367

317368
Example::
318369

319-
# mtui -s edna.qam.suse.cz,moe.qam.suse.cz -r SUSE:Maintenance:3601:126030
370+
# mtui -s edna.qam.suse.cz,moe.qam.suse.cz -a SUSE:Maintenance:3601:126030
320371
info: connecting to edna.qam.suse.cz
321372
info: connecting to moe.qam.suse.cz
322373
mtui> list_hosts
323-
edna.qam.suse.cz (sle12None) : Enabled (parallel)
324-
moe.qam.suse.cz (sle12None) : Enabled (parallel)
374+
edna.qam.suse.cz (sles12_module-x86_64): Enabled (parallel)
375+
moe.qam.suse.cz (sles12_module-x86_64): Enabled (parallel)
325376
mtui>
326377

327378
Can I run commands only on a subset of the host list?
@@ -371,59 +422,6 @@ Example::
371422
mtui> unlock -f
372423

373424

374-
Tests
375-
#####
376-
377-
Can I run a QA ctcs2 testsuite within MTUI?
378-
===========================================
379-
380-
The ``testsuite_*`` commands offer several options to run testsuites
381-
and manage the submission to QADB.
382-
383-
Examples
384-
~~~~~~~~
385-
386-
List available testsuites on a refhost::
387-
388-
mtui> testsuite_list -t kenny.qam.suse.cz
389-
testsuites on kenny.qam.suse.cz (sles12sp2_module-x86_64):
390-
test_gzip-run
391-
test_php-run
392-
test_tiff-run
393-
394-
395-
Run a specific testsuite::
396-
397-
mtui> testsuite_run -t moe.qam.suse.cz test_bzip2-run
398-
moe.qam.suse.cz:~> test_bzip2-testsuite [0]
399-
INFO: Variable TESTS_LOGDIR is set, logs will be stored in /var/log/qa/SUSE:Maintenance:3601:126030/ctcs2.
400-
Initializing test run for control file qa_bzip2.tcf...
401-
Current time: Thu Apr 20 11:26:02 CEST 2017
402-
**** Test in progress ****
403-
qa_bzip2_validation ... ... PASSED (2s)
404-
qa_bzip2_bigfilerun ... ... PASSED (3s)
405-
qa_bzip2_bznew ... ... PASSED (1s)
406-
qa_bzip2_compile ... ... PASSED (1s)
407-
**** Test run complete ****
408-
Current time: Thu Apr 20 11:26:09 CEST 2017
409-
Exiting test run..
410-
Displaying report...
411-
Total test time: 7s
412-
Tests passed:
413-
qa_bzip2_bigfilerun qa_bzip2_bznew qa_bzip2_compile qa_bzip2_validation
414-
**** Test run completed successfully ****
415-
416-
info: done
417-
418-
419-
Submit the testsuite results to QADB2::
420-
421-
mtui> testsuite_submit -t moe.qam.suse.cz test_bzip2-run
422-
info: Submiting results of test_bzip2-run from moe.qam.suse.cz
423-
info: submission for moe.qam.suse.cz (sles12_module-x86_64): http://qadb2.suse.de/qadb/submission.php?submission_id=494079
424-
info: done
425-
426-
427425
Where are stored installation logs from refhosts?
428426
=================================================
429427

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ In addition, MTUI provides convenience commands to help with maintenance update
1010

1111
## Features
1212

13-
- Parallel SSH command execution across SUSE reference hosts (`run`, `prepare`, `update`, `install`, `downgrade`, …) with per-host `enabled` / `disabled` / `dryrun` states and `parallel` / `serial` execution modes.
14-
- OBS / IBS maintenance-request workflow: `assign`, `unassign`, `approve`, `reject`, `comment`, each dispatched to either `osc` or Gitea depending on the request kind. `approve -r REVIEWER` records the reviewer in the testreport and commits to SVN in one step.
15-
- openQA integration: `reload_openqa`, `set_workflow {auto,manual,kernel}`, and `openqa_overview` (port of `oqa-search`) which prints PASSED/FAILED/RUNNING per SLE version, aggregated-update builds, and parsed build-check summaries, with `--export` to inject the block into the testreport's `regression tests:` section.
16-
- Reference-host lock management: cooperative `/var/lock/mtui.lock` files, automatic locking of every connected host while a Product Increment is under test (`[lock] pi_autolock`), and automatic reaping of stale locks left over from crashed sessions (`[lock] reap_stale`, `[lock] stale_age`).
13+
- Parallel SSH command execution across SUSE reference hosts (`run`, `prepare`, `update`, `install`, `uninstall`, `downgrade`, `reboot`, …) with per-host `enabled` / `disabled` / `dryrun` states and `parallel` / `serial` execution modes.
14+
- OBS / IBS maintenance-request workflow: `assign`, `unassign`, `approve`, `reject`, `comment`, dispatched to the native OBS/IBS API for `SUSE:Maintenance` and Product Increment requests (no `osc` subprocess; credentials and the SSH signing key are read from `~/.oscrc`) or to Gitea for SLFO / SL-Micro requests. `approve -r REVIEWER` records the reviewer in the testreport and commits to SVN in one step.
15+
- Update-queue and template workflow: `updates` lists the actionable pickup queue (unassigned updates in testing) from the TeReGen API sorted by priority, `checkers` shows the build-check result runs for the loaded update, and `regenerate` rebuilds a loaded update's test-report template via TeReGen and reloads it in place.
16+
- Multiple templates in one session: `load_template` adds each RRID to the session, `list_templates` / `switch` / `unload` manage the loaded set, and action commands fan out across every loaded template by default (scope a single one with `-T RRID` or force fan-out with `--all-templates`). Fan-out arbitrates a distinct free reference host per test-target slot from the shared pool so templates never collide on a host.
17+
- openQA integration: `reload_openqa`, `set_workflow {auto,manual,kernel}`, `openqa_overview` (port of `oqa-search`) which prints PASSED/FAILED/RUNNING per SLE version, aggregated-update builds, and parsed build-check summaries (with `--export` to inject the block into the testreport's `regression tests:` section), and `openqa_jobs` which lists the individual openQA jobs for the incident build so you can see which scenarios passed or failed.
18+
- Reference-host lock management: cooperative lock files, automatic locking of every connected host while a Product Increment is under test (`[lock] pi_autolock`), automatic reaping of stale locks left over from crashed sessions (`[lock] reap_stale`, `[lock] stale_age`), and independent host-pool claims (`list_locks -p`, `unlock -p`) that queue politely on an exhausted pool (`[lock] wait`, `[lock] wait_poll`).
1719
- Test-report lifecycle: `load_template`, `checkout`, `commit`, `edit`, `export`, with SVN and Gitea checkout backends.
18-
- Reference-host discovery: HTTPS- or filesystem-resolved `refhosts.yml` with location-aware fallback and configurable cache expiry, plus offline inventory search (`list_refhosts`) that filters the fleet by hostname glob, arch, product, version, addon, or testplatform query (and optionally probes live lock state) without connecting, locking, or loading a template.
19-
- File transfer: `put` (glob upload to all hosts) and `get` (download with per-host filename suffix or recursive folder mode).
20-
- Interactive `prompt_toolkit`-based shell: tab completion over the live command registry, persistent history with reverse-search (Ctrl-R), autosuggest-from-history (right-arrow to accept), lexer-highlighted command tokens, a bottom toolbar showing the loaded RRID, per-command `--help`, configurable log level, optional desktop notifications (`notify` extra), and OS-keyring credential storage (`keyring` extra).
20+
- Reference-host discovery: HTTPS- or filesystem-resolved `refhosts.yml` with a single merged host pool and configurable cache expiry, plus offline inventory search (`list_refhosts`) that filters the fleet by hostname glob, arch, product, version, addon, or testplatform query (and optionally probes live lock state) without connecting, locking, or loading a template.
21+
- File transfer: `put` (glob upload to all hosts, preserving directory trees) and `get` (download with per-host filename suffix or recursive folder mode).
22+
- Interactive `prompt_toolkit`-based shell: tab completion over the live command registry, persistent history with reverse-search (Ctrl-R), autosuggest-from-history (right-arrow to accept), lexer-highlighted command tokens, a bottom toolbar showing the loaded-template count and the active RRID, per-command `--help`, configurable log level, optional desktop notifications (`notify` extra), and OS-keyring credential storage (`keyring` extra).
2123
- Shell-completion script via the `completion` extra (`register-python-argcomplete mtui`).
22-
- MCP server (`mtui-mcp`, optional `mcp` extra): exposes every non-interactive mtui command as a [Model Context Protocol](https://modelcontextprotocol.io) tool, plus dedicated `testreport_read` / `testreport_patch` / `testreport_write` tools, so LLM clients can drive a headless mtui session over `stdio` or `http`.
24+
- MCP server (`mtui-mcp`, optional `mcp` extra): exposes every non-interactive mtui command as a [Model Context Protocol](https://modelcontextprotocol.io) tool, plus dedicated `testreport_read` / `testreport_patch` / `testreport_write` tools, so LLM clients can drive a headless mtui session over `stdio` or `http`. The HTTP transport isolates state per client, slow host commands can run as backgrounded jobs (`job_list` / `job_status` / `job_result` / `job_cancel`), and the exposed tool surface is tunable through the `[mcp]` config section.
2325

2426
## License
2527

0 commit comments

Comments
 (0)