Skip to content

Conversation

@chentex
Copy link
Member

@chentex chentex commented Dec 9, 2025

Type of change

  • Refactor
  • New feature
  • Bug fix
  • Optimization
  • Documentation Update

Description

Inherit the config from other yaml files.
Config on the config file takes precedence from the inherited files

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please describe the System Under Test.
  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

@openshift-ci
Copy link

openshift-ci bot commented Dec 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chentex

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Dec 9, 2025
@chentex chentex requested a review from jtaleric December 9, 2025 11:15
@chentex
Copy link
Member Author

chentex commented Dec 9, 2025

/wip

Signed-off-by: Vicente Zepeda Mas <[email protected]>
Signed-off-by: Vicente Zepeda Mas <[email protected]>
Signed-off-by: Vicente Zepeda Mas <[email protected]>
Signed-off-by: Vicente Zepeda Mas <[email protected]>
Copy link
Collaborator

@vishnuchalla vishnuchalla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, change. Thanks for the head start on this.


**How it works:**
- The parent configuration file should contain a `metadata` section
- Metadata from the parent is merged into each test's metadata
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep options for global vs test level inheritance? Because we might run into problems considering set operation. For example if we have globally inherited file and only some fields are using in the child test case but not all, then that might be a problem even if the child has its own set of metadata defined.


## Configuration Inheritance

Orion supports configuration inheritance to reduce duplication and improve maintainability. You can inherit metadata from a parent configuration file and load metrics from an external file.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here external might confuse people with remote URL. Maybe in the follow ups, that would actually be cool for other team adoptions.

- Metrics from the external file are merged with metrics defined in the test
- **Test-level metrics take precedence** - if a metric with the same `name` and `metricName` exists in both, the test-level metric is used
- Paths can be relative (to the config file directory) or absolute
- Metrics are merged: inherited metrics that don't conflict are included, then test-level metrics are added
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to have a flexibility here. Allowing straight (A u B) might not fit for every use case

)

for test in rendered_config["tests"]:
test.setdefault("version_field", "ocpVersion")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can still stick to setdefault here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the version_field is not set, we need to use a default value for it. I tried removing this but the logic is always expecting a value here. I will investigate if I can do other things.

return render_template(parent_config_content, env_vars, logger)


def load_metrics_file(metrics_file: str,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is similar to above function, except for the variable name. We can considering modularizing it?


# Iterate through config keys and add them, overriding inherited_config values
# If a key exists in config, skip adding it from inherited_config (config takes precedence)
for key in config:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slick!

orion --lookback 15d --since 2026-01-20 --hunter-analyze --config hack/ci-tests/ci-tests-inherits.yaml --metadata-index "orion-integration-test-data*" --benchmark-index "orion-integration-test-metrics*" --es-server=${QE_ES_SERVER} --node-count true --input-vars='{"version": "4.20"}' > ./outputs/results.txt
EXIT_CODE=$?

if [ ! $EXIT_CODE -eq 2 ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be redundant in all the tests. Can we modularize it?

@chentex
Copy link
Member Author

chentex commented Jan 23, 2026

Just to confirm @vishnuchalla, this would be the expected configuration layering:

Gemini_Generated_Image_bdw7q1bdw7q1bdw7

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants