spdx / spdx/Spdx-Java-Library

Long strings when verifying an SPDX document with deeply nested relationships

Open
#189 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

error-handling
Dominant language
Java
Stars
71
Forks
44
Avg merge
12h 54m
Merged PRs (30d)
7

Description

With the fix for verifying related elements verify will now report any Relationship as invalid if it references an invalid Element, this will create one line for the package, and one line each for the the relationships that reference the package. What makes the worse is that it is recursive - so if a package has a relationship which references a different package with a different relationship that references the package with the invalid license, you'll get a very long String for the invalid relationship with all the intermediate relationship ID's.

Note that this is somewhat expected since we do want to report every element that has an issue even if it is indirect. However, we may want to figure out a way to short the verify messages.

An ideal solution (difficult to implement) would be to report the root verify issue and list all other issues that have a relationship with the root verify issue (e.g. "Invalid license found in Package-X. This package is referenced in relationshipA, relationshipB, ...")

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing verification of related elements introduced by pull request #159 and inspect how recursive relationship errors are assembled. Define the desired concise message format while preserving reporting for every affected element. Add coverage for deeply nested relationships and verify that the resulting messages avoid repeating the full relationship chain.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.