Skip to content

feat: add tutorial expand, opcli-minimal backend, spread jobs --exclude#52

Open
javierdelapuente wants to merge 2 commits into
mainfrom
feat/tutorial-expand
Open

feat: add tutorial expand, opcli-minimal backend, spread jobs --exclude#52
javierdelapuente wants to merge 2 commits into
mainfrom
feat/tutorial-expand

Conversation

@javierdelapuente
Copy link
Copy Markdown
Collaborator

Summary

Implements #12.

Changes

opcli tutorial expand — New command that extracts shell commands from Markdown (.md) and RST (.rst) tutorial files and prints them to stdout as a shell script. Typical usage in a task.yaml:

runuser -l ubuntu -s /bin/bash -c 'set -ex; . <(opcli tutorial expand -- "$1")' _ "${SPREAD_PATH}${TUTORIAL}"

opcli-minimal virtual backend type — A lightweight virtual backend for spread.yaml that installs only uv + opcli (no concierge, no Juju). Users write their own task.yaml. In CI the prepare script is empty since the workflow installs opcli before spread runs. Coexists with integration-test.

opcli spread jobs --exclude — Repeatable flag that filters jobs from the output matrix using fnmatch glob patterns matched against raw spread selector strings (e.g. --exclude 'my-docs-ci:*').

Tests

  • 21 new tests in tests/unit/test_tutorial.py
  • 8 new tests in tests/unit/test_spread.py (TestOpcliMinimalBackend, TestSpreadJobsExclude)
  • 504 tests passing total

Closes #12

javierdelapuente and others added 2 commits June 2, 2026 14:06
…jobs --exclude filter

- Add `opcli tutorial expand` command that extracts shell commands from
  Markdown and RST tutorial files (ported from operator-ci-poc)
- Add `opcli-minimal` virtual backend type for lightweight spread setups
  that only need opcli (no concierge/Juju); local prepare installs uv+opcli,
  CI prepare is empty
- Add `--exclude` option to `opcli spread jobs` for fnmatch-based filtering
  of jobs by raw spread selector string (e.g. `--exclude 'my-docs-ci:*'`)
- Add tests for all new functionality (test_tutorial.py, TestOpcliMinimalBackend,
  TestSpreadJobsExclude in test_spread.py)
- Update AGENTS.md and docs/ISD283.md

Closes #12

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix RST code-block extractor: handle internal blank lines and skip
  directive option lines (:caption:, :linenos:, etc.) that were
  previously emitted as shell commands
- Add _parse_rst_code_block_body helper (reduces complexity, fixes bugs)
- Fix error messages to report line numbers instead of byte offsets
- Add no_args_is_help=True to tutorial command group
- Fix tutorial group help text (remove incorrect 'and run')
- Expand 'opcli tutorial expand --help' docstring with marker syntax docs
- Fix 'spread jobs' docstring: 'JSON array' -> 'GitHub Actions matrix object'
- Improve --exclude help text with selector format example
- Use fnmatch.fnmatchcase for deterministic case-sensitive selector matching
- Fix ISD283.md: document real Markdown SPREAD syntax (no '<!-- SPREAD END -->')
- Add 3 new RST tests: internal blank lines, directive options

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redesign tutorial backend with a more generic name/purpose

1 participant