Skip to content

Create placeholder documentation for missing tools - #8207

Merged
timosachsenberg merged 2 commits into
developfrom
timosachsenberg-patch-7
Sep 14, 2025
Merged

timosachsenberg merged 2 commits into
developfrom
timosachsenberg-patch-7

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Sep 12, 2025 •

Copy link
Copy Markdown
Contributor

Description

fixes doxygen warning when parquet is disabled

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

How can I get additional information on failed tests during CI

Click to expand If your PR is failing you can check out

Advanced commands (admins / reviewer only)

Click to expand
  • /reformat (experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.
  • setting the label "NoJenkins" will skip tests for this PR on jenkins (saves resources e.g., on edits that do not affect tests)
  • commenting with rebuild jenkins will retrigger Jenkins-based CI builds

⚠️ Note: Once you opened a PR try to minimize the number of pushes to it as every push will trigger CI (automated builds and test) and is rather heavy on our infrastructure (e.g., if several pushes per day are performed).

Summary by CodeRabbit

  • Documentation
    • Added an automatic placeholder page for QuantmsIOConverter when Parquet support is disabled, clearly explaining the tool is unavailable in this build. Prevents broken or missing documentation pages.
  • Bug Fixes
    • Documentation generation no longer fails or produces missing pages when Parquet is turned off, improving reliability across build configurations.

@coderabbitai

coderabbitai Bot commented Sep 12, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Adds a conditional CMake post-build step for doc_param_internal that, when WITH_PARQUET is off, generates a placeholder HTML file for TOPP_QuantmsIOConverter to prevent documentation failures.

Changes

Cohort / File(s) Summary
Docs build CMake adjustments
doc/CMakeLists.txt
Adds add_custom_command(TARGET doc_param_internal POST_BUILD ...) under if(NOT WITH_PARQUET) to create ${CMAKE_CURRENT_BINARY_DIR}/doxygen/parameters/output/TOPP_QuantmsIOConverter.html with a minimal notice and a log message. Uses VERBATIM.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as CMake/Build
  participant Doc as doc_param_internal
  participant FS as File System

  Dev->>Doc: Build doc_param_internal
  alt WITH_PARQUET=OFF (new)
    Doc->>FS: Create TOPP_QuantmsIOConverter.html (placeholder)
    Note right of FS: Minimal HTML explains tool disabled
  else WITH_PARQUET=ON
    Note over Doc: No placeholder generated
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Create placeholder documentation for missing tools" succinctly and accurately summarizes the primary change in the PR — adding a conditional post-build step in doc/CMakeLists.txt to generate a placeholder HTML for tools (e.g., QuantmsIOConverter) when Parquet support is disabled so documentation builds do not fail; it is concise and directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I hop through CMake’s garden neat,
Planting a page where tools don’t meet.
“Parquet is off,” the note will say—
A gentle signpost on the way.
Docs still bloom, no builds to spoil;
Carrot-safe, we till the soil. 🥕

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch timosachsenberg-patch-7

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
doc/CMakeLists.txt (1)

231-237: Optional: generalize for multiple disabled tools

If more tools are gated by other options, consider a small list and loop to emit placeholders to avoid future one-offs.

Example (apply near the same block):

set(DISABLED_TOPP_TOOLS)
if(NOT WITH_PARQUET)
  list(APPEND DISABLED_TOPP_TOOLS "QuantmsIOConverter")
endif()

foreach(_tool IN LISTS DISABLED_TOPP_TOOLS)
  file(WRITE "${PROJECT_BINARY_DIR}/doxygen/parameters/output/TOPP_${_tool}.html" [=[
<html><body><h2>Tool not available</h2><p>This tool is disabled due to missing optional dependencies in this build.</p></body></html>
]=])
endforeach()
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44b5140 and 5b8bec7.

📒 Files selected for processing (1)
  • doc/CMakeLists.txt (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
  • GitHub Check: build-and-test (macos-14, xcode, 15.0.1)
  • GitHub Check: build-and-test (ubuntu-22.04, clang++, 15)
  • GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
  • GitHub Check: build-and-test (macos-13, xcode, 14.2)
  • GitHub Check: cppcheck-test
🔇 Additional comments (1)
doc/CMakeLists.txt (1)

231-237: Confirmed exact TOPP tool name and output filename

Tool ID is "QuantmsIOConverter" and the placeholder file is "TOPP_QuantmsIOConverter.html" — matches project references.

Locations: src/topp/QuantmsIOConverter.cpp (@page / @htmlinclude), src/topp/executables.cmake (listed), src/openms/source/APPLICATIONS/ToolHandler.cpp (tools_map), doc/CMakeLists.txt (placeholder generation).

Comment thread doc/CMakeLists.txt
Comment on lines +231 to +237
if(NOT WITH_PARQUET)
add_custom_command(TARGET doc_param_internal POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Creating placeholder documentation for tools disabled due to missing dependencies..."
COMMAND ${CMAKE_COMMAND} -E echo "<html><body><h2>Tool not available</h2><p>QuantmsIOConverter requires Parquet support which was disabled during compilation (WITH_PARQUET=OFF).</p></body></html>" > ${CMAKE_CURRENT_BINARY_DIR}/doxygen/parameters/output/TOPP_QuantmsIOConverter.html
COMMENT "Generate placeholder HTML for disabled tools"
VERBATIM)
endif()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Shell redirection in add_custom_command won’t work; placeholder file won’t be created

CMake runs COMMAND tokens without a shell, so > is treated as a literal argument to echo. The file will not be written on any platform. Create the file at configure/generate time with file(MAKE_DIRECTORY) and file(WRITE) instead (cross‑platform, no shell needed).

Apply this diff:

-    if(NOT WITH_PARQUET)
-      add_custom_command(TARGET doc_param_internal POST_BUILD
-      COMMAND ${CMAKE_COMMAND} -E echo "Creating placeholder documentation for tools disabled due to missing dependencies..."
-      COMMAND ${CMAKE_COMMAND} -E echo "<html><body><h2>Tool not available</h2><p>QuantmsIOConverter requires Parquet support which was disabled during compilation (WITH_PARQUET=OFF).</p></body></html>" > ${CMAKE_CURRENT_BINARY_DIR}/doxygen/parameters/output/TOPP_QuantmsIOConverter.html
-      COMMENT "Generate placeholder HTML for disabled tools"
-      VERBATIM)
-    endif()
+    if(NOT WITH_PARQUET)
+      message(STATUS "Creating placeholder documentation for tools disabled due to missing dependencies...")
+      file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/doxygen/parameters/output")
+      file(WRITE "${PROJECT_BINARY_DIR}/doxygen/parameters/output/TOPP_QuantmsIOConverter.html" [=[
+<html><body><h2>Tool not available</h2><p>QuantmsIOConverter requires Parquet support which was disabled during compilation (WITH_PARQUET=OFF).</p></body></html>
+]=])
+    endif()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if(NOT WITH_PARQUET)
add_custom_command(TARGET doc_param_internal POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Creating placeholder documentation for tools disabled due to missing dependencies..."
COMMAND ${CMAKE_COMMAND} -E echo "<html><body><h2>Tool not available</h2><p>QuantmsIOConverter requires Parquet support which was disabled during compilation (WITH_PARQUET=OFF).</p></body></html>" > ${CMAKE_CURRENT_BINARY_DIR}/doxygen/parameters/output/TOPP_QuantmsIOConverter.html
COMMENT "Generate placeholder HTML for disabled tools"
VERBATIM)
endif()
if(NOT WITH_PARQUET)
message(STATUS "Creating placeholder documentation for tools disabled due to missing dependencies...")
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/doxygen/parameters/output")
file(WRITE "${PROJECT_BINARY_DIR}/doxygen/parameters/output/TOPP_QuantmsIOConverter.html" [=[
<html><body><h2>Tool not available</h2><p>QuantmsIOConverter requires Parquet support which was disabled during compilation (WITH_PARQUET=OFF).</p></body></html>
]=])
endif()
🤖 Prompt for AI Agents
In doc/CMakeLists.txt around lines 231-237, the current add_custom_command uses
shell redirection (">") which won't create the placeholder file; replace this
build-time custom command with configure-time CMake calls: inside the existing
IF(NOT WITH_PARQUET) guard call file(MAKE_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/doxygen/parameters/output") and then file(WRITE
"${CMAKE_CURRENT_BINARY_DIR}/doxygen/parameters/output/TOPP_QuantmsIOConverter.html"
"<html>...Tool not available...</html>") to create the placeholder HTML directly
and cross-platform without invoking a shell.

@jpfeuffer

Copy link
Copy Markdown
Contributor

Interesting. Do you prefer this over omitting the tool completely?

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

I have to admit I struggled finding out how to omit it ;)

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

WTF?
https://cdash.seqan.de/test/244966544
Exporting FeatureMap for evidence...

Error: Unexpected internal error (Adding [14307814153891871341,0] failed. FeatureHandle exists twice in ConsensusMap!)

QualityControl failed!

why does this show up now?

@timosachsenberg
timosachsenberg enabled auto-merge (squash) September 12, 2025 13:22
@timosachsenberg

Copy link
Copy Markdown
Contributor Author

I think I will merge this for now as it fixes the doc build errors. If you have some hints where to change it I can do an update.

@jpfeuffer

Copy link
Copy Markdown
Contributor

Wasn't it working with an ifdef in Toolhandler?

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

@jpfeuffer was not sufficient: https://github.com/OpenMS/OpenMS/blob/develop/src/openms/source/APPLICATIONS/ToolHandler.cpp#L159-L161 is already in there.
Doxygen was still parsing the cpp and looking for the missing html

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

@Avni2000 I merge this. If you come across a smarter solution feel free to try

@timosachsenberg
timosachsenberg merged commit 49a39ed into develop Sep 14, 2025
@timosachsenberg
timosachsenberg deleted the timosachsenberg-patch-7 branch September 14, 2025 08:40
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