Skip to content

Expand Thorium documentation with concrete examples#68857

Open
edlitmus wants to merge 3 commits intosaltstack:masterfrom
edlitmus:codex/thorium-doc-cookbook
Open

Expand Thorium documentation with concrete examples#68857
edlitmus wants to merge 3 commits intosaltstack:masterfrom
edlitmus:codex/thorium-doc-cookbook

Conversation

@edlitmus
Copy link
Copy Markdown

@edlitmus edlitmus commented Mar 27, 2026

What does this PR do?

Expands the Thorium documentation with concrete cookbook-style examples and adds focused unit tests that exercise the documented patterns.

What issues does this PR fix or reference?

Fixes N/A

Previous Behavior

Thorium's topic documentation and generated reference pages documented only a small subset of the available patterns, with minimal end-to-end examples.

New Behavior

The Thorium docs now include concrete examples for:

  • reg.set with check.contains
  • threshold gating with reg.list and check.len_gte
  • rolling averages with calc.mean
  • cooldowns with timer.hold
  • wrapper selection across local.cmd, runner.cmd, and wheel.cmd
  • register persistence with file.save
  • health automation with status.reg and key.timeout

The branch also adds unit coverage for those example flows.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

  • Docs
  • Changelog
    This PR changes documentation and tests only and does not change user-facing runtime behavior, so no changelog entry is needed per doc/topics/development/changelog.rst.
  • Tests written/updated

Commits signed with GPG?

No

Testing

  • PYTHONPYCACHEPREFIX=/tmp/codex-pycache python3 -m py_compile salt/thorium/*.py
  • git diff --check
  • PYTHONPATH=/tmp/salt-test-deps python3 -m pytest -q tests/pytests/unit/thorium/test_examples.py
  • PYTHONPATH=/tmp/salt-nox python3 -m nox -e "test-3(coverage=False)" -- tests/pytests/unit/thorium/test_examples.py
  • PRE_COMMIT_HOME=/tmp/pre-commit-cache pre-commit run --files ...
    Generic hooks passed and black reformatted the new test file. The remaining Salt-specific hook failures were local environment issues from homebrew pre-commit running under Python 3.14, while this repo only carries requirements/static/ci tool constraints through Python 3.13.

@edlitmus edlitmus requested a review from a team as a code owner March 27, 2026 17:21
@welcome
Copy link
Copy Markdown

welcome bot commented Mar 27, 2026

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here's some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at saltproject.pdl@broadcom.com. We're glad you've joined our community and look forward to doing awesome things with you!

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.

2 participants