Skip to content

feat: add flag --report-after-run to automatically generate the report after a successfull workflow run#3428

Merged
johanneskoester merged 6 commits intosnakemake:mainfrom
johannaschmitz:enable_report_at_first_run
Mar 14, 2025
Merged

feat: add flag --report-after-run to automatically generate the report after a successfull workflow run#3428
johanneskoester merged 6 commits intosnakemake:mainfrom
johannaschmitz:enable_report_at_first_run

Conversation

@JZentgraf
Copy link
Copy Markdown
Contributor

@JZentgraf JZentgraf commented Mar 14, 2025

Provide a new command line flag (--report-after-run) to generate the report directly after running the workflow.
This solves #3418

QC

  • The PR contains a test case for the changes or the changes are already covered by an existing test case.
  • The documentation (docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).

Summary by CodeRabbit

  • New Features

    • Introduced an additional command-line option to generate self-contained HTML reports after workflow execution.
    • Enhanced report generation to support dynamic outputs in various formats (e.g., visuals, data files).
  • Documentation

    • Updated report examples with descriptive captions, tables, and mathematical expressions.
    • Added new workflow descriptions and references in report files.
  • Tests

    • Added automated tests to verify the new post-run reporting functionality with customizable styling.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 14, 2025

📝 Walkthrough

Walkthrough

The changes introduce a new command-line argument --report-after-run to the CLI, allowing users to generate a report immediately after workflow execution if the --report argument is also specified. The args_to_api function is updated to validate the presence of --report when --report-after-run is used. Additionally, the report generation logic is modified to conditionally create reports based on the specified arguments. A new test workflow, report templates, a Conda environment configuration, and a dedicated test case are also added to support and validate these functionalities.

Changes

File(s) Change Summary
src/snakemake/cli.py Introduced --report-after-run argument; updated args_to_api for validation; modified report generation logic based on argument presence.
tests/common.py Added optional parameter report_after_run to run function; updated report generation logic to accommodate new parameter.
tests/test_report_after_run/Snakefile New Snakefile added with rules (all, c, a, b, d, e) for report generation across various formats.
tests/test_report_after_run/envs/test.yaml New YAML file for Conda environment with conda-forge channel and make dependency.
tests/test_report_after_run/report/* Multiple report files added/modified:
- fig1.rst: Added a caption with a hyperlink.
- fig2.rst: Added a mathematical expression.
- table.rst: Added an example table.
- testdir.rst: New file for dynamic directory content.
- workflow.rst: Updated with a description referencing a test figure and category.
tests/tests.py Added new test function test_report_after_run to validate report generation after workflow execution.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI as "CLI Argument Parser"
    participant Workflow as "Workflow Executor"
    participant ReportGen as "Report Generator Plugin"
    
    User->>CLI: Provide arguments (--report / --report-after-run)
    CLI->>CLI: Parse arguments and group report flags
    CLI->>Workflow: Call args_to_api() with updated report settings (reporter="html")
    Workflow->>Workflow: Execute workflow
    alt If '--report' flag is set
        Workflow->>ReportGen: Generate report during execution
    else If '--report_after_run' flag is set
        Workflow->>ReportGen: Generate report after run
    end
Loading

Suggested reviewers

  • johanneskoester

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97ae4bf and 7ec320f.

📒 Files selected for processing (3)
  • src/snakemake/cli.py (4 hunks)
  • tests/common.py (3 hunks)
  • tests/tests.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/tests.py
  • tests/common.py
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest ...

**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

  • src/snakemake/cli.py
⏰ Context from checks skipped due to timeout of 90000ms (38)
  • GitHub Check: tests (10, windows-latest, py312, bash)
  • GitHub Check: tests (10, windows-latest, py311, bash)
  • GitHub Check: tests (10, ubuntu-latest, py312, bash)
  • GitHub Check: tests (10, ubuntu-latest, py311, bash)
  • GitHub Check: tests (9, windows-latest, py312, bash)
  • GitHub Check: tests (9, windows-latest, py311, bash)
  • GitHub Check: tests (9, ubuntu-latest, py312, bash)
  • GitHub Check: tests (9, ubuntu-latest, py311, bash)
  • GitHub Check: tests (8, windows-latest, py312, bash)
  • GitHub Check: tests (8, windows-latest, py311, bash)
  • GitHub Check: tests (8, ubuntu-latest, py312, bash)
  • GitHub Check: tests (8, ubuntu-latest, py311, bash)
  • GitHub Check: tests (7, windows-latest, py312, bash)
  • GitHub Check: tests (7, windows-latest, py311, bash)
  • GitHub Check: tests (7, ubuntu-latest, py312, bash)
  • GitHub Check: tests (7, ubuntu-latest, py311, bash)
  • GitHub Check: tests (6, windows-latest, py312, bash)
  • GitHub Check: tests (6, windows-latest, py311, bash)
  • GitHub Check: tests (6, ubuntu-latest, py312, bash)
  • GitHub Check: tests (6, ubuntu-latest, py311, bash)
  • GitHub Check: tests (5, windows-latest, py312, bash)
  • GitHub Check: tests (5, windows-latest, py311, bash)
  • GitHub Check: tests (5, ubuntu-latest, py312, bash)
  • GitHub Check: tests (5, ubuntu-latest, py311, bash)
  • GitHub Check: tests (4, windows-latest, py312, bash)
  • GitHub Check: tests (4, windows-latest, py311, bash)
  • GitHub Check: tests (4, ubuntu-latest, py312, bash)
  • GitHub Check: tests (4, ubuntu-latest, py311, bash)
  • GitHub Check: tests (3, windows-latest, py312, bash)
  • GitHub Check: tests (3, windows-latest, py311, bash)
  • GitHub Check: tests (3, ubuntu-latest, py312, bash)
  • GitHub Check: tests (3, ubuntu-latest, py311, bash)
  • GitHub Check: tests (2, ubuntu-latest, py312, bash)
  • GitHub Check: tests (2, ubuntu-latest, py311, bash)
  • GitHub Check: tests (1, windows-latest, py312, bash)
  • GitHub Check: tests (1, windows-latest, py311, bash)
  • GitHub Check: tests (1, ubuntu-latest, py312, bash)
  • GitHub Check: tests (1, ubuntu-latest, py311, bash)
🔇 Additional comments (4)
src/snakemake/cli.py (4)

961-966: CLI argument looks good!

The new --report-after-run flag is well-designed as a boolean flag with a clear help message that indicates its purpose and dependency on the --report option.


1901-1904: Proper validation check implemented

Good implementation of the validation check to ensure that --report-after-run is only used when --report is also specified. This prevents user errors and provides a clear error message.


2089-2089: Conditional report generation logic looks good

The modification to skip report generation at this point when --report-after-run is specified is a clean approach that maintains backward compatibility.


2189-2193: Post-workflow report generation properly implemented

The implementation correctly generates the report after workflow execution when the --report-after-run flag is specified. This satisfies the feature request in issue #3418 while maintaining all the original report functionality.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (5)
tests/test_report_after_run/report/table.rst (1)

1-2: Example Table Entry Content

The new file adds a simple entry "An example table." as part of the reporting documentation. Verify that this minimal content aligns with the expected documentation formatting and style across the project.

tests/test_report_after_run/report/testdir.rst (1)

1-1: Dynamic Placeholder Verification

This file introduces dynamic content with the placeholder {{ snakemake.wildcards.name }}. Please verify that during report generation the placeholder is correctly substituted with actual data. If needed, consider including guidance or a fallback value for clarity.

tests/test_report_after_run/report/workflow.rst (1)

1-2: Workflow Description and Reference Links

The workflow description now includes references (fig1.svg_ and Step 2_) intended to link to report assets. Ensure that these references are correctly defined elsewhere in your documentation so that they resolve in the final report.

src/snakemake/cli.py (1)

2081-2186: Consider clarifying the conditional check for report-after-run.

While the code works correctly, the conditional check after workflow execution only verifies if report_plugin is not None rather than explicitly checking for args.report_after_run. For clarity and to avoid potential future issues, consider modifying it to explicitly check for both conditions.

-if report_plugin is not None:
+if report_plugin is not None and args.report_after_run:
     dag_api.create_report(
         reporter=args.reporter,
         report_settings=report_settings,
     )
tests/test_report_after_run/Snakefile (1)

55-61: External URL dependency could make test unstable.

The rule downloads data from an external URL, which could lead to flaky tests if the URL becomes unavailable or changes. Consider one of these alternatives:

  1. Include the CSV file in the test data directory
  2. Use a more reliable data source
  3. Add error handling for the download

This will improve test reliability and prevent failures due to external dependencies.

rule d:
    output:
        report("test.csv", caption="report/table.rst"),
    run:
        shell(
-            "curl http://samplecsvs.s3.amazonaws.com/Sacramentorealestatetransactions.csv > {output}"
+            """
+            if ! curl -f -s http://samplecsvs.s3.amazonaws.com/Sacramentorealestatetransactions.csv > {output}; then
+                echo "url,price,city\nsample,123,Sacramento" > {output}
+                echo "Warning: Could not download CSV, created fallback file" >&2
+            fi
+            """
        )
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c58684c and 97ae4bf.

⛔ Files ignored due to path filters (3)
  • tests/test_report_after_run/data/fig1.svg is excluded by !**/*.svg
  • tests/test_report_after_run/data/fig2.png is excluded by !**/*.png
  • tests/test_report_after_run/lorem-ipsum.pdf is excluded by !**/*.pdf
📒 Files selected for processing (10)
  • src/snakemake/cli.py (5 hunks)
  • tests/common.py (2 hunks)
  • tests/test_report_after_run/Snakefile (1 hunks)
  • tests/test_report_after_run/envs/test.yaml (1 hunks)
  • tests/test_report_after_run/report/fig1.rst (1 hunks)
  • tests/test_report_after_run/report/fig2.rst (1 hunks)
  • tests/test_report_after_run/report/table.rst (1 hunks)
  • tests/test_report_after_run/report/testdir.rst (1 hunks)
  • tests/test_report_after_run/report/workflow.rst (1 hunks)
  • tests/tests.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest ...

**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

  • tests/common.py
  • src/snakemake/cli.py
  • tests/tests.py
⏰ Context from checks skipped due to timeout of 90000ms (34)
  • GitHub Check: tests (10, windows-latest, py312, bash)
  • GitHub Check: tests (10, windows-latest, py311, bash)
  • GitHub Check: tests (10, ubuntu-latest, py312, bash)
  • GitHub Check: tests (10, ubuntu-latest, py311, bash)
  • GitHub Check: tests (8, ubuntu-latest, py312, bash)
  • GitHub Check: tests (8, ubuntu-latest, py311, bash)
  • GitHub Check: tests (7, windows-latest, py312, bash)
  • GitHub Check: tests (7, windows-latest, py311, bash)
  • GitHub Check: tests (7, ubuntu-latest, py312, bash)
  • GitHub Check: tests (7, ubuntu-latest, py311, bash)
  • GitHub Check: tests (6, windows-latest, py312, bash)
  • GitHub Check: tests (6, windows-latest, py311, bash)
  • GitHub Check: tests (6, ubuntu-latest, py312, bash)
  • GitHub Check: tests (6, ubuntu-latest, py311, bash)
  • GitHub Check: tests (5, windows-latest, py312, bash)
  • GitHub Check: tests (5, windows-latest, py311, bash)
  • GitHub Check: tests (5, ubuntu-latest, py312, bash)
  • GitHub Check: tests (5, ubuntu-latest, py311, bash)
  • GitHub Check: tests (4, windows-latest, py312, bash)
  • GitHub Check: tests (4, windows-latest, py311, bash)
  • GitHub Check: tests (4, ubuntu-latest, py312, bash)
  • GitHub Check: tests (4, ubuntu-latest, py311, bash)
  • GitHub Check: tests (3, windows-latest, py312, bash)
  • GitHub Check: tests (3, windows-latest, py311, bash)
  • GitHub Check: tests (3, ubuntu-latest, py312, bash)
  • GitHub Check: tests (3, ubuntu-latest, py311, bash)
  • GitHub Check: tests (2, windows-latest, py312, bash)
  • GitHub Check: tests (2, windows-latest, py311, bash)
  • GitHub Check: tests (2, ubuntu-latest, py312, bash)
  • GitHub Check: tests (2, ubuntu-latest, py311, bash)
  • GitHub Check: tests (1, windows-latest, py312, bash)
  • GitHub Check: tests (1, windows-latest, py311, bash)
  • GitHub Check: tests (1, ubuntu-latest, py312, bash)
  • GitHub Check: tests (1, ubuntu-latest, py311, bash)
🔇 Additional comments (16)
tests/test_report_after_run/report/fig1.rst (1)

1-2: Caption with Hyperlink Formatting

The caption now includes an inline hyperlink using reStructuredText syntax:
This is a caption with a \link https://www.google.com`_.`
Ensure that external links are permitted in report captions and that this formatting renders as intended by your documentation tools.

tests/test_report_after_run/report/fig2.rst (1)

1-2: Mathematical Expression Rendering

The file adds a math expression using the :math: directive:
Some math :math:\\sum_i i^2`.`
Confirm that this expression complies with Sphinx/reStructuredText guidelines and renders properly in the final report output.

tests/test_report_after_run/envs/test.yaml (1)

1-5: LGTM! Simple and appropriate Conda environment configuration for testing.

The environment definition includes a standard channel (conda-forge) and the 'make' package as a dependency, which is a suitable minimal configuration for the test case.

tests/tests.py (1)

284-291: Well-structured test function that matches the existing testing pattern.

The new test function for the report-after-run feature follows the existing pattern of other report tests and correctly utilizes the new parameter in the run function. This maintains consistency across the codebase.

tests/common.py (2)

175-175: Good addition of the new optional parameter.

The parameter is correctly added with a default value of None, maintaining backward compatibility with existing code.


427-436: Clean implementation of report generation after workflow execution.

The implementation correctly handles the new parameter, creating a report using the same pattern as the existing report generation code. The logic is appropriately placed after workflow execution, as the name suggests.

src/snakemake/cli.py (3)

944-945: Good use of mutually exclusive group for report parameters.

Creating a mutually exclusive group for report parameters ensures users can't specify both options at the same time, which makes sense since they serve similar purposes but at different times in the workflow.


962-977: Well-documented new command line parameter.

The help text for the new parameter is clear, detailed, and matches the style of the existing report parameter, maintaining consistency in the command line interface.


1901-1904: Correct logic for detecting report generation options.

The code correctly checks for either report parameter and sets up the HTML reporter appropriately.

tests/test_report_after_run/Snakefile (7)

2-2: Report template location specified correctly.

The workflow report template is properly defined at the beginning of the file, which will be used for the HTML report generation when --report-after-run is used.


5-5: Shell executable explicitly set to bash.

This is good practice to ensure consistent behavior across different environments, especially for the shell commands containing bash-specific syntax later in the workflow.


8-10: Rule 'all' correctly defines expected outputs.

The rule properly aggregates all the final outputs that should be generated by the workflow (SVG, PNG, CSV, and directory), ensuring that the entire workflow executes when running Snakemake without specific targets.


40-52:

Details

✅ Verification successful

Rule 'b' demonstrates wildcards in report generation.

The rule effectively showcases how to use wildcards in report outputs, with dynamic categories and labels. This is a valuable test case for ensuring the reporting functionality handles parameterized outputs correctly.


🏁 Script executed:

#!/bin/bash
# Check if the referenced data file exists
if [ -f "tests/test_report_after_run/data/fig2.png" ]; then
  echo "✓ Source PNG file exists"
else
  echo "✗ Source PNG file missing: tests/test_report_after_run/data/fig2.png"
fi

# Check if the caption file exists
if [ -f "tests/test_report_after_run/report/fig2.rst" ]; then
  echo "✓ Caption file exists"
else
  echo "✗ Caption file missing: tests/test_report_after_run/report/fig2.rst"
fi

Length of output: 223


Verified report generation using wildcards in rule 'b'.

  • The shell script confirmed that both the source PNG (tests/test_report_after_run/data/fig2.png) and the caption file (tests/test_report_after_run/report/fig2.rst) exist.
  • Rule 'b' successfully demonstrates dynamic report outputs through wildcards, ensuring that parameterized labels and categories are handled correctly.
  • No further changes are needed based on the current test case.

64-76:

Details

✅ Verification successful

Rule 'e' correctly implements directory reporting.

The rule demonstrates how to create and report on a directory output with pattern matching, which is an important test case for the directory reporting functionality. The shell script correctly creates the directory and populates it with numbered text files.


🏁 Script executed:

#!/bin/bash
# Check if the caption file exists
if [ -f "tests/test_report_after_run/report/testdir.rst" ]; then
  echo "✓ Caption file exists"
else
  echo "✗ Caption file missing: tests/test_report_after_run/report/testdir.rst"
fi

Length of output: 112


Directory Reporting Verified

  • The rule 'e' in tests/test_report_after_run/Snakefile successfully creates the directory and populates it with text files.
  • The verification script confirmed that the caption file at tests/test_report_after_run/report/testdir.rst exists.

This confirms that the directory reporting functionality works as intended. The code changes are approved.


26-37:

Details

✅ Verification successful

Rule 'a' implements proper report generation with metadata.

The rule correctly:

  1. Uses the outputs from rule 'c' as dependencies
  2. Generates an SVG report with appropriate metadata (caption, category, and dynamic labels)
  3. Copies the source file from a data directory

This is a good test case for the report generation feature.


🏁 Script executed:

#!/bin/bash
# Check if the referenced data file exists
if [ -f "tests/test_report_after_run/data/fig1.svg" ]; then
  echo "✓ Source SVG file exists"
else
  echo "✗ Source SVG file missing: tests/test_report_after_run/data/fig1.svg"
fi

# Check if the caption file exists
if [ -f "tests/test_report_after_run/report/fig1.rst" ]; then
  echo "✓ Caption file exists"
else
  echo "✗ Caption file missing: tests/test_report_after_run/report/fig1.rst"
fi

Length of output: 223


Verified Report Generation in Rule 'a'

The verification confirms that the rule correctly implements report generation with the necessary metadata. The source SVG file (tests/test_report_after_run/data/fig1.svg) and the caption file (tests/test_report_after_run/report/fig1.rst) both exist, as expected. Specifically:

  • The rule continues to use outputs from rule 'c' as dependencies.
  • The generated SVG report includes the appropriate metadata (caption, category, and dynamic labels).
  • The shell command correctly copies the source file from the data directory.

This is a robust test case for the report generation feature.


13-23:

Details

✅ Verification successful

Consider handling potential issues with external dependencies.

The rule properly uses Singularity container and Conda environment for reproducibility. However, be aware that this might create testing dependencies that need to be available in CI environments.

The sleep command with random duration could potentially cause non-deterministic behavior in tests, though it's likely intentional to simulate varying execution times.


🏁 Script executed:

#!/bin/bash
# Check if the required Conda environment file exists
if [ -f "tests/test_report_after_run/envs/test.yaml" ]; then
  echo "✓ Conda environment file exists"
else
  echo "✗ Conda environment file missing: tests/test_report_after_run/envs/test.yaml"
fi

# Check if the referenced input file exists
if [ -f "tests/test_report_after_run/lorem-ipsum.pdf" ]; then
  echo "✓ Input PDF file exists"
else
  echo "✗ Input PDF file missing: tests/test_report_after_run/lorem-ipsum.pdf"
fi

# Check if the caption file exists
if [ -f "tests/test_report_after_run/report/fig1.rst" ]; then
  echo "✓ Caption file exists"
else
  echo "✗ Caption file missing: tests/test_report_after_run/report/fig1.rst"
fi

Length of output: 352


Attention: External Dependencies and CI Configuration Verified

The rule is correctly configured to use both a Singularity container and a Conda environment for reproducibility. Our verification confirms that the necessary external dependencies—the Conda environment file ("envs/test.yaml"), the input PDF ("lorem-ipsum.pdf"), and the caption file ("report/fig1.rst")—are all present.

Please ensure that your CI environment similarly provides these dependencies to avoid any issues in testing. Additionally, note that the use of a random sleep command appears intentional for simulating variable execution times, though it may introduce minor non-deterministic behavior in tests.

@johanneskoester johanneskoester changed the title feat: Enable report at first run feat: add flag --report-after-run to automatically generate the report after a successfull workflow run Mar 14, 2025
@johanneskoester johanneskoester merged commit b0a7f03 into snakemake:main Mar 14, 2025
50 checks passed
johanneskoester pushed a commit that referenced this pull request Mar 14, 2025
🤖 I have created a release *beep* *boop*
---


##
[9.0.0](v8.30.0...v9.0.0)
(2025-03-14)


### ⚠ BREAKING CHANGES

* Logging refactor & add LoggerPluginInterface
([#3107](#3107))

### Features

* [#3412](#3412) - keep
shadow folder of failed job if --keep-incomplete flag is set.
([#3430](#3430))
([22978c3](22978c3))
* add flag --report-after-run to automatically generate the report after
a successfull workflow run
([#3428](#3428))
([b0a7f03](b0a7f03))
* add flatten function to IO utils
([#3424](#3424))
([67fa392](67fa392))
* add helper functions to parse input files
([#2918](#2918))
([63e45a7](63e45a7))
* Add option to print redacted file names
([#3089](#3089))
([ba4d264](ba4d264))
* add support for validation of polars dataframe and lazyframe
([#3262](#3262))
([c7473a6](c7473a6))
* added support for rendering dag with mermaid js
([#3409](#3409))
([7bf8381](7bf8381))
* adding --replace-workflow-config to fully replace workflow configs
(from config: directive) with --configfile, instead of merging them
([#3381](#3381))
([47504a0](47504a0))
* Dynamic module name
([#3401](#3401))
([024dc32](024dc32))
* Enable saving and reloading IOCache object
([#3386](#3386))
([c935953](c935953))
* files added in rule params with workflow.source_path will be available
in used containers
([#3385](#3385))
([a6e45bf](a6e45bf))
* Fix keep_local in storage directive and more freedom over remote
retrieval behaviour
([#3410](#3410))
([67b4739](67b4739))
* inherit parameters of use rule and extend/replace individual items
them when using 'with' directive
([#3365](#3365))
([93e4b92](93e4b92))
* Logging refactor & add LoggerPluginInterface
([#3107](#3107))
([86f1d6e](86f1d6e))
* Maximal file size for checksums
([#3368](#3368))
([b039f8a](b039f8a))
* Modernize package configuration using Pixi
([#3369](#3369))
([77992d8](77992d8))
* multiext support for named input/output
([#3372](#3372))
([05e1378](05e1378))
* optionally auto-group jobs via temp files in case of remote execution
([#3378](#3378))
([cc9bba2](cc9bba2))


### Bug Fixes

* `--delete-all-output` ignores `--dry-run`
([#3265](#3265))
([23fef82](23fef82))
* 3342 faster touch runs and warning messages for non-existing files
([#3398](#3398))
([cd9c3c3](cd9c3c3))
* add default value to max-jobs-per-timespan
([#3043](#3043))
([2959abe](2959abe))
* checkpoints inside modules are overwritten
([#3359](#3359))
([fba3ac7](fba3ac7))
* Convert Path to IOFile
([#3405](#3405))
([c58684c](c58684c))
* Do not perform storage object cleanup with --keep-storage-local-copies
set ([#3358](#3358))
([9a6d14b](9a6d14b))
* edgecases of source deployment in case of remote execution
([#3396](#3396))
([5da13be](5da13be))
* enhance error message formatting for strict DAG-building mode
([#3376](#3376))
([a1c39ee](a1c39ee))
* fix bug in checkpoint handling that led to exceptions in case
checkpoint output was missing upon rerun
([#3423](#3423))
([8cf4a2f](8cf4a2f))
* force check all required outputs
([#3341](#3341))
([495a4e7](495a4e7))
* group job formatting
([#3442](#3442))
([f0b10a3](f0b10a3))
* in remote jobs, upload storage in topological order such that
modification dates are preserved (e.g. in case of group jobs)
([#3377](#3377))
([eace08f](eace08f))
* only skip eval when resource depends on input
([#3374](#3374))
([4574c92](4574c92))
* Prevent execution of conda in apptainer when not explicitly requested
in software deployment method
([#3388](#3388))
([c43c5c0](c43c5c0))
* print filenames with quotes around them in RuleException
([#3269](#3269))
([6baeda5](6baeda5))
* Re-evaluation of free resources
([#3399](#3399))
([6371293](6371293))
* ReadTheDocs layout issue due to src directory change
([#3419](#3419))
([695b127](695b127))
* robustly escaping quotes in generated bash scripts (v2)
([#3297](#3297))
([#3389](#3389))
([58720bd](58720bd))
* Show apptainer image URL in snakemake report
([#3407](#3407))
([45f0450](45f0450))
* Update ReadTheDocs configuration for documentation build to use Pixi
([#3433](#3433))
([3f227a6](3f227a6))


### Documentation

* Add pixi setup instructions to general use tutorial
([#3382](#3382))
([115e81b](115e81b))
* fix contribution section heading levels, fix docs testing setup order
([#3360](#3360))
([051dc53](051dc53))
* fix link to github.com/snakemake/poetry-snakemake-plugin
([#3436](#3436))
([ec6d97c](ec6d97c))
* fix quoting
([#3394](#3394))
([b40f599](b40f599))
* fix rerun-triggers default
([#3403](#3403))
([4430e23](4430e23))
* fix typo 'safe' -&gt; 'save'
([#3384](#3384))
([7755861](7755861))
* mention code formatting in the contribution section
([#3431](#3431))
([e8682b7](e8682b7))
* remove duplicated 'functions'.
([#3356](#3356))
([7c595db](7c595db))
* update broken links documentation
([#3437](#3437))
([e3d0d88](e3d0d88))
* Updating contributing guidelines with new pixi dev setup
([#3415](#3415))
([8e95a12](8e95a12))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: snakemake-bot <snakemake-bot-admin@googlegroups.com>
kjohnsen pushed a commit to kjohnsen/snakemake that referenced this pull request Dec 15, 2025
…t after a successfull workflow run (snakemake#3428)

Provide a new command line flag (`--report-after-run`) to generate the
report directly after running the workflow.
This solves snakemake#3418
### QC
<!-- Make sure that you can tick the boxes below. -->

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [ ] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced an additional command-line option to generate
self-contained HTML reports after workflow execution.
- Enhanced report generation to support dynamic outputs in various
formats (e.g., visuals, data files).

- **Documentation**
- Updated report examples with descriptive captions, tables, and
mathematical expressions.
  - Added new workflow descriptions and references in report files.

- **Tests**
- Added automated tests to verify the new post-run reporting
functionality with customizable styling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Johanna <johanna_schmitz@posteo.de>
kjohnsen pushed a commit to kjohnsen/snakemake that referenced this pull request Dec 15, 2025
🤖 I have created a release *beep* *boop*
---


##
[9.0.0](snakemake/snakemake@v8.30.0...v9.0.0)
(2025-03-14)


### ⚠ BREAKING CHANGES

* Logging refactor & add LoggerPluginInterface
([snakemake#3107](snakemake#3107))

### Features

* [snakemake#3412](snakemake#3412) - keep
shadow folder of failed job if --keep-incomplete flag is set.
([snakemake#3430](snakemake#3430))
([22978c3](snakemake@22978c3))
* add flag --report-after-run to automatically generate the report after
a successfull workflow run
([snakemake#3428](snakemake#3428))
([b0a7f03](snakemake@b0a7f03))
* add flatten function to IO utils
([snakemake#3424](snakemake#3424))
([67fa392](snakemake@67fa392))
* add helper functions to parse input files
([snakemake#2918](snakemake#2918))
([63e45a7](snakemake@63e45a7))
* Add option to print redacted file names
([snakemake#3089](snakemake#3089))
([ba4d264](snakemake@ba4d264))
* add support for validation of polars dataframe and lazyframe
([snakemake#3262](snakemake#3262))
([c7473a6](snakemake@c7473a6))
* added support for rendering dag with mermaid js
([snakemake#3409](snakemake#3409))
([7bf8381](snakemake@7bf8381))
* adding --replace-workflow-config to fully replace workflow configs
(from config: directive) with --configfile, instead of merging them
([snakemake#3381](snakemake#3381))
([47504a0](snakemake@47504a0))
* Dynamic module name
([snakemake#3401](snakemake#3401))
([024dc32](snakemake@024dc32))
* Enable saving and reloading IOCache object
([snakemake#3386](snakemake#3386))
([c935953](snakemake@c935953))
* files added in rule params with workflow.source_path will be available
in used containers
([snakemake#3385](snakemake#3385))
([a6e45bf](snakemake@a6e45bf))
* Fix keep_local in storage directive and more freedom over remote
retrieval behaviour
([snakemake#3410](snakemake#3410))
([67b4739](snakemake@67b4739))
* inherit parameters of use rule and extend/replace individual items
them when using 'with' directive
([snakemake#3365](snakemake#3365))
([93e4b92](snakemake@93e4b92))
* Logging refactor & add LoggerPluginInterface
([snakemake#3107](snakemake#3107))
([86f1d6e](snakemake@86f1d6e))
* Maximal file size for checksums
([snakemake#3368](snakemake#3368))
([b039f8a](snakemake@b039f8a))
* Modernize package configuration using Pixi
([snakemake#3369](snakemake#3369))
([77992d8](snakemake@77992d8))
* multiext support for named input/output
([snakemake#3372](snakemake#3372))
([05e1378](snakemake@05e1378))
* optionally auto-group jobs via temp files in case of remote execution
([snakemake#3378](snakemake#3378))
([cc9bba2](snakemake@cc9bba2))


### Bug Fixes

* `--delete-all-output` ignores `--dry-run`
([snakemake#3265](snakemake#3265))
([23fef82](snakemake@23fef82))
* 3342 faster touch runs and warning messages for non-existing files
([snakemake#3398](snakemake#3398))
([cd9c3c3](snakemake@cd9c3c3))
* add default value to max-jobs-per-timespan
([snakemake#3043](snakemake#3043))
([2959abe](snakemake@2959abe))
* checkpoints inside modules are overwritten
([snakemake#3359](snakemake#3359))
([fba3ac7](snakemake@fba3ac7))
* Convert Path to IOFile
([snakemake#3405](snakemake#3405))
([c58684c](snakemake@c58684c))
* Do not perform storage object cleanup with --keep-storage-local-copies
set ([snakemake#3358](snakemake#3358))
([9a6d14b](snakemake@9a6d14b))
* edgecases of source deployment in case of remote execution
([snakemake#3396](snakemake#3396))
([5da13be](snakemake@5da13be))
* enhance error message formatting for strict DAG-building mode
([snakemake#3376](snakemake#3376))
([a1c39ee](snakemake@a1c39ee))
* fix bug in checkpoint handling that led to exceptions in case
checkpoint output was missing upon rerun
([snakemake#3423](snakemake#3423))
([8cf4a2f](snakemake@8cf4a2f))
* force check all required outputs
([snakemake#3341](snakemake#3341))
([495a4e7](snakemake@495a4e7))
* group job formatting
([snakemake#3442](snakemake#3442))
([f0b10a3](snakemake@f0b10a3))
* in remote jobs, upload storage in topological order such that
modification dates are preserved (e.g. in case of group jobs)
([snakemake#3377](snakemake#3377))
([eace08f](snakemake@eace08f))
* only skip eval when resource depends on input
([snakemake#3374](snakemake#3374))
([4574c92](snakemake@4574c92))
* Prevent execution of conda in apptainer when not explicitly requested
in software deployment method
([snakemake#3388](snakemake#3388))
([c43c5c0](snakemake@c43c5c0))
* print filenames with quotes around them in RuleException
([snakemake#3269](snakemake#3269))
([6baeda5](snakemake@6baeda5))
* Re-evaluation of free resources
([snakemake#3399](snakemake#3399))
([6371293](snakemake@6371293))
* ReadTheDocs layout issue due to src directory change
([snakemake#3419](snakemake#3419))
([695b127](snakemake@695b127))
* robustly escaping quotes in generated bash scripts (v2)
([snakemake#3297](snakemake#3297))
([snakemake#3389](snakemake#3389))
([58720bd](snakemake@58720bd))
* Show apptainer image URL in snakemake report
([snakemake#3407](snakemake#3407))
([45f0450](snakemake@45f0450))
* Update ReadTheDocs configuration for documentation build to use Pixi
([snakemake#3433](snakemake#3433))
([3f227a6](snakemake@3f227a6))


### Documentation

* Add pixi setup instructions to general use tutorial
([snakemake#3382](snakemake#3382))
([115e81b](snakemake@115e81b))
* fix contribution section heading levels, fix docs testing setup order
([snakemake#3360](snakemake#3360))
([051dc53](snakemake@051dc53))
* fix link to github.com/snakemake/poetry-snakemake-plugin
([snakemake#3436](snakemake#3436))
([ec6d97c](snakemake@ec6d97c))
* fix quoting
([snakemake#3394](snakemake#3394))
([b40f599](snakemake@b40f599))
* fix rerun-triggers default
([snakemake#3403](snakemake#3403))
([4430e23](snakemake@4430e23))
* fix typo 'safe' -&gt; 'save'
([snakemake#3384](snakemake#3384))
([7755861](snakemake@7755861))
* mention code formatting in the contribution section
([snakemake#3431](snakemake#3431))
([e8682b7](snakemake@e8682b7))
* remove duplicated 'functions'.
([snakemake#3356](snakemake#3356))
([7c595db](snakemake@7c595db))
* update broken links documentation
([snakemake#3437](snakemake#3437))
([e3d0d88](snakemake@e3d0d88))
* Updating contributing guidelines with new pixi dev setup
([snakemake#3415](snakemake#3415))
([8e95a12](snakemake@8e95a12))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: snakemake-bot <snakemake-bot-admin@googlegroups.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.

3 participants