fix(lab): discover_lab_context walks up to the lab root - #38
Open
jordanauge wants to merge 1 commit into
Open
Conversation
discover_lab_context() now walks up from the experiment YAML to the nearest lab-config.yaml, so libraries:/plugins: declarations apply regardless of how deeply the experiment is nested under the lab root. find_ancestor_with_file() in mas.library_roots is the single shared implementation of that walk; discover_lab_context(), _find_library_root(), and three other call sites all use it now. "lab-config.yaml"/ "library.yaml" are named constants (mas.runtime.constants) rather than literals repeated across 3 packages. Covered by new tests for both the helper and the nested-experiment case. ioc-core-mas-lab's sre-triage.lab now resolves its step types via the plain dotted lib.steps.<name>:<ClassName> form, no relative-path workaround needed. Signed-off-by: Jordan Augé <augjorda@cisco.com>
jordanauge
force-pushed
the
fix/lab-context-parent-walk
branch
from
August 25, 2026 08:59
5463ad1 to
6b77a29
Compare
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.
Summary
discover_lab_context()now walks up from the experiment YAML to the nearestlab-config.yaml, solibraries:/plugins:declarations apply regardless of nesting depth.find_ancestor_with_file()inmas.library_rootsis the single shared implementation of that walk;discover_lab_context(),_find_library_root(), and three other call sites all use it now."lab-config.yaml"/"library.yaml"are named constants (mas.runtime.constants) rather than literals repeated across 3 packages.Test plan
find_ancestor_with_file()(basic match, multi-level walk, absent case, suffix-boundary behavior)discover_lab_context()/_discover_lab_name()covering the nested-experiment regression and the "don't cross into an outer lab" boundary caseioc-core-mas-lab'ssre-triage.labnow resolves its step types via the plain dottedlib.steps.<name>:<ClassName>form, no relative-path workaround needed