Skip to content

Conversation

@AlexanderLanin
Copy link
Member

📌 Description

  • split __init__ into multiple files
  • add MetaModelData instead of a dict

This PR is intentionally kept small, as lots of code is moved which makes reviews impossible.

🚨 Impact Analysis

  • This change does not violate any tool requirements and is covered by existing tool requirements
  • This change does not violate any design decisions
  • Otherwise I have created a ticket for new tool qualification

✅ Checklist

  • Added/updated documentation for new or changed features
  • Added/updated tests to cover the changes
  • Followed project coding standards and guidelines

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the score_metamodel extension by splitting the __init__.py file into multiple focused modules and introducing a structured MetaModelData dataclass to replace dictionary-based data handling.

Key Changes

  • Split metamodel loading functionality into dedicated modules (yaml_parser.py, metamodel_types.py)
  • Introduced MetaModelData dataclass to provide type safety and better structure for configuration data
  • Updated import structure to use explicit module imports and re-exports

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/extensions/score_metamodel/yaml_parser.py New module containing YAML parsing logic and MetaModelData dataclass
src/extensions/score_metamodel/metamodel_types.py New module defining data types (ProhibitedWordCheck, ScoreNeedType)
src/extensions/score_metamodel/__init__.py Refactored to import from new modules and use MetaModelData instead of dict
src/extensions/score_metamodel/tests/test_metamodel_load.py Updated test to work with new MetaModelData structure
Comments suppressed due to low confidence (1)

src/extensions/score_metamodel/tests/test_metamodel_load.py:16

  • The import statement is incorrect. It should import from the specific module path src.extensions.score_metamodel rather than just score_metamodel.
from score_metamodel import ProhibitedWordCheck, load_metamodel_data

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

github-actions bot commented Sep 15, 2025

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //src:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: 4d5882ab-5696-433f-ab5a-9e882945598c
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: src
Analyzing: target //src:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //src:license-check (1 packages loaded, 0 targets configured)

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

Analyzing: target //src:license-check (81 packages loaded, 17 targets configured)

Analyzing: target //src:license-check (126 packages loaded, 2309 targets configured)

Analyzing: target //src:license-check (134 packages loaded, 2484 targets configured)

Analyzing: target //src:license-check (134 packages loaded, 2484 targets configured)

INFO: Analyzed target //src:license-check (137 packages loaded, 4500 targets configured).
INFO: Found 1 target...
[13 / 13] no actions running
Target //src:license.check.license_check up-to-date:
  bazel-bin/src/license.check.license_check
  bazel-bin/src/license.check.license_check.jar
INFO: Elapsed time: 14.801s, Critical Path: 0.32s
INFO: 13 processes: 4 disk cache hit, 9 internal.
INFO: Build completed successfully, 13 total actions
INFO: Running command line: bazel-bin/src/license.check.license_check src/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

The created documentation from the pull request is available at: docu-html

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

with open(yaml_path, encoding="utf-8") as f:
data = cast(dict[str, Any], yaml.load(f))

# Access the custom validation block
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

The comment 'Access the custom validation block' is misleading as the code following it accesses various sections of the YAML data, not specifically a validation block.

Suggested change
# Access the custom validation block
# Access various configuration sections from the YAML data

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Will have a look in next PR

@AlexanderLanin AlexanderLanin merged commit 16960a8 into main Sep 15, 2025
11 checks passed
@AlexanderLanin AlexanderLanin deleted the meta branch September 15, 2025 20:33
@github-project-automation github-project-automation bot moved this from Draft to Done in Infrastructure Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants