Skip to content

Require valid_from in validity consistency check#631

Merged
MaximilianSoerenPollak merged 1 commit into
mainfrom
ankr_check_reqs_valid_from
Jul 7, 2026
Merged

Require valid_from in validity consistency check#631
MaximilianSoerenPollak merged 1 commit into
mainfrom
ankr_check_reqs_valid_from

Conversation

@antonkri

@antonkri antonkri commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Require and normalize valid_from in validity consistency check

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //src:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: ed30ccef-a721-44a5-bd6f-feafc6ae9e8b
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: src
WARNING: Target pattern parsing failed.
ERROR: Skipping '//src:license-check': no such target '//src:license-check': target 'license-check' not declared in package 'src' defined by /home/runner/work/docs-as-code/docs-as-code/src/BUILD
ERROR: no such target '//src:license-check': target 'license-check' not declared in package 'src' defined by /home/runner/work/docs-as-code/docs-as-code/src/BUILD
INFO: Elapsed time: 5.948s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

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

return (major, minor, patch)


def _normalize_validity_attr(value: object | None) -> str | None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would prefer if this would be a generic function (name) instead of one specialized for validity attributes.

For the code itself, is there a scenario where the value is NOT an int/float or a string?
Like could it be a list or so?
If that is the case we would return just the list as a string here, not sure that is what we want?
So we probably should program more defensively to error in such scenarios too.

return

if not valid_from or not valid_until:
if not valid_until:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is no error msg here, but there is one in valid_from? Is this an oversight or on purpose?

@antonkri antonkri force-pushed the ankr_check_reqs_valid_from branch 2 times, most recently from c066ec5 to cb37328 Compare July 6, 2026 10:27

if not valid_from or not valid_until:
if valid_until_values and not valid_from_values:
log.warning_for_need(need, "is missing required attribute: `valid_from`.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A bit confused here.
According to metamodel.yaml valid_from and valid_until are both optional options.
Here now one is protrayed as mandatory option.
Did you forget to add the change to the metamodel.yaml?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hey Maximilian, no. What I want to achieve is that everyone do the scoping of their requirements and tell us, which requirements are valid for release score v1.0 and which for later releases. In my opinion, valid_until is not mandatory, as the requirement can be valid forever. But valid_from is more important as we need to know, when the implementation is available for the first time and can be e.g. tested.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

...sorry The metamodel was changes in the previous commit, please check

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please set the flags to mandatory in the metamodel and add the checks as implemented in tool requirements

FScholPer
FScholPer previously approved these changes Jul 7, 2026
log.warning_for_need(need, "is missing required attribute: `valid_from`.")
return

if not valid_from_values or not valid_until_values:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is still an issue I think, as valid_from_values is mandatory but valid_until_values is not.
Therefore if valid_until_values is not set this will still enter and exit early

@antonkri antonkri force-pushed the ankr_check_reqs_valid_from branch 2 times, most recently from 4a4c3d1 to 2a5ba91 Compare July 7, 2026 12:49
@antonkri antonkri force-pushed the ankr_check_reqs_valid_from branch from 2a5ba91 to e11edfe Compare July 7, 2026 12:55
@MaximilianSoerenPollak MaximilianSoerenPollak merged commit 59d1740 into main Jul 7, 2026
15 of 17 checks passed
@MaximilianSoerenPollak MaximilianSoerenPollak deleted the ankr_check_reqs_valid_from branch July 7, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants