Repository navigation
Small refactor of TOPPBase - #9621
Conversation
- Move the Citation struct and the TOPPBase-specific parameter exceptions into a new lightweight TOPPBase_defs.h. - Extract TOPPExternalToolBase (the runExternalProcess_ adapter over ExternalProcess) as an intermediate base class; re-parent SearchEngineBase and the external-tool adapters onto it. - Slim TOPPBase.h: drop the Exception/LogStream/StringUtils/Colorizer and <fstream> includes, hold the log stream via a pimpl-ed std::ofstream, and stop FLASHHelperClasses.h from pulling in the whole TOPPBase header. - Add the explicit includes (mostly CONCEPT/LogStream.h) to the TUs that relied on those now-removed transitive includes (include-what-you-use). - Add TOPPBase_test coverage for the -log file output and Citation::toString(), plus a TOPPExternalToolBase_test for runExternalProcess_. - Remove the redundant /bigobj flag from the TOPPView target (already set lib-wide). No behaviour change. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR splits external-tool execution into a new base class, refactors ChangesTOPPExternalToolBase extraction and TOPPBase refactor
Sequence Diagram(s)sequenceDiagram
participant TOPPBase as TOPPBase::main
participant ETB as TOPPExternalToolBase
participant EP as ExternalProcess
TOPPBase->>TOPPBase: handleWriteCommands_()
TOPPBase->>ETB: runExternalProcess_(exe, args, workdir, env)
ETB->>EP: run(...)
EP-->>ETB: RETURNSTATE + captured output
ETB-->>TOPPBase: ExitCodes
TOPPBase->>TOPPBase: log_->close()
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
src/openms/include/OpenMS/APPLICATIONS/TOPPExternalToolBase.h (1)
19-27: ⚡ Quick winAdd
@ingroupfor the new public class.Please add a Doxygen group tag to the class block so it lands in the expected docs section.
Suggested doc update
/** `@brief` Base class for TOPP tools that invoke an external executable. + `@ingroup` Applications Adds `@ref` runExternalProcess_ - a thin adapter over `@ref` ExternalProcess that maps itsAs per coding guidelines,
**/*.{h,.doxygen}documentation should include grouping (@defgroup/@ingroup).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/include/OpenMS/APPLICATIONS/TOPPExternalToolBase.h` around lines 19 - 27, Add a Doxygen `@ingroup` tag to the documentation block of the TOPPExternalToolBase class. Locate the comment block that begins with /** and documents the TOPPExternalToolBase class, and insert an appropriate `@ingroup` tag within that comment block to group the class documentation according to the project's Doxygen organization structure.Source: Coding guidelines
src/openms/source/APPLICATIONS/TOPPBase.cpp (1)
2471-2482: ⚡ Quick winUse OpenMS logging macros instead of direct
std::couthere.Line 2480 writes directly to
cout; this bypasses the project’s logging convention.Suggested fix
- cout << "Writing to '" << log_destination << '\'' << "\n"; + OPENMS_LOG_INFO << "Writing to '" << log_destination << '\'' << "\n";As per coding guidelines,
**/*.cppshould use OpenMS logging macros and avoid directstd::cout/err.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/source/APPLICATIONS/TOPPBase.cpp` around lines 2471 - 2482, In the enableLogging_() method of the TOPPBase class, replace the direct std::cout statement that writes "Writing to..." with the appropriate OpenMS logging macro to maintain consistency with the project's logging conventions. The std::cout call should be replaced with a logging macro call that achieves the same output but follows the established logging pattern used throughout the codebase.Source: Coding guidelines
src/openms/include/OpenMS/APPLICATIONS/TOPPBase_defs.h (1)
22-33: ⚡ Quick winAdd Doxygen grouping metadata for new public API types.
Please add
@ingroup(and full@briefblock comments for the exception classes) so these symbols are discoverable in generated docs consistently with the rest of the public API.Suggested doc update
/** `@brief` Stores Citations for individual TOPP tools. + `@ingroup` Applications An example would be @@ - /// An unregistered parameter was accessed + /** + `@brief` An unregistered parameter was accessed. + `@ingroup` Applications + */ class OPENMS_DLLAPI UnregisteredParameter : public Exception::BaseException @@ - /// A parameter was accessed with the wrong type + /** + `@brief` A parameter was accessed with the wrong type. + `@ingroup` Applications + */ class OPENMS_DLLAPI WrongParameterType : public Exception::BaseException @@ - /// A required parameter was not given + /** + `@brief` A required parameter was not given. + `@ingroup` Applications + */ class OPENMS_DLLAPI RequiredParameterNotGiven : public Exception::BaseExceptionAs per coding guidelines,
**/*.{h,.doxygen}requires Doxygen@briefusage with grouping via@defgroup/@ingroup.Also applies to: 50-85
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/include/OpenMS/APPLICATIONS/TOPPBase_defs.h` around lines 22 - 33, The documentation comment for the Citation struct is missing Doxygen grouping metadata required by the coding guidelines for public API types. Add an `@ingroup` directive to the comment block that starts with "Stores Citations for individual TOPP tools" to ensure the Citation type is properly grouped in generated documentation. Additionally, verify that the `@brief` statement is present and properly formatted at the beginning of the comment block. Apply the same Doxygen grouping updates to all other public type documentation in the file mentioned in the "Also applies to" section (lines 50-85).Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/openms/include/OpenMS/APPLICATIONS/TOPPBase_defs.h`:
- Around line 22-33: The documentation comment for the Citation struct is
missing Doxygen grouping metadata required by the coding guidelines for public
API types. Add an `@ingroup` directive to the comment block that starts with
"Stores Citations for individual TOPP tools" to ensure the Citation type is
properly grouped in generated documentation. Additionally, verify that the
`@brief` statement is present and properly formatted at the beginning of the
comment block. Apply the same Doxygen grouping updates to all other public type
documentation in the file mentioned in the "Also applies to" section (lines
50-85).
In `@src/openms/include/OpenMS/APPLICATIONS/TOPPExternalToolBase.h`:
- Around line 19-27: Add a Doxygen `@ingroup` tag to the documentation block of
the TOPPExternalToolBase class. Locate the comment block that begins with /**
and documents the TOPPExternalToolBase class, and insert an appropriate `@ingroup`
tag within that comment block to group the class documentation according to the
project's Doxygen organization structure.
In `@src/openms/source/APPLICATIONS/TOPPBase.cpp`:
- Around line 2471-2482: In the enableLogging_() method of the TOPPBase class,
replace the direct std::cout statement that writes "Writing to..." with the
appropriate OpenMS logging macro to maintain consistency with the project's
logging conventions. The std::cout call should be replaced with a logging macro
call that achieves the same output but follows the established logging pattern
used throughout the codebase.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2308abc6-fca4-456b-b3bf-ac7504da25ba
📒 Files selected for processing (33)
src/openms/include/OpenMS/ANALYSIS/TOPDOWN/FLASHHelperClasses.hsrc/openms/include/OpenMS/APPLICATIONS/SearchEngineBase.hsrc/openms/include/OpenMS/APPLICATIONS/TOPPBase.hsrc/openms/include/OpenMS/APPLICATIONS/TOPPBase_defs.hsrc/openms/include/OpenMS/APPLICATIONS/TOPPExternalToolBase.hsrc/openms/source/ANALYSIS/TOPDOWN/PeakGroupScoring.cppsrc/openms/source/ANALYSIS/TOPDOWN/SpectralDeconvolution.cppsrc/openms/source/APPLICATIONS/SearchEngineBase.cppsrc/openms/source/APPLICATIONS/TOPPBase.cppsrc/openms/source/APPLICATIONS/TOPPExternalToolBase.cppsrc/openms/source/APPLICATIONS/sources.cmakesrc/tests/class_tests/openms/executables.cmakesrc/tests/class_tests/openms/source/MassFeatureTrace_test.cppsrc/tests/class_tests/openms/source/TOPPBase_test.cppsrc/tests/class_tests/openms/source/TOPPExternalToolBase_test.cppsrc/topp/FLASHDeconv.cppsrc/topp/FeatureFinderLFQ.cppsrc/topp/FileConverter.cppsrc/topp/INIUpdater.cppsrc/topp/LuciphorAdapter.cppsrc/topp/MRMPairFinder.cppsrc/topp/MaRaClusterAdapter.cppsrc/topp/MapAlignerPoseClustering.cppsrc/topp/MapStatistics.cppsrc/topp/NovorAdapter.cppsrc/topp/OpenNuXL.cppsrc/topp/OpenSwathExport.cppsrc/topp/OpenSwathInfer.cppsrc/topp/PercolatorAdapter.cppsrc/topp/ProSE.cppsrc/topp/RNADigestor.cppsrc/topp/SiriusExport.cppsrc/topp/SpectraSTSearchAdapter.cpp
💤 Files with no reviewable changes (1)
- src/openms/include/OpenMS/ANALYSIS/TOPDOWN/FLASHHelperClasses.h
|
hi can you give summarize what the advantage is? |
|
you mean the advantage of TOPPExternalToolBase ? |
|
I am open for that idea. Just did not come to my mind yet |
|
I think it is fine. maybe not use inheritance? |
…n_Warning_test) Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@copilot resolve the merge conflicts in this pull request |
# Conflicts: # src/topp/FeatureFinderLFQ.cpp # src/topp/MapAlignerPoseClustering.cpp
… (#9731) Backfill CHANGELOG coverage for recently merged PRs that lacked entries: Docker Arrow APT source fix (#9728), TOPPBase external-tool refactor (#9621), cross-reference the SPS precursor-matching feature to its PR (#9706), and note the pyOpenMS binding for addChargeAdduct (#9719). Claude-Session: https://claude.ai/code/session_012umKmTwmgGLGShG6wyQjxQ Co-authored-by: Claude <[email protected]>
Description
Cleans up some includes, mostly in FLASHHelperClasses.h which included TOPPBase.h...
Moves TOPP tools which call an external executable to use
TOPPExternalToolBaseas base (so others do not have to bother with it).It's not a full refactor, which I'd like to see, but its a start.
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
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.rebuild jenkinswill retrigger Jenkins-based CI buildsSummary by CodeRabbit
-write_*command-line options.