Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement policy merge in dataflow dynamics #3

Closed

Conversation

eduardacoppo
Copy link

What is this PR for

[sc-68813]

On-top of rock-core#462

How I did it

Results, How I tested

Checklist

  • Assign yourself in the PR
  • Write unit tests (when relevant)
  • Run rubocop and rake tests locally
  • If this PR initialize a CMAKE package please enable styling and linting
  • Analyse if this PR modifies the UI, if so:
    • Tested Tupan's simulation (Charts) 🗺️
    • Tested Tupan's simulation (Hud) 🕹️
    • Tested ROV's simulation 🕹️

wvmcastro and others added 30 commits September 5, 2024 19:08
log_dir does not exist within this context
feat: can_deploy_all method in profile assertions
chore: avoid re-resolving a query in dynamic port bindings if the current selection matches
Ftpd base methods expect data_dir to be a string
re-add find_all_dataset_folders function and rewrite dataset folders in the root folder transfer test to match the pattern
eduardacoppo and others added 7 commits February 17, 2025 15:13
@eduardacoppo eduardacoppo self-assigned this Feb 18, 2025
…ation

feat: early deploy at network generation
@eduardacoppo eduardacoppo force-pushed the policy_merge_in_dataflow_dynamics branch from 340f306 to 3a91448 Compare February 18, 2025 16:29
kapeps and others added 7 commits February 18, 2025 15:59
- Correctly merges policy, making sure :init is only set if it wasn't already defined.
  This prevents :init from being overwritten when explicitly provided.
- Adds a test to confirm that an existing :init value remains unchanged.
Fixes incorrect .and_return(...) usage in tests, replacing it with .with(...) to properly validate method arguments.
@eduardacoppo eduardacoppo force-pushed the init_policy_defaults_to_true branch from 1b547b7 to f28f627 Compare February 24, 2025 16:27
kapeps and others added 3 commits February 24, 2025 14:17
chore: warn in case it could not find unmanaged task
…o_true

feat: add flag to set init policy to true
@eduardacoppo eduardacoppo changed the base branch from init_policy_defaults_to_true to transition-to-runkit February 25, 2025 13:01
Previously, if a parameter was added to the designer-provided policy, no automated policy determination would be performed. That meant that the init flag would not be computed in this case.
To fix this, a merge_policy function was implemented to merge the explicit policy (the designer-provided one) and the computed policy (init, for instance)
The fix follows these rules:
- if a value is in policy, use it;
- otherwise use the value from computed_policy
Also, if the type policy is set to data, the size policy must be removed, as its only meaningful for the type buffer and it causes the connection to fail.

The Ruby method `merge` merges two hashes. According to the documentation:
"Returns a new hash containing the contents of other_hash and the contents of hsh. If no block is specified, the value for entries with duplicate keys will be that of other_hash."
In this case, to follow the rules of prioritizing the value from explicit_policy in case of key duplication, 'other_hash' is explicit_policy and 'hsh' is computed_policy
@eduardacoppo
Copy link
Author

Created a PR for it here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants