Skip to content

[API,BUILD,TEST] Narrow public header dependencies - #10087

Merged
timosachsenberg merged 5 commits into
OpenMS:developfrom
timosachsenberg:architecture/batch-03-public-headers
Sep 8, 2026
Merged

timosachsenberg merged 5 commits into
OpenMS:developfrom
timosachsenberg:architecture/batch-03-public-headers

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Implements step 3 of #10083.

Selected public headers currently expose format dispatchers and implementation-only dependencies through incidental includes. This forward-declares reference-only types in FileHandler, ExperimentalDesign, and SpectrumMetaDataLookup, moves the unchanged ToolInfo aggregate into DATASTRUCTURES/ToolInfo.h, and keeps Parquet reader/writer and concrete Arrow file-I/O headers in the implementation.

Consumers that lose a transitive include gain a direct one. Consumers that already reach a type through another header they include directly are left alone; every remaining added include was checked against this branch's include graph and none is reachable another way. FileHandler.cpp includes TransformationDescription.h as the implementation of the narrowed header, and QualityControl.cpp is the one tool that reached the type only through FileHandler.h. ToolInfo is added to the header installation list and remains available through the existing serializer headers.

Declared signatures and ToolInfo members remain unchanged. Downstream code relying on incidental includes may need to add its own includes; CHANGELOG documents this source-level cleanup.

Validation: source dependency baseline passes; ToolInfo member declarations match the original; install registration and git diff --check pass. Class tests, TOPP consumers, and nanobind consumers are compiled by PR CI; no local OpenMS build was run. Kept draft until CI completes.

Independent of the include-removal PR #10086.

Summary by CodeRabbit

  • New Features

    • Added the public ToolInfo data structure for parameter-file metadata and serializers.
  • Build System

    • Narrowed public header dependencies and relocated ToolInfo to a dedicated data-structures header.
    • Consumers should include the types they use directly rather than relying on transitive includes.
  • Documentation

    • Updated the OpenMS 3.6.0 changelog with the public-header and ToolInfo changes.

Forward-declare reference-only types, share ToolInfo independently of CTD,
and keep Parquet implementation includes in the implementation. Compile
eight public headers in separate translation units without unity/PCH.

Part of OpenMS#10083, step 3.
…rget

Twenty of the TransformationDescription includes and both
ProteinIdentification includes added for the narrowed headers were already
reached through a header each consumer includes directly. Keep the include in
FileHandler.cpp, which implements the narrowed header, and in
QualityControl.cpp, which reached the type only through FileHandler.h.

Remove the per-header object library from the class-test build: it listed
only the eight headers touched here and CI already compiles every consumer.
@timosachsenberg
timosachsenberg marked this pull request as ready for review September 8, 2026 20:21
@timosachsenberg

Copy link
Copy Markdown
Contributor Author

Just cleanup

@timosachsenberg
timosachsenberg merged commit 332786a into OpenMS:develop Sep 8, 2026
11 of 12 checks passed
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9532fd6a-78ab-4b22-b65e-1aa1bc184a1e

📥 Commits

Reviewing files that changed from the base of the PR and between c4b0ab1 and bbe7443.

📒 Files selected for processing (20)
  • CHANGELOG
  • src/openms/include/OpenMS/DATASTRUCTURES/ToolInfo.h
  • src/openms/include/OpenMS/DATASTRUCTURES/sources.cmake
  • src/openms/include/OpenMS/FORMAT/FileHandler.h
  • src/openms/include/OpenMS/FORMAT/ParamCTDFile.h
  • src/openms/include/OpenMS/FORMAT/ParamCWLFile.h
  • src/openms/include/OpenMS/FORMAT/ParamJSONFile.h
  • src/openms/include/OpenMS/FORMAT/ParquetFile.h
  • src/openms/include/OpenMS/METADATA/ExperimentalDesign.h
  • src/openms/include/OpenMS/METADATA/SpectrumMetaDataLookup.h
  • src/openms/source/FORMAT/FileHandler.cpp
  • src/openms/source/FORMAT/ParquetFile.cpp
  • src/openms/source/FORMAT/PepXMLFile.cpp
  • src/openms/source/METADATA/SpectrumMetaDataLookup.cpp
  • src/tests/class_tests/openms/CMakeLists.txt
  • src/tests/class_tests/openms/source/OpenSwathResultsExporter_test.cpp
  • src/tests/class_tests/openms/source/SpectrumMetaDataLookup_test.cpp
  • src/topp/FeatureLinkerUnlabeled.cpp
  • src/topp/PhosphoScoring.cpp
  • src/topp/QualityControl.cpp

📝 Walkthrough

Walkthrough

The change narrows selected public-header dependencies, adds the shared ToolInfo header, and adds direct includes to affected source files, tools, and tests. The changelog records the include changes.

Changes

Public Header Dependency Cleanup

Layer / File(s) Summary
Shared ToolInfo contract
src/openms/include/OpenMS/DATASTRUCTURES/ToolInfo.h, src/openms/include/OpenMS/DATASTRUCTURES/sources.cmake, src/openms/include/OpenMS/FORMAT/*
Adds the shared ToolInfo structure and updates parameter-file headers to use direct dependencies.
Narrowed public header dependencies
src/openms/include/OpenMS/FORMAT/FileHandler.h, src/openms/include/OpenMS/FORMAT/ParquetFile.h, src/openms/include/OpenMS/METADATA/*
Replaces heavyweight or concrete includes with forward declarations and generic interfaces where applicable.
Updated source and consumer includes
src/openms/source/*, src/topp/*, src/tests/class_tests/openms/*, CHANGELOG
Adds direct includes for required types and records the public-header changes in the changelog.

Suggested reviewers: cbielow

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

A rabbit checks each header line
Direct includes now fit and shine
ToolInfo hops to its new home
No hidden paths need rabbits roam
Tests and tools declare what they use
Clean little builds have less to lose

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

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.

1 participant