Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: KeyError valid_status #190

Open
BlueAndi opened this issue Jan 31, 2025 · 1 comment
Open

Exception: KeyError valid_status #190

BlueAndi opened this issue Jan 31, 2025 · 1 comment
Assignees
Labels
bug Something isn't working lobster-core Affects core LOBSTER tools

Comments

@BlueAndi
Copy link

If valid_status is not available, this check will raise an exception.

if source_info["valid_status"]:

@phiwuu
Copy link
Member

phiwuu commented Feb 13, 2025

Thanks for pointing it out. We will analyze it.

Actually there are ideas to remove the feature from lobster-report to check the user-defined constraint if the status is correct. The reason is that, lobster-report shall be agnostic to the data. But the current implementation forces it to understand the concept of a "status", or at least provide a mapping so that it knows which attribute to consider as a status. On the other hand, understanding the concept of "traceability" also implies knowledge, which is the core feature of LOBSTER.

The same arguments hold for the "filter" feature, where the user can specify types, see

lobster/lobster/io.py

Lines 120 to 124 in ee2c98a

for f, v in source_info['filters']:
if f == 'prefix':
filter_conditions.append(item.tag.tag.startswith(v))
if f == 'kind':
filter_conditions.append(item.kind == v)

It is not the concern of that tool to filter (or even understand) its inputs. We want to follow "separation of concerns" here, and lobster-report shall assume that the input has been well prepared. That is, it shall assume that all the *.lobster files coming from other tools represent exactly all the data for which the coverage shall be computed.

If some of the input requirements shall be filtered by status, that this is the concern of one of the earlier tools in the tool chain, for example lobster-codebeamer. And lobster-codebeamer downloads items according to a query string/query ID. So here the simple solution is to design the query such that codebeamer filters by status, if needed. No feature is necessary in lobster-codebeamer to filter the data.

lobster-trlc is currently missing any filter feature. So a clean refactoring would be to move the feature from lobster-report to lobster-trlc, or to provide an intermediate tool that takes the output of lobster-trlc and modifies it.

One idea is to provide a plugin mechanism where the user can then implement arbitrary constraints using Python. We haven't made a decision yet.

The bug is related to #52.

@phiwuu phiwuu added bug Something isn't working lobster-core Affects core LOBSTER tools labels Feb 13, 2025
@phiwuu phiwuu self-assigned this Feb 13, 2025
phiwuu added a commit that referenced this issue Feb 13, 2025
If the constraint `valid_status` is omitted in the configuration file of `lobster-report`,
then no check is performed.

Issue #190
phiwuu added a commit that referenced this issue Feb 13, 2025
If the constraint `valid_status` is omitted in the configuration file of `lobster-report`,
then no status check is performed.

Issue #190
phiwuu added a commit that referenced this issue Feb 13, 2025
If the constraint `valid_status` is omitted in the configuration file of `lobster-report`,
then no status check is performed.

Issue #190
phiwuu added a commit that referenced this issue Feb 14, 2025
If the constraint `valid_status` is omitted in the configuration file of `lobster-report`,
then no status check is performed.

Issue #190
kedarnn pushed a commit that referenced this issue Feb 14, 2025
If the constraint `valid_status` is omitted in the configuration file of
`lobster-report`, then no check is performed.

Issue #190
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lobster-core Affects core LOBSTER tools
Projects
None yet
Development

No branches or pull requests

2 participants