Skip to content

Comments

hmon: type-safe tags#76

Merged
pawelrutkaq merged 1 commit intoeclipse-score:mainfrom
qorix-group:arkjedrz_type-safe-tags
Feb 23, 2026
Merged

hmon: type-safe tags#76
pawelrutkaq merged 1 commit intoeclipse-score:mainfrom
qorix-group:arkjedrz_type-safe-tags

Conversation

@arkjedrz
Copy link
Contributor

Replace IdentTag with type-safe types.

@arkjedrz arkjedrz self-assigned this Feb 16, 2026
@github-actions
Copy link

github-actions bot commented Feb 16, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.4.2) and connecting to it...
INFO: Invocation ID: dc916dcd-d9a0-4248-ae37-9927ba27e075
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'rules_python', the root module requires module version rules_python@1.4.1, but got rules_python@1.8.3 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.2.14, but got rules_cc@0.2.16 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'aspect_rules_lint', the root module requires module version aspect_rules_lint@1.5.3, but got aspect_rules_lint@2.0.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'download_utils', the root module requires module version download_utils@1.0.1, but got download_utils@1.2.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'googletest', the root module requires module version googletest@1.17.0.bcr.1, but got googletest@1.17.0.bcr.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_rust_policies', the root module requires module version score_rust_policies@0.0.3, but got score_rust_policies@0.0.5 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (29 packages loaded, 9 targets configured)

Analyzing: target //:license-check (86 packages loaded, 9 targets configured)

Analyzing: target //:license-check (136 packages loaded, 1125 targets configured)

Analyzing: target //:license-check (148 packages loaded, 3218 targets configured)

Analyzing: target //:license-check (149 packages loaded, 7608 targets configured)

Analyzing: target //:license-check (160 packages loaded, 7817 targets configured)

Analyzing: target //:license-check (160 packages loaded, 7817 targets configured)

Analyzing: target //:license-check (160 packages loaded, 7817 targets configured)

INFO: Analyzed target //:license-check (165 packages loaded, 9955 targets configured).
[9 / 15] [Prepa] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes
[14 / 16] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
[15 / 16] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 23.937s, Critical Path: 2.78s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link

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

Copy link

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

This pull request replaces the generic IdentTag type with type-safe MonitorTag and DeadlineTag types, improving type safety across the Rust-C++ FFI boundary. Additionally, it refactors the FFI layer to use a consistent error handling pattern with out-parameters and FFICode return values.

Changes:

  • Introduced type-safe tag system with MonitorTag and DeadlineTag to distinguish between different tag types at compile time
  • Refactored FFI functions to return FFICode status codes and use out-parameters for handles, with comprehensive null-pointer validation
  • Aligned error code enums between Rust (FFICode) and C++ (Error) for direct casting
  • Removed manual error conversion helper (ffi_helpers.h) in favor of direct enum casting
  • Added extensive test coverage for all FFI functions including null parameter tests

Reviewed changes

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

Show a summary per file
File Description
src/health_monitoring_lib/rust/tag.rs New module introducing type-safe MonitorTag and DeadlineTag types with FFI-compatible representation
src/health_monitoring_lib/rust/ffi.rs Refactored FFI functions to use out-parameters and FFICode return values, added comprehensive null-checking and tests
src/health_monitoring_lib/rust/deadline/ffi.rs Updated deadline FFI functions to match new pattern, added extensive test coverage
src/health_monitoring_lib/rust/lib.rs Updated API to use type-safe tags, refactored internal methods for better testability
src/health_monitoring_lib/rust/common.rs Removed IdentTag type (moved to tag module as separate types), updated trait signatures
src/health_monitoring_lib/rust/deadline/deadline_monitor.rs Updated to use MonitorTag and DeadlineTag, improved parameter naming
src/health_monitoring_lib/rust/worker.rs Updated imports and tag usage
src/health_monitoring_lib/rust/log.rs Added score_write macro export for tag formatting
src/health_monitoring_lib/cpp/include/score/hm/tag.h New C++ header defining type-safe tag classes with FFI-compatible layout
src/health_monitoring_lib/cpp/include/score/hm/common.h Updated Error enum to align with Rust, added abort_on_error helper
src/health_monitoring_lib/cpp/include/score/hm/health_monitor.h Updated API signatures to use type-safe tags
src/health_monitoring_lib/cpp/include/score/hm/deadline/deadline_monitor.h Updated API signatures to use DeadlineTag
src/health_monitoring_lib/cpp/health_monitor.cpp Implemented new FFI calling conventions with error checking
src/health_monitoring_lib/cpp/deadline_monitor.cpp Implemented new FFI calling conventions with error checking
src/health_monitoring_lib/cpp/common.cpp Added abort_on_error implementation
src/health_monitoring_lib/cpp/ffi_helpers.h Removed (obsoleted by direct enum casting)
src/health_monitoring_lib/cpp/tests/health_monitor_test.cpp Updated test to use type-safe tags
examples/rust_supervised_app/src/main.rs Updated to use MonitorTag and DeadlineTag
examples/cpp_supervised_app/main.cpp Updated to use MonitorTag and DeadlineTag
src/health_monitoring_lib/BUILD Updated build file to include tag.h and remove ffi_helpers.h

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

@arkjedrz arkjedrz force-pushed the arkjedrz_type-safe-tags branch from 1e1d2e3 to 4297f99 Compare February 23, 2026 10:35
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 23, 2026 10:35 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 23, 2026 10:35 — with GitHub Actions Inactive
Replace `IdentTag` with type-safe types.
@arkjedrz arkjedrz force-pushed the arkjedrz_type-safe-tags branch from 4297f99 to a2fec84 Compare February 23, 2026 13:13
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 23, 2026 13:13 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 23, 2026 13:13 — with GitHub Actions Inactive
@arkjedrz arkjedrz requested a review from pawelrutkaq February 23, 2026 13:16
@pawelrutkaq pawelrutkaq merged commit f88bc41 into eclipse-score:main Feb 23, 2026
14 checks passed
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.

2 participants