Skip to content

Fix: OrchProgramManager stores programs in reversed order - #121

Open
MohamedRady-99 wants to merge 2 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 2 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]
2026/07/30 11:17:51 Downloading https://releases.bazel.build/8.3.0/release/bazel-8.3.0-linux-x86_64...
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: ca1f404a-3c68-441f-9234-43729392a3aa
Computing main repo mapping: 
Computing main repo mapping: 
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 '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
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.1.1, but got rules_cc@0.2.14 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@2.0.0, but got aspect_rules_lint@2.3.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'buildifier_prebuilt', the root module requires module version buildifier_prebuilt@7.3.1, but got buildifier_prebuilt@8.5.1 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_tooling', the root module requires module version score_tooling@1.1.2, but got score_tooling@1.2.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_process', the root module requires module version score_process@1.5.3, but got score_process@1.5.4 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.14.0, but got googletest@1.15.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: 
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 (34 packages loaded, 9 targets configured)

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

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

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

Analyzing: target //:license-check (140 packages loaded, 2718 targets configured)

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

Analyzing: target //:license-check (153 packages loaded, 8061 targets configured)

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

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

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

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

Analyzing: target //:license-check (184 packages loaded, 10322 targets configured)
[10 / 17] 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
Analyzing: target //:license-check (189 packages loaded, 10333 targets configured)
[13 / 17] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox ... (2 actions 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, 10333 targets configured)
[14 / 17] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 1s disk-cache, processwrapper-sandbox
Analyzing: target //:license-check (189 packages loaded, 10333 targets configured)
[15 / 17] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
Analyzing: target //:license-check (189 packages loaded, 10333 targets configured)
[16 / 17] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
Analyzing: target //:license-check (189 packages loaded, 10333 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 14667 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 14667 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 14667 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 14667 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 14667 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 14667 targets configured)
[17 / 17] no actions running
Analyzing: target //:license-check (190 packages loaded, 14667 targets configured)
[17 / 17] no actions running
INFO: Analyzed target //:license-check (192 packages loaded, 14781 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: 49.971s, Critical Path: 4.15s
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

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