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-commenter commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 57.57576% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.73%. Comparing base (33f1681) to head (df5ee2a).

Files with missing lines Patch % Lines
src/metkit/codes/BUFRDecoder.cc 0.00% 11 Missing ⚠️
src/metkit/codes/GRIBDecoder.cc 81.25% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #129      +/-   ##
===========================================
- Coverage    70.81%   70.73%   -0.09%     
===========================================
  Files          132      132              
  Lines         8182     8207      +25     
  Branches       784      785       +1     
===========================================
+ Hits          5794     5805      +11     
- Misses        2388     2402      +14     

☔ 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
@pgeier pgeier force-pushed the feature/CodesHandle-fix-handling-bytes branch from 0628d0d to a637c23 Compare January 8, 2026 10:15
@Ozaq Ozaq marked this pull request as draft January 8, 2026 12:26
@pgeier pgeier force-pushed the feature/CodesHandle-fix-handling-bytes branch 3 times, most recently from 3450333 to fc6c8e7 Compare January 9, 2026 10:51
@pgeier pgeier force-pushed the feature/CodesHandle-fix-handling-bytes branch from fc6c8e7 to df5ee2a Compare January 9, 2026 10:54
@pgeier pgeier marked this pull request as ready for review January 9, 2026 10:55
@pgeier pgeier requested a review from Ozaq January 9, 2026 14:34
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