Skip to content

Conversation

@pgeier
Copy link
Contributor

@pgeier pgeier commented Nov 19, 2025

Description

This PR fixes getting CodesHandle::getBytes in metkit/codes/api/CodesAPI.cc.
The way how the number of bytes is determined has been unclear and differs from the way arrays are retrieved.
Although bytes are returned as an array, they are handled similar to string and hence have there size described through the codes_get_length call instead of codes_get_size.

The highlevel API takes care of these subtle differences. One usecase of the problem has been in the GRIBDecoder where uuidOfHGrid was accessed.

See related issue: https://jira.ecmwf.int/browse/ECC-2166

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

@pgeier pgeier force-pushed the feature/CodesHandle-fix-handling-bytes branch from 3d86c39 to 4bf0ef7 Compare November 19, 2025 23:04
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 70.37037% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.45%. Comparing base (c381622) to head (4bf0ef7).

Files with missing lines Patch % Lines
src/metkit/codes/BUFRDecoder.cc 0.00% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #129      +/-   ##
===========================================
- Coverage    70.48%   70.45%   -0.03%     
===========================================
  Files          132      132              
  Lines         8121     8140      +19     
  Branches       780      781       +1     
===========================================
+ Hits          5724     5735      +11     
- Misses        2397     2405       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pgeier pgeier force-pushed the feature/CodesHandle-fix-handling-bytes branch from 4bf0ef7 to 0628d0d Compare November 20, 2025 14:11
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