Skip to content

flatbuffers: Add LoadBuffer utility#176

Merged
4og merged 1 commit into
eclipse-score:mainfrom
etas-contrib:add-flatbuffer-load-buffer
May 13, 2026
Merged

flatbuffers: Add LoadBuffer utility#176
4og merged 1 commit into
eclipse-score:mainfrom
etas-contrib:add-flatbuffer-load-buffer

Conversation

@paulquiring
Copy link
Copy Markdown
Contributor

@paulquiring paulquiring commented May 6, 2026

flatbuffers: Add LoadBuffer

score/flatbuffers/load_buffer.hpp — public API header with LoadBuffer functions returning a Result type
score/flatbuffers/details/load_buffer_internal.hpp — internal implementation details
score/flatbuffers/details/load_buffer.cpp — implementation translation unit
score/flatbuffers/details/load_buffer_test.cpp - unit test
score/flatbuffers/test/load_buffer_test.cpp - integration test

Build & CI changes

score/flatbuffers/BUILD - added flatbufferutils library for LoadBuffer
.github/workflows/coverage_report.yml — added --source-directory option
.gitignore — added cpp_coverage directory

Tooling fixes

.clang-tidy-minimal — renamed ExtraArgs → ExtraArgsBefore
.pre-commit-config.yaml — excluded load_buffer_internal.hpp from clang-tidy (private header with no compile commands; checked indirectly via load_buffer.cpp)
score/flatbuffers/examples/config_usecase/demo_app_test.cpp — minor cleanup

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

The created documentation from the pull request is available at: docu-html

@paulquiring paulquiring temporarily deployed to workflow-approval May 6, 2026 11:20 — with GitHub Actions Inactive
@paulquiring paulquiring temporarily deployed to workflow-approval May 6, 2026 11:20 — with GitHub Actions Inactive
@paulquiring paulquiring changed the title Add flatbuffer load buffer flatbuffers: Add flatbuffer load buffer May 6, 2026
@paulquiring paulquiring temporarily deployed to workflow-approval May 6, 2026 11:55 — with GitHub Actions Inactive
@paulquiring paulquiring temporarily deployed to workflow-approval May 6, 2026 11:55 — with GitHub Actions Inactive
@paulquiring paulquiring temporarily deployed to workflow-approval May 6, 2026 12:06 — with GitHub Actions Inactive
@paulquiring paulquiring temporarily deployed to workflow-approval May 6, 2026 12:06 — with GitHub Actions Inactive
Comment thread score/flatbuffers/BUILD Outdated
Comment thread score/flatbuffers/BUILD
Comment thread score/flatbuffers/BUILD Outdated
Comment thread score/flatbuffers/load_buffer.hpp Outdated
Comment thread score/flatbuffers/load_buffer.hpp Outdated
Comment thread score/flatbuffers/load_buffer.hpp Outdated
Comment thread score/flatbuffers/details/load_buffer_internal.hpp
Comment thread score/flatbuffers/src/load_buffer_test.cpp Outdated
Comment thread score/flatbuffers/src/load_buffer_test.cpp Outdated
Comment thread score/flatbuffers/src/load_buffer_test.cpp Outdated
Comment thread score/flatbuffers/test/load_buffer_test.cpp Outdated
Copy link
Copy Markdown
Contributor

@OliverHeilwagen OliverHeilwagen left a comment

Choose a reason for hiding this comment

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

Only remaining point is API return type: Result vs expected.

@paulquiring
Copy link
Copy Markdown
Contributor Author

Only remaining point is API return type: Result vs expected.

I just found out its score::os::Result (score::cpp::expected<R, score::os::Error>) vs score::Result. Surprisingly score::Result has it's how expected implementation. It looks like there is some history behind that. I'll add this to the baselibs meeting agenda.

@OliverHeilwagen
Copy link
Copy Markdown
Contributor

Only remaining point is API return type: Result vs expected.

I just found out its score::os::Result (score::cpp::expected<R, score::os::Error>) vs score::Result. Surprisingly score::Result has it's how expected implementation. It looks like there is some history behind that. I'll add this to the baselibs meeting agenda.

In this case i would assume we should go with score::Result as it is more fitting for the other utility methods.
Discussion about the different expected implementation i would still appreciate. I think we analysed once and the Result version seemed more advanced, as it also supports the monadic operations in comparison to the futurecpp version.

@paulquiring paulquiring requested a deployment to workflow-approval May 7, 2026 17:42 — with GitHub Actions Waiting
@paulquiring paulquiring requested a deployment to workflow-approval May 7, 2026 17:42 — with GitHub Actions Waiting
@paulquiring paulquiring temporarily deployed to workflow-approval May 7, 2026 17:46 — with GitHub Actions Inactive
@paulquiring paulquiring temporarily deployed to workflow-approval May 7, 2026 17:46 — with GitHub Actions Inactive
@paulquiring paulquiring changed the title flatbuffers: Add flatbuffer load buffer flatbuffers: Add LoadBuffer utility May 7, 2026
@paulquiring
Copy link
Copy Markdown
Contributor Author

@4og and @fbaeuerle would it be possible to squash merge this pr with the message:

flatbuffers: Add LoadBuffer

score/flatbuffers/load_buffer.hpp — public API header with LoadBuffer functions returning a Result type
score/flatbuffers/details/load_buffer_internal.hpp — internal implementation details
score/flatbuffers/details/load_buffer.cpp — implementation translation unit
score/flatbuffers/details/load_buffer_test.cpp - unit test
score/flatbuffers/test/load_buffer_test.cpp - integration test

Build & CI changes

score/flatbuffers/BUILD - flatbufferutils library for LoadBuffer
.github/workflows/coverage_report.yml — added external symlink creation for genhtml in coverage reporting (OSS flatbuffers headers)
.gitignore — added cpp_coverage directory

Tooling fixes

.clang-tidy-minimal — renamed ExtraArgs → ExtraArgsBefore
.pre-commit-config.yaml — excluded load_buffer_internal.hpp from clang-tidy (private header with no compile commands; checked indirectly via load_buffer.cpp)
score/flatbuffers/examples/config_usecase/demo_app_test.cpp — minor cleanup

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

Adds a new score::flatbuffers::LoadBuffer utility to load binary FlatBuffer files into either std::vector<uint8_t> or std::pmr::vector<uint8_t>, and wires it into examples, tests, Bazel, and CI tooling.

Changes:

  • Introduce public LoadBuffer API plus internal OS-abstraction-based implementation and translation unit.
  • Add unit + integration tests for success and error-path behaviors; update the config-usecase demo test to use the new API.
  • Add Bazel targets and supporting CI/tooling tweaks (coverage symlink, clang-tidy config rename, pre-commit exclusions, gitignore).

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
score/flatbuffers/load_buffer.hpp New public API header declaring LoadBuffer overloads and documenting error behavior.
score/flatbuffers/details/load_buffer_internal.hpp New internal templated implementation using OS abstractions (open/fstat/read/close).
score/flatbuffers/details/load_buffer.cpp Implements the public API by delegating to the internal implementation.
score/flatbuffers/details/load_buffer_test.cpp Unit tests with OS mocks + smoke tests for public API.
score/flatbuffers/test/load_buffer_test.cpp Integration tests performing real filesystem I/O and checking returned Error::Codes.
score/flatbuffers/examples/config_usecase/demo_app_test.cpp Switch demo to use LoadBuffer instead of ad-hoc file reading.
score/flatbuffers/examples/config_usecase/BUILD Add dependency on the new flatbufferutils library.
score/flatbuffers/details/idl_parser.cpp Relocates/provides minimal FlatBuffers version symbol implementation.
score/flatbuffers/BUILD Adds flatbufferutils library and new cc_test targets; updates flatbufferscpp source path.
.github/workflows/coverage_report.yml Creates/removes an external symlink so genhtml can resolve external flatbuffers headers.
.gitignore Ignores generated cpp_coverage output directory.
.clang-tidy-minimal Renames clang-tidy config key to ExtraArgsBefore.
.pre-commit-config.yaml Excludes load_buffer_internal.hpp from clang-tidy and updates exclude regex.

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

Comment thread score/flatbuffers/details/load_buffer_internal.hpp
Comment thread score/flatbuffers/details/load_buffer_internal.hpp
Comment thread score/flatbuffers/test/load_buffer_test.cpp
Comment thread .pre-commit-config.yaml Outdated
@paulquiring paulquiring force-pushed the add-flatbuffer-load-buffer branch from 0d42c0e to 8526c57 Compare May 12, 2026 12:23
@paulquiring paulquiring force-pushed the add-flatbuffer-load-buffer branch from fc692a8 to e4fb461 Compare May 12, 2026 13:03
score/flatbuffers/load_buffer.hpp — public API header with LoadBuffer functions returning a Result type
score/flatbuffers/details/load_buffer_internal.hpp — internal implementation details
score/flatbuffers/details/load_buffer.cpp — implementation translation unit
score/flatbuffers/details/load_buffer_test.cpp - unit test
score/flatbuffers/test/load_buffer_test.cpp - integration test

Build & CI changes

score/flatbuffers/BUILD - added flatbufferutils library for LoadBuffer
.github/workflows/coverage_report.yml — added --source-directory option
.gitignore — added cpp_coverage directory

Tooling fixes

.clang-tidy-minimal — renamed ExtraArgs → ExtraArgsBefore
.pre-commit-config.yaml — excluded load_buffer_internal.hpp from clang-tidy (private header with no compile commands; checked indirectly via load_buffer.cpp)
score/flatbuffers/examples/config_usecase/demo_app_test.cpp — minor cleanup
@paulquiring paulquiring force-pushed the add-flatbuffer-load-buffer branch from e4fb461 to 5ac15ee Compare May 12, 2026 13:11
@paulquiring paulquiring temporarily deployed to workflow-approval May 12, 2026 13:11 — with GitHub Actions Inactive
@paulquiring paulquiring temporarily deployed to workflow-approval May 12, 2026 13:11 — with GitHub Actions Inactive
@github-project-automation github-project-automation Bot moved this from In Progress to On Hold in BAS - Baselibs FT May 13, 2026
@4og 4og added this pull request to the merge queue May 13, 2026
@4og 4og removed this pull request from the merge queue due to a manual request May 13, 2026
@4og 4og added this pull request to the merge queue May 13, 2026
Merged via the queue into eclipse-score:main with commit ee9aefa May 13, 2026
17 checks passed
@github-project-automation github-project-automation Bot moved this from On Hold to Done in BAS - Baselibs FT May 13, 2026
@4og 4og added the comp-flatbuffers Related to score/flatbuffers component label May 15, 2026
@paulquiring paulquiring deleted the add-flatbuffer-load-buffer branch May 18, 2026 11:48
@paulquiring
Copy link
Copy Markdown
Contributor Author

Closes #126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-flatbuffers Related to score/flatbuffers component

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants