Skip to content

Add user manuals for time module#133

Draft
ryan-steel wants to merge 7 commits into
eclipse-score:mainfrom
etas-contrib:docs/ryan-steel-LudwigAtBosch-user-manual
Draft

Add user manuals for time module#133
ryan-steel wants to merge 7 commits into
eclipse-score:mainfrom
etas-contrib:docs/ryan-steel-LudwigAtBosch-user-manual

Conversation

@ryan-steel

@ryan-steel ryan-steel commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Improvement

Adds user-facing documentation for S-CORE time module and its key components.

Description

  • Added module manuals for integration and troubleshooting

  • Added component manuals for time library, TimeSlave, and TimeDaemon

  • Added main index links so users can navigate module and component docs

  • For building with docs in component subdirectories:

    • Moved Sphinx entry files to repository root
    • Updated Sphinx config to include documentation paths only
    • Documentation build passes with zero warnings

Note: This is a workaround taken from DR-008-infra - when the fix for that is introduced we should update to use whatever solution the infra team come up with. I've created an improvement ticket (#136) to make sure we don't lose track of that update.

Further work

I don't like that the root index.rst references only time_daemon but #123 already adds an update to the document.

Related Ticket

closes #125 (improvement ticket)

Ryan Steel and others added 6 commits July 15, 2026 12:44
It includes

- An overall architecture introduction and a guide for choosing the
  right clock.
- A detailed API description covering basic usage, lifecycle management,
  advanced subscriptions, and unit-testing patterns.
- A dedicated integration guide for system integrators.
- A troubleshooting guide for diagnosing common runtime issues.
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

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.6.0) and connecting to it...
INFO: Invocation ID: 4672daf4-45ce-418a-a803-50c0383b8907
Computing main repo mapping: 
WARNING: /home/runner/work/time/time/MODULE.bazel:13:7: The attribute 'compatibility_level' in module() is a no-op and will be removed in a future Bazel release. Please remove it from your MODULE.bazel file.
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 3 packages loaded
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)

Analyzing: target //:license-check (54 packages loaded, 10 targets configured)

Analyzing: target //:license-check (142 packages loaded, 2534 targets configured)

Analyzing: target //:license-check (157 packages loaded, 6170 targets configured)

Analyzing: target //:license-check (162 packages loaded, 6219 targets configured)

Analyzing: target //:license-check (162 packages loaded, 6219 targets configured)

Analyzing: target //:license-check (162 packages loaded, 6219 targets configured)

Analyzing: target //:license-check (165 packages loaded, 8106 targets configured)

Analyzing: target //:license-check (165 packages loaded, 8106 targets configured)

Analyzing: target //:license-check (167 packages loaded, 8847 targets configured)

Analyzing: target //:license-check (169 packages loaded, 11296 targets configured)

Analyzing: target //:license-check (169 packages loaded, 11296 targets configured)

Analyzing: target //:license-check (169 packages loaded, 11296 targets configured)

Analyzing: target //:license-check (169 packages loaded, 11296 targets configured)

Analyzing: target //:license-check (169 packages loaded, 11296 targets configured)

INFO: Analyzed target //:license-check (170 packages loaded, 11422 targets configured).
[10 / 16] Creating runfiles tree bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/score_tooling+/dash/tool/formatters/dash_format_converter.runfiles [for tool]; 0s local ... (2 actions, 1 running)
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 2 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
[15 / 16] [Prepa] Building license.check.license_check.jar ()
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: 34.793s, Critical Path: 1.83s
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
Copy Markdown

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds user-facing Sphinx documentation for the S-CORE time module (module manual + component manuals), and updates the documentation build layout to allow building docs that live in component subdirectories.

Changes:

  • Added new user manuals for the time library, TimeSlave, and TimeDaemon (including examples and API usage chapters).
  • Added module-level manual and troubleshooting guide under docs/manuals/, and linked manuals/features from the root index.rst.
  • Switched the Sphinx/Bazel docs entry-point to the repository root via source_dir = "." and include_patterns filtering.

Reviewed changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
score/time/docs/manuals/user_manual.rst Time library user manual with clock selection, API toctrees, build integration, and runtime requirements links.
score/time/docs/manuals/examples/index.rst Index page describing time examples and how to build/run them.
score/time/docs/manuals/examples/basic_clocks.rst Manual page documenting basic clock examples and common patterns.
score/time/docs/manuals/examples/vehicle_time.rst Manual page documenting the VehicleTime example, output, tests, and Bazel target structure.
score/time/docs/manuals/api_description/api_usage.rst API usage guide for polling VehicleTime and handling reliability.
score/time/docs/manuals/api_description/lifecycle.rst Lifecycle management guide (Init/WaitUntilAvailable/IsAvailable).
score/time/docs/manuals/api_description/testing_guide.rst Testing guide describing clock overrides and test patterns.
score/time/docs/manuals/api_description/advanced_api.rst Advanced API guide for subscribing to low-level PTP events and threading considerations.
score/time_slave/docs/manuals/user_manual.rst TimeSlave component user manual (overview, configuration toctree, runtime requirements).
score/time_slave/docs/manuals/config/configuration_guide.rst TimeSlave configuration guide and CLI options/defaults.
score/time_slave/docs/index.rst Component index trimmed to a minimal toctree entry.
score/time_daemon/docs/manuals/user_manual.rst TimeDaemon component user manual (overview, configuration toctree, runtime requirements).
score/time_daemon/docs/manuals/config/configuration_guide.rst TimeDaemon configuration guide (no external config; shared memory details).
index.rst Root documentation index updated to link into docs/features and docs/manuals, plus component documentation links.
docs/manuals/index.rst Manuals index added to include the module user manual.
docs/manuals/user_manual.rst Module-level user manual describing integration, deployment, and links to component manuals.
docs/manuals/troubleshooting_guide.rst Module troubleshooting guide (reliability/availability issues, IPC mismatch, logging contexts).
conf.py Sphinx include filtering added; templates path adjusted.
BUILD Docs rule updated to build with source_dir = "." (root-based Sphinx entry).
Comments suppressed due to low confidence (2)

conf.py:62

  • templates_path points to "docs/templates", but that directory doesn’t exist in the repository. If templates aren’t used, set templates_path to an empty list to avoid confusion and potential build warnings.
    index.rst:52
  • The "Component Documentation" toctree only links to TimeSlave’s component index even though the docs set added manuals for multiple components. This makes the section title misleading and makes it harder to navigate directly to the manuals.

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

Comment on lines +109 to +112
3. Include headers and compile your code

.. For detailed API usage and examples, refer to the :doc:`/score/time/docs/manuals/user_manual`.
Comment on lines +44 to +45
Component Manuals
-----------------
Comment on lines +116 to +119
The ``time`` module requires two system daemons to be running. These processes must be managed by the system's service manager (e.g., `systemd` on Linux, or a launch script on QNX).

.. For detailed configuration of each daemon (OS privileges, network configuration, command-line arguments), refer to the :ref:`component_manuals<component manuals>` linked above.
Comment on lines +33 to +57
#include "score/time/clock/src/clock_backend_mock.h"
#include "score/time/vehicle_time.h"
#include <chrono>
#include <memory>

// A helper class to manage a fake clock backend in tests.
class ClockTestFactory {
public:
// Creates the backend and returns a shared_ptr to it.
// This backend is then passed to the ScopedClockOverride.
std::shared_ptr<score::time::test_utils::ClockBackendMock<score::time::VehicleTime>>
CreateFakeClock() {
fake_clock_backend_ = std::make_shared<score::time::test_utils::ClockBackendMock<score::time::VehicleTime>>();
return fake_clock_backend_;
}

// Advances the time on the created fake clock.
void AdvanceTime(std::chrono::nanoseconds duration) {
// We simulate a monotonic clock by shifting the offset of the mock
// to return a progressively advanced timestamp on every subsequent call.
current_time_ += duration;
ON_CALL(*fake_clock_backend_, Now())
.WillByDefault(testing::Return(score::time::TimeSnapshot<score::time::VehicleTime>(
score::time::VehicleTime::time_point(current_time_))));
}
Comment on lines +54 to +57
**Cause & Solution:**

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

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

docs/manuals/: Create user manual

3 participants