Skip to content

docs: Expand documentation#29

Merged
johanneskoester merged 13 commits intosnakemake:mainfrom
TRON-Bioinformatics:27-missing-documentation-on-how-to-document-plugins
Mar 12, 2026
Merged

docs: Expand documentation#29
johanneskoester merged 13 commits intosnakemake:mainfrom
TRON-Bioinformatics:27-missing-documentation-on-how-to-document-plugins

Conversation

@jonasfreimuth
Copy link
Copy Markdown
Contributor

@jonasfreimuth jonasfreimuth commented Mar 11, 2026

  • Add simple docstrings to potentially confusing functions for plugin collection & metadata extraction.
  • Restore functionality to the build task for individual plugins, rename it for clarity, and also include the slurm executor for increased test coverage.
  • Expand README with links to the Snakemake plugin doc & a short contributing section.

I have realized as part of snakemake/snakemake#4052 that there is sufficient docs on documenting plugins, it was just not easy to discover. That PR, along with this, should close #27.

Summary by CodeRabbit

  • Documentation

    • Expanded README with contributing, environment, development, testing guidance and a build warning
    • Added cross-reference to plugin architecture docs
    • Clarified plugin collection and temporary workspace behavior in documentation
  • Chores

    • Updated CI test job command
    • Added a per-plugin documentation build task and expanded build/tooling configuration

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 11, 2026

📝 Walkthrough

Walkthrough

Adds documentation and tooling for building plugin docs: README expanded with development/testing guidance, a new Pixi task [tasks.build-specific] for per-plugin docs, CI updated to call it, a docs template cross-reference added, and docstrings added to plugin-collection code.

Changes

Cohort / File(s) Summary
CI workflow
​.github/workflows/ci.yml
Switched test-fast job to run pixi run build-specific instead of build-single; no other workflow steps changed.
Pixi tasks & config
pixi.toml
Removed tasks.build-single; added public tasks.build-specific with packages arg (default list) that exports TEST_PACKAGES and runs sphinx-build; added/extended build/style tooling config blocks.
Documentation content
README.md, source/_templates/index.rst.j2
Expanded README into multiple sections (Contributing, Software environment, Development, Testing, build warning, Pixi references). Added a cross-reference line to Snakemake plugin architecture in the docs template.
Code docs
source/collect_plugins.py
Added docstrings to MetadataCollector, its inner helper pixi_add, and PluginCollectorBase.collect_plugins; replaced naive TEST_PACKAGES splitting with list-of-stripped-non-empty entries. No signature or control-flow changes.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant GH as "GitHub Actions"
participant Runner as "Shell / Runner"
participant Pixi as "Pixi CLI"
participant Sphinx as "Sphinx Builder"
GH->>Runner: start test-fast job
Runner->>Pixi: execute pixi run build-specific --packages=...
Pixi->>Runner: export TEST_PACKAGES="{{ packages }}" and invoke cmd
Runner->>Sphinx: run sphinx-build source build per TEST_PACKAGES
Sphinx-->>Runner: produce built docs
Runner-->>GH: job completes (artifacts/logs)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and overly generic. It uses non-descriptive phrasing ('Expand documentation') without clarifying what specific documentation is being expanded or why. Consider a more descriptive title like 'docs: Add docstrings, README sections, and plugin build task' that clearly summarizes the main changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully addresses issue #27 by adding docstrings to collection functions, expanding README with plugin documentation links, and creating a contributing section to improve discoverability.
Out of Scope Changes check ✅ Passed Changes to pixi.toml and CI workflow relate to restoring the plugin build task functionality, which aligns with PR objectives. All changes support the stated goal of improving documentation discoverability and plugin collection clarity.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves discoverability and contributor guidance for the Snakemake plugin catalog by adding clarifying docstrings, expanding landing-page documentation, and refining the Pixi task used to build docs for a subset of plugins in CI.

Changes:

  • Added short docstrings to key plugin collection/metadata extraction helpers.
  • Replaced the old single-plugin build task with a renamed build-specific task that supports multiple packages (and includes slurm by default for CI coverage).
  • Expanded the README and index template with links to upstream Snakemake plugin/architecture documentation and contribution/testing guidance.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
source/collect_plugins.py Adds docstrings to clarify plugin metadata collection and selection logic.
source/_templates/index.rst.j2 Adds a link to upstream Snakemake architecture/plugin documentation for better discoverability.
pixi.toml Introduces build-specific Pixi task with configurable plugin package list for targeted builds.
README.md Adds contributing/testing guidance and links to plugin catalog + Snakemake docs.
.github/workflows/ci.yml Updates CI to use the renamed build-specific task.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Task is too complex to be left inline.
More descriptive, it's possible to build multiple plugin docs with
this task.
@jonasfreimuth jonasfreimuth force-pushed the 27-missing-documentation-on-how-to-document-plugins branch from 9a5eb91 to 23d998d Compare March 11, 2026 18:48
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
README.md (1)

31-34: Add one concrete build-specific example.

This section names the task, but contributors still have to inspect pixi.toml to infer the packages argument format. A one-line example would make the workflow easier to discover.

Suggested wording
 ### Testing
 
 Currently there are no unit-tests. Checking whether the code works as expected
-is done by building individual plugin docs via the `build-specific` Pixi task.
+is done by building individual plugin docs via the `build-specific` Pixi task,
+for example:
+
+`pixi run build-specific --packages snakemake-executor-plugin-slurm`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 31 - 34, Add a one-line concrete example showing how
to invoke the build-specific Pixi task and the expected packages argument format
so contributors don't need to open pixi.toml; update the "Testing" section to
include a sample command like using the build-specific task name
"build-specific" and demonstrate the packages argument format (e.g.,
comma-separated package names or a single package) and reference pixi.toml for
advanced options.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 6-7: The markdown link target is host-relative due to the leading
slash in "/source/_templates/index.rst.j2"; update the link in README.md to a
repository-relative path by removing the leading slash (change
"/source/_templates/index.rst.j2" to "source/_templates/index.rst.j2") so GitHub
resolves the template link correctly.

---

Nitpick comments:
In `@README.md`:
- Around line 31-34: Add a one-line concrete example showing how to invoke the
build-specific Pixi task and the expected packages argument format so
contributors don't need to open pixi.toml; update the "Testing" section to
include a sample command like using the build-specific task name
"build-specific" and demonstrate the packages argument format (e.g.,
comma-separated package names or a single package) and reference pixi.toml for
advanced options.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 400a41ea-0e1a-4140-afe4-823162f56b3d

📥 Commits

Reviewing files that changed from the base of the PR and between 9a5eb91 and 23d998d.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • README.md
  • pixi.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml

The single cluster-generic plugin does not contain additional docs,
which the slurm plugin does. Adding the latter effectively increases
test coverage.
@jonasfreimuth jonasfreimuth force-pushed the 27-missing-documentation-on-how-to-document-plugins branch from 23d998d to a321a6c Compare March 11, 2026 19:18
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
README.md (1)

6-7: ⚠️ Potential issue | 🟡 Minor

Use a repository-relative link for the template.

Line 7 still points to /source/_templates/index.rst.j2, which GitHub resolves from the site root instead of this repository. Dropping the leading slash fixes the README link.

Suggested fix
-[this template](/source/_templates/index.rst.j2)
+[this template](source/_templates/index.rst.j2)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 6 - 7, The README contains a repository-rooted link
"/source/_templates/index.rst.j2" which GitHub resolves incorrectly; update the
link target to the repository-relative path "source/_templates/index.rst.j2"
(remove the leading slash) so the reference in the line containing the template
link points to the correct file within this repo.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pixi.toml`:
- Around line 14-20: The environment parsing for TEST_PACKAGES in
collect_plugins.py currently does a raw split(",") which leaves leading/trailing
whitespace on entries and causes exact-name comparisons later to fail; update
the TEST_PACKAGES parsing to trim each package (e.g., use a comprehension that
calls pkg.strip() and filters out empty strings) so comparisons in the
package-matching logic use normalized names without surrounding whitespace.

---

Duplicate comments:
In `@README.md`:
- Around line 6-7: The README contains a repository-rooted link
"/source/_templates/index.rst.j2" which GitHub resolves incorrectly; update the
link target to the repository-relative path "source/_templates/index.rst.j2"
(remove the leading slash) so the reference in the line containing the template
link points to the correct file within this repo.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: af762cc6-69c3-423f-a163-17ae43a3f4f5

📥 Commits

Reviewing files that changed from the base of the PR and between 23d998d and a321a6c.

📒 Files selected for processing (2)
  • README.md
  • pixi.toml

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@source/collect_plugins.py`:
- Around line 22-29: The current TEST_PACKAGES initialization treats an exported
empty string as set (producing []), so change the presence check to require a
non-empty value: use os.environ.get("TEST_PACKAGES") and ensure it's truthy
(e.g., value and value.strip()) before splitting; update the TEST_PACKAGES
assignment (the list comprehension that constructs TEST_PACKAGES) so that when
TEST_PACKAGES is an empty or whitespace-only string it falls back to None
instead of returning an empty list, preserving the default full collection
behavior used later (where TEST_PACKAGES is consulted).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: faaec72a-caed-4685-840f-93bd90974c26

📥 Commits

Reviewing files that changed from the base of the PR and between a321a6c and 43b5ada.

📒 Files selected for processing (1)
  • source/collect_plugins.py

@johanneskoester johanneskoester merged commit 81d021f into snakemake:main Mar 12, 2026
4 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Snakemake Hackathon 2026 Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Missing documentation on how to document plugins

3 participants