Skip to content

Conversation

@Aymen-Soussi-01
Copy link
Contributor

Improve check_id_format by adding parts option in the metamodel and removing the hardcoded need in the check, then adapt tests

close: #145

@github-actions
Copy link

github-actions bot commented Jul 31, 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]
2025/08/11 10:01:40 Downloading https://releases.bazel.build/8.3.0/release/bazel-8.3.0-linux-x86_64...
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: ace25af9-e89b-4b4b-82d9-d2a4887dcb8b
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)
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 (69 packages loaded, 9 targets configured)

Analyzing: target //src:license-check (115 packages loaded, 2216 targets configured)

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

INFO: Analyzed target //src:license-check (129 packages loaded, 4428 targets configured).
[7 / 13] Creating runfiles tree bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/score_dash_license_checker+/tool/formatters/dash_format_converter.runfiles [for tool]; 0s local ... (2 actions, 1 running)
INFO: Found 1 target...
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: 12.807s, Critical Path: 0.38s
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>
[main] INFO Querying Eclipse Foundation for license data for 84 items.
[main] INFO Found 58 items.
[main] INFO Querying ClearlyDefined for license data for 26 items.
[main] ERROR Error response from ClearlyDefined 429

if id_parts_len != expected_parts:
if expected_parts == 2:
msg = "expected to consist of this format: `<Req Type>__<Abbreviations>`."
else:
Copy link
Member

@AlexanderLanin AlexanderLanin Jul 31, 2025

Choose a reason for hiding this comment

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

Suggested change
else:
elif expected_parts == 3:

and some generic else afterwards. Either generic or some error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Please resolve.


if id_parts_len != expected_parts:
if expected_parts == 2:
msg = "expected to consist of this format: `<Req Type>__<Abbreviations>`."
Copy link
Contributor

@MaximilianSoerenPollak MaximilianSoerenPollak Aug 1, 2025

Choose a reason for hiding this comment

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

Think it also would make sense to say it in more plain english as well?
Like:
expected to consist of this format: <Req Type>__<Abbreviations>. Only one '__' is allowed in this need type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Please resolve.

@MaximilianSoerenPollak
Copy link
Contributor

The list as described in the Metamodel is correct. (Looked through together with Process).

Will now this coming Thursday (7.08) fix errors in Process & Score.

@MaximilianSoerenPollak
Copy link
Contributor

/consumer-test

1 similar comment
@MaximilianSoerenPollak
Copy link
Contributor

/consumer-test

@MaximilianSoerenPollak
Copy link
Contributor

@Aymen-Soussi-01 could you maybe put an exception into the 'feature_id' check for example_feature ?
THis is the error I'd like to help

process_areas/architecture_design/architecture_getstrt.rst:225: WARNING: comp_arc_sta__example_feature__component_manual_getstrt.id (comp_arc_sta__example_feature__component_manual_getstrt): Featurepart '['example', 'feature']' not in path 'process_areas/architecture_design' or abbreviation not ok, expected: 'ef'. [score_metamodel]

@AlexanderLanin
Copy link
Member

AlexanderLanin commented Aug 7, 2025

Why don't they use comp_arc_sta__architecture_design__component_manual_getstrt_example? Mhh well yeah, that's not a good example :D

Should we exclude "example_feature"? Or even "example_*"? Only in process repo? Only for this one check?

@MaximilianSoerenPollak
Copy link
Contributor

Why don't they use comp_arc_sta__architecture_design__component_manual_getstrt_example? Mhh well yeah, that's not a good example :D

Should we exclude "example_feature"? Or even "example_*"? Only in process repo? Only for this one check?

Probably example_*? though not sure.

I guess this needs to be discussed.
I would not make it specific to process only though.

@MaximilianSoerenPollak
Copy link
Contributor

@Aymen-Soussi-01 Can you add this to this PR too?

@local_check
def check_id_length(app: Sphinx, need: NeedsInfoType, log: CheckLogger):
    """
    Validates that the requirement ID does not exceed the hard limit of 45 characters.
    While the recommended limit is 30 characters, this check enforces a strict maximum
    of 45 characters.
    If the ID exceeds 45 characters, a warning is logged specifying the actual length.
    Any examples that are required to have 3 parts (2x'__') have an exception, and get 16 extra characters
    to compensate for the lenght of `example_feature` that would be replaced by actually feature names.
    ---
    """
    max_lenght = 45
    parts = need["id"].split("__")
    if parts[1] == "example_feature":
        max_lenght += 15 # '_example_feature_'
    if len(need["id"]) > max_lenght:
        msg = (
            f"exceeds the maximum allowed length of 45 characters "
            f"(current length: {len(need['id'])})."
        )
        log.warning_for_option(need, "id", msg)

this is also in 'id_contains.py' I think

max_lenght = 45
parts = need["id"].split("__")
if parts[1] == "example_feature":
max_lenght += 15 # '_example_feature_'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
max_lenght += 15 # '_example_feature_'
max_lenght += 15 # 'example_feature'

Forgot to change it here too, I only did it in the desc. Sorry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Please resolve.

if len(need["id"]) > max_lenght:
msg = (
f"exceeds the maximum allowed length of 45 characters "
f"(current length: {len(need['id'])})."
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh and we probably need to also remove the 15 lenghts from the length here if the part[1] is 'example_feature` otherwise in those cases this error will be off by 15.

Copy link
Contributor

Choose a reason for hiding this comment

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

God, so much missed on my part. Sorry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Please resolve.

@github-actions
Copy link

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

@MaximilianSoerenPollak
Copy link
Contributor

/consumer-test


# Get the part of the string after the first two underscores: the path
feature = parts[1]
if feature == "example_feature":
Copy link
Member

Choose a reason for hiding this comment

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

Should we add a "note" to the requirements? separate PR

Copy link
Contributor

Choose a reason for hiding this comment

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

#201 We have to fix many links anyway that are currently scattered everywhere

Copy link
Member

@AlexanderLanin AlexanderLanin left a comment

Choose a reason for hiding this comment

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

LGTM except override

@MaximilianSoerenPollak
Copy link
Contributor

Tests & Building of Docs passed locally with git override to Process PR.

Should be all fine now I would say.

@MaximilianSoerenPollak
Copy link
Contributor

@AlexanderLanin you should be able to approve it.

@MaximilianSoerenPollak MaximilianSoerenPollak merged commit 9a8eced into eclipse-score:main Aug 11, 2025
4 of 7 checks passed
@github-project-automation github-project-automation bot moved this from Draft to Done in Infrastructure Aug 11, 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.

tool_req__docs_common_attr_id_scheme: ID Schema clarification

3 participants