[PARSER] Replace goal-state configuration with meta-profile format - #1
Open
lakhmanisahil wants to merge 10 commits into
Open
[PARSER] Replace goal-state configuration with meta-profile format#1lakhmanisahil wants to merge 10 commits into
lakhmanisahil wants to merge 10 commits into
Conversation
Add initial support for parsing the meta-profile configuration format. Each meta-profile is parsed into a SystemGoal by name.
Expand controllers, hardware and lifecycle nodes referenced by a profile into the corresponding SystemGoal. Each component inherits the lifecycle state specified by the enclosing profile_name_ under meta-profile_name. Signed-off-by: root <lakhmanisahil8@gmail.com>
This removes the need for top-level hardware and lifecycle node lists when parsing the meta-profile configuration format. Signed-off-by: root <lakhmanisahil8@gmail.com>
Populate the tracked component list from the parsed goals. Reuse the existing tracked-component derivation logic so the meta-profile parser produces the same tracked component set as the old goal-state parser. Signed-off-by: root <lakhmanisahil8@gmail.com>
Signed-off-by: root <lakhmanisahil8@gmail.com>
Require every profile referenced by a meta-profile to declare a lifecycle state. Signed-off-by: root <lakhmanisahil8@gmail.com>
Replace the ols goal-state configuration with the new profile & meta-profile schema. This preserves the existing parsed scenario while migrating the configuration to the new format. Signed-off-by: ...Signed-off-by: root <lakhmanisahil8@gmail.com>
Update the parser test file to use the meta-profile format and include validation tests for the new configuration format. Signed-off-by: root <lakhmanisahil8@gmail.com>
Signed-off-by: root <lakhmanisahil8@gmail.com>
Signed-off-by: root <lakhmanisahil8@gmail.com>
saikishor
reviewed
Jun 29, 2026
Comment on lines
+107
to
+138
| def test_missing_profile_reference_raises(self, tmp_path): | ||
| config = tmp_path / "missing_profile.yaml" | ||
|
|
||
| config.write_text( | ||
| "profiles:\n" | ||
| " motion:\n" | ||
| " controllers: [controller]\n" | ||
| "\n" | ||
| "meta_profiles:\n" | ||
| " running:\n" | ||
| " missing_profile:\n" | ||
| " state: active\n" | ||
| ) | ||
|
|
||
| with pytest.raises(ValueError): | ||
| parse_yaml_file(config) | ||
|
|
||
| def test_missing_profile_state_raises(self, tmp_path): | ||
| config = tmp_path / "missing_state.yaml" | ||
|
|
||
| config.write_text( | ||
| "profiles:\n" | ||
| " motion:\n" | ||
| " controllers: [controller]\n" | ||
| "\n" | ||
| "meta_profiles:\n" | ||
| " running:\n" | ||
| " motion: {}\n" | ||
| ) | ||
|
|
||
| with pytest.raises(ValueError): | ||
| parse_yaml_file(config) |
There was a problem hiding this comment.
What about testing valid cases?. Is it already handled in previous tests?
Owner
Author
There was a problem hiding this comment.
Yes, the valid cases are already covered 👍
lakhmanisahil
marked this pull request as ready for review
July 1, 2026 23:34
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR replaces the existing goal_states configuration with the new profiles and meta_profiles format.
To preserve the existing Foreman engine, the parser expands each meta-profile into a
SystemGoalduring parsing. As a result, the planner and engine continue to operate onSystemGoals without requiring any changes.This PR is stacked on top of feat/meta-profiles-and-inference.{PR #16: dependency inference}
Changes
Configuration format
goal_stateswithprofilesandmeta_profilesParser
profilessectionmeta_profilessectionSystemGoalParsedScenariointerface for the engineValidation
Added parser validation for:
Tests
SystemGoals from meta-profilesTesting
Environment
Build
Unit Tests
Successfully executed:
pytest src/foreman/foreman/test/test_parser.py colcon build --packages-select foreman colcon test --packages-select foreman colcon test-result --verboseAll tests passed successfully.
Manual Validation
Validated using ros2_control_demo_example_1.
Terminal 1
Terminal 2
Terminal 3
Terminal 4
Switch between meta-profiles:
Here
SetGoalrefers to a meta-profile.Foreman successfully expanded the selected meta-profile into the corresponding
SystemGoaland executed the requested transitions.YAML used for testing
Is this a user-facing behavior change?
Yes.
The scenario configuration format changes from
goal_statestoprofilesandmeta_profiles.Existing configuration files using
goal_statesmust be migrated to the new format.The public
SetGoalAPI remains unchanged; users now specify the name of a meta-profile instead of a goal state.Did you use Generative AI?
Yes (OpenAI GPT-5.5) was used for assistance.
Additional Information
Testing with example_1