Skip to content

fix(test): package datarouter docker config at opt/datarouter/etc - #351

Merged
rmaddikery merged 1 commit into
mainfrom
fix/datarouter-config-packaging
Oct 8, 2026
Merged

rmaddikery merged 1 commit into
mainfrom
fix/datarouter-config-packaging

Conversation

@antonkri

@antonkri antonkri commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

What

Packages the datarouter component-test config so it lands at opt/datarouter/etc/* regardless of whether score_logging is built as the root module or consumed as an external Bazel dependency.

Why

The datarouter component tests (//score/test/component/datarouter:test_datarouter_filters, test_mw_log, test_mw_log_filters, …) pass in this repo's own component_tests.yml, but fail when score_logging is pulled in as an external dependency (e.g. in eclipse-score/reference_integration).

The datarouter runs with cwd=/opt/datarouter and opens ./etc/log-channels.json. In the external build the config files were packaged at:

opt/datarouter/external/score_logging+/score/test/component/datarouter/etc/log-channels.json   ❌

instead of:

opt/datarouter/etc/log-channels.json   ✅

So ReadStaticDlt fails → DltLogServer is nullptr → "static config is not available, interrupt work" → the unix socket never opens → every test times out with Datarouter not ready within 10.0s.

Root cause

score/test/component/BUILD's _datarouter_conf_pkg used:

pkg_tar(
    ...
    package_dir = "opt/datarouter",
    strip_prefix = "/score/test/component/datarouter",
)

A leading-slash strip_prefix is repo-root-relative and only matches when logging is the root module. When logging is consumed externally the file path is prefixed with external/score_logging+/, the strip matches nothing, and the whole prefix survives under package_dir.

The fix

Package the config via a package-relative pkg_files (datarouter_docker_config_pkg) using strip_prefix.from_pkg(), mirroring the existing QNX datarouter_config_pkg. This resolves to opt/datarouter/etc/* for both root and external consumption.

Downstream

reference_integration currently carries this as a local patch (eclipse-score/reference_integration#387). Once this lands and logging is bumped there, that patch can be dropped.

The datarouter component tests fail when score_logging is consumed as an
external Bazel dependency (e.g. in reference_integration): the datarouter
runs with cwd=/opt/datarouter and opens ./etc/log-channels.json, but the
config files were packaged at

    opt/datarouter/external/score_logging+/score/test/component/datarouter/etc/

instead of opt/datarouter/etc/. ReadStaticDlt then fails, DltLogServer is
nullptr ("static config is not available, interrupt work"), the unix
socket never opens, and every test times out with "Datarouter not ready".

Root cause: _datarouter_conf_pkg used pkg_tar(strip_prefix =
"/score/test/component/datarouter"). A leading-slash strip_prefix is
repo-root-relative and only matches when logging is the root module (its
own component_tests.yml CI). When logging is external the file path is
prefixed with external/score_logging+/, the strip matches nothing, and
the whole prefix survives under package_dir.

Fix: package the config via a package-relative pkg_files
(datarouter_docker_config_pkg) using strip_prefix.from_pkg(), mirroring
the existing QNX datarouter_config_pkg. This resolves to
opt/datarouter/etc/* for both root and external consumption.
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: 4fd54b72-b9e1-4eb8-ad9a-b89e53cabb47
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'score_docs_as_code', the root module requires module version score_docs_as_code@8.2.0, but got score_docs_as_code@8.3.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 4 packages loaded
Loading: 4 packages loaded
    currently loading: 
WARNING: Target pattern parsing failed.
ERROR: Skipping '//:license-check': no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
ERROR: no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
INFO: Elapsed time: 17.370s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@antonkri
antonkri deployed to workflow-approval October 6, 2026 14:52 — with GitHub Actions Active
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

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

@antonkri
antonkri force-pushed the fix/datarouter-config-packaging branch from cadd7b1 to 48465a2 Compare October 6, 2026 15:35
@antonkri
antonkri deployed to workflow-approval October 6, 2026 15:35 — with GitHub Actions Active
@antonkri
antonkri marked this pull request as ready for review October 7, 2026 05:33
@rmaddikery
rmaddikery merged commit 3d98966 into main Oct 8, 2026
39 of 42 checks passed
@rmaddikery
rmaddikery deleted the fix/datarouter-config-packaging branch October 8, 2026 06:04

This branch was successfully deployed

1 active deployment
workflow-approval — 48465a2e Deployed Oct 6, 2026 by antonkri via run-tests / coverage approval gate #1299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants