Skip to content

fix(lifecycle_client): link lifecycle_mock against lifecyclemanager t…#337

Open
Chahult wants to merge 3 commits into
eclipse-score:mainfrom
Chahult:fix/lifecycle_mock_vtable_link_v0.2.0
Open

fix(lifecycle_client): link lifecycle_mock against lifecyclemanager t…#337
Chahult wants to merge 3 commits into
eclipse-score:mainfrom
Chahult:fix/lifecycle_mock_vtable_link_v0.2.0

Conversation

@Chahult

@Chahult Chahult commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

…o resolve vtable

lifecycle_mock provides a mock implementation of LifeCycleManager, which inherits from the concrete class defined in lifecyclemanager.cpp. Without linking against the :lifecyclemanager target, the vtable symbol is undefined when building lifecycle_mock as a shared library (--no-allow-shlib-undefined).

Added :lifecyclemanager to lifecycle_mock's deps to provide the vtable.

@github-actions

github-actions Bot commented Jul 21, 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: eb158309-b954-4c9c-8cf3-1244f3c8d6d8
Computing main repo mapping: 
Computing main repo mapping: 
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: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

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

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

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

Analyzing: target //:license-check (144 packages loaded, 2767 targets configured)

Analyzing: target //:license-check (156 packages loaded, 5498 targets configured)

Analyzing: target //:license-check (161 packages loaded, 5547 targets configured)

Analyzing: target //:license-check (161 packages loaded, 5547 targets configured)

Analyzing: target //:license-check (161 packages loaded, 5547 targets configured)

Analyzing: target //:license-check (164 packages loaded, 7434 targets configured)

Analyzing: target //:license-check (164 packages loaded, 7434 targets configured)

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

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

INFO: Analyzed target //:license-check (169 packages loaded, 10409 targets configured).
[13 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox
[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: 32.363s, Critical Path: 2.33s
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>]

@anmittag

Copy link
Copy Markdown
Member

@Chahult some checks are failing,are you planning to adapt or delete the PR?

@anmittag anmittag moved this from Backlog to Ready in LCM - Lifecycle & Health FT Jul 21, 2026
@Chahult
Chahult force-pushed the fix/lifecycle_mock_vtable_link_v0.2.0 branch from bd15106 to 73c9454 Compare July 22, 2026 04:46
@Chahult
Chahult requested a deployment to workflow-approval July 22, 2026 04:46 — with GitHub Actions Waiting
@Chahult
Chahult requested a deployment to workflow-approval July 22, 2026 04:46 — with GitHub Actions Waiting
@Chahult
Chahult force-pushed the fix/lifecycle_mock_vtable_link_v0.2.0 branch from 73c9454 to 2da00ec Compare July 22, 2026 11:19
@Chahult
Chahult requested a deployment to workflow-approval July 22, 2026 11:19 — with GitHub Actions Waiting
@Chahult
Chahult requested a deployment to workflow-approval July 22, 2026 11:19 — with GitHub Actions Waiting
@Chahult
Chahult force-pushed the fix/lifecycle_mock_vtable_link_v0.2.0 branch from 2da00ec to 4e403ba Compare July 22, 2026 11:22
@Chahult
Chahult requested a deployment to workflow-approval July 22, 2026 11:22 — with GitHub Actions Waiting
@Chahult
Chahult requested a deployment to workflow-approval July 22, 2026 11:22 — with GitHub Actions Waiting
@github-actions

Copy link
Copy Markdown

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

@Chahult
Chahult force-pushed the fix/lifecycle_mock_vtable_link_v0.2.0 branch from 4e403ba to 9ae0e52 Compare July 23, 2026 04:37
@Chahult
Chahult requested a deployment to workflow-approval July 23, 2026 04:37 — with GitHub Actions Waiting
@Chahult
Chahult requested a deployment to workflow-approval July 23, 2026 04:37 — with GitHub Actions Waiting
@Chahult

Chahult commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@NicolasFussberger Could you please review

@Chahult Chahult removed their assignment Jul 23, 2026
@Chahult

Chahult commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@Chahult some checks are failing,are you planning to adapt or delete the PR?

Adapt the changes for config management
Please assign this to me and also add Nicolas Fußberger as a reviewer

@Chahult
Chahult force-pushed the fix/lifecycle_mock_vtable_link_v0.2.0 branch from 9ae0e52 to 2de1db3 Compare July 23, 2026 05:56
@Chahult
Chahult requested a deployment to workflow-approval July 23, 2026 05:56 — with GitHub Actions Waiting
@Chahult
Chahult requested a deployment to workflow-approval July 23, 2026 05:56 — with GitHub Actions Waiting
lifecycle_mock provides a mock of LifeCycleManager which inherits from
the concrete class. Without :lifecyclemanager in its deps the vtable
symbol is undefined when building lifecycle_mock as a shared library
(--no-allow-shlib-undefined).

Also guard all ApplicationContext callbacks against null to prevent
std::bad_function_call when a global ApplicationContext is constructed
before any ApplicationContextMock instance exists.
@Chahult
Chahult force-pushed the fix/lifecycle_mock_vtable_link_v0.2.0 branch from 2de1db3 to 5ddb37e Compare July 23, 2026 06:21
@Chahult
Chahult requested a deployment to workflow-approval July 23, 2026 06:21 — with GitHub Actions Waiting
@Chahult
Chahult requested a deployment to workflow-approval July 23, 2026 06:21 — with GitHub Actions Waiting
@Chahult
Chahult requested a deployment to workflow-approval July 23, 2026 07:17 — with GitHub Actions Waiting
@Chahult
Chahult requested a deployment to workflow-approval July 23, 2026 07:17 — with GitHub Actions Waiting
strip_include_prefix = "/score/launch_manager/src/lifecycle_client/src",
tags = ["FUSA"],
visibility = ["//score/launch_manager:__subpackages__"],
visibility = ["//visibility:public"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this necessary for the current mocking to work?
In the score meeting we had discussed that ideally we would like to just expose a single bazel target for the lifecycle API

@Chahult Chahult Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, now instead of making individual targets public, I've added a single lifecycle_test_mocks facade target with //visibility:public, reverting all internal targets back to //score/launch_manager:subpackages. External packages should now depend only on :lifecycle_test_mocks.

@NicolasFussberger

Copy link
Copy Markdown
Contributor

@Chahult In the lifecycle repo we have a bit the problem that these mocks were contributed but we have no tests for them at the moment and its also not really obvious how to use them.
This is why currently, there is a high chance we accidentally break them.

Would it be possible for you to contribute some tests based on your usage of these mocks? E.g. for some example application we have in the examples folder?

@Chahult

Chahult commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

@Chahult In the lifecycle repo we have a bit the problem that these mocks were contributed but we have no tests for them at the moment and its also not really obvious how to use them. This is why currently, there is a high chance we accidentally break them.

Would it be possible for you to contribute some tests based on your usage of these mocks? E.g. for some example application we have in the examples folder?

Sure, Done — added examples/cpp_lifecycle_app/lifecycle_mocks_UT.cpp with tests that mirror how config_management uses the mocks (argument injection via ApplicationContextMock, lifecycle flow via LifeCycleManagerMock). These also serve as usage documentation for future contributors.

@Chahult
Chahult force-pushed the fix/lifecycle_mock_vtable_link_v0.2.0 branch from 80d7948 to f619102 Compare July 24, 2026 04:59
@Chahult
Chahult requested a deployment to workflow-approval July 24, 2026 04:59 — with GitHub Actions Waiting
@Chahult
Chahult requested a deployment to workflow-approval July 24, 2026 04:59 — with GitHub Actions Waiting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

3 participants