Skip to content

Fix: OrchProgramManager stores programs in reversed order - #121

Open
MohamedRady-99 wants to merge 3 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/program-order-reversed
Open

Fix: OrchProgramManager stores programs in reversed order#121
MohamedRady-99 wants to merge 3 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/program-order-reversed

Conversation

@MohamedRady-99

Copy link
Copy Markdown
Contributor

Notes for Reviewer

This PR resolves the issue with OrchProgramManager storing programs in reversed order by fixing how designs and programs are drained from their internal storage #60.

Since Design::into_programs() and OrchestrationApi::into_program_manager() both consumed their internal GrowableVec with pop(), which removes from the end (LIFO), programs and designs ended up in the reverse of the order they were added, silently breaking any code that relies on add_program/add_design insertion order.

Proposal:

Currently, into_programs() and into_program_manager() pop elements off the end of their GrowableVec, reversing the original insertion order. This PR updates the drain logic as follows:

Fix Program Order: Change Design::into_programs() to drain via remove(0) instead of pop(), so programs come out in the order they were added.
Fix Design Order: Apply the same fix to OrchestrationApi::into_program_manager() for the designs vector.
Add Regression Test: Add into_programs_preserves_insertion_order, which registers three programs and asserts they are returned in the same order they were added.

Pre-Review Checklist for the PR Author

  • PR title is short, expressive and meaningful
  • Commits are properly organized
  • Relevant issues are linked in the [References]section
  • Tests are conducted
  • Unit tests are added

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  • All open points are addressed and tracked via issues

References

Closes #60

@github-actions

github-actions Bot commented Jul 30, 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: cebf7b52-1d58-4ef5-a66e-ec4e4f8d4b1d
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'bazel_skylib', the root module requires module version bazel_skylib@1.7.1, but got bazel_skylib@1.8.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
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 (30 packages loaded, 9 targets configured)

Analyzing: target //:license-check (124 packages loaded, 320 targets configured)

Analyzing: target //:license-check (146 packages loaded, 2332 targets configured)

Analyzing: target //:license-check (154 packages loaded, 3459 targets configured)

Analyzing: target //:license-check (158 packages loaded, 3496 targets configured)

Analyzing: target //:license-check (158 packages loaded, 3496 targets configured)

Analyzing: target //:license-check (158 packages loaded, 3496 targets configured)

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

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

Analyzing: target //:license-check (177 packages loaded, 5694 targets configured)
[4 / 13] checking cached actions
Analyzing: target //:license-check (189 packages loaded, 5721 targets configured)
[13 / 17] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox ... (2 actions, 1 running)
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 141 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
Analyzing: target //:license-check (189 packages loaded, 5721 targets configured)
[14 / 17] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 1s disk-cache, processwrapper-sandbox
Analyzing: target //:license-check (189 packages loaded, 5721 targets configured)
[15 / 17] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
Analyzing: target //:license-check (189 packages loaded, 5721 targets configured)
[16 / 17] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
Analyzing: target //:license-check (189 packages loaded, 5721 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 10055 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 10055 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 10055 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 10055 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 10055 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 10055 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 10055 targets configured)
[17 / 17] no actions running
INFO: Analyzed target //:license-check (192 packages loaded, 10169 targets configured).
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: 38.355s, Critical Path: 4.09s
INFO: 17 processes: 12 internal, 4 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 17 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

@MohamedRady-99

MohamedRady-99 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Hi @dejanpan , the qnx-build (arm64-qnx) and qnx-build (x86-64-qnx) workflow is currently waiting for workflow-approval, Could you please approve it when you get a chance? Thanks!

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Bug: OrchProgramManager stores programs in reversed order

1 participant