Skip to content

Conversation

@swinslow
Copy link
Member

@swinslow swinslow commented Jun 28, 2025

This is a draft PR for changing to a JSON-formatted version of the expected-warnings file. It corresponds to the changes proposed in spdx/license-list-XML#2772.

Please do not merge this until we've gotten the 3.27.0 license list release out the door, which should be within the next day or two. 3.27.0 release is out!

Please see the PR at spdx/license-list-XML#2772 for the proposed changes to the expected-warnings file. This PR for the publisher in turn swaps out the CSV reader for the gson JSON reader as a new dependency.

The code change in this PR then walks through the parsed arrays of related license IDs. For each pair in an array, it creates two new "Duplicates licenses:" entries, one for each ordering of the two IDs.

In this way, it should work as a drop-in replacement for the existing process for matching warnings. It just means that the "Duplicates licenses:" text lines are generated dynamically from the JSON at publisher run-time, rather than needing to maintain each of the strings in the XML repo's "source" files.

This is the first time in a long time that I've written Java code of any substance, so please take a close read of this and feel free to reject or replace it. :) Happy to discuss if you have any questions.

Signed-off-by: Steve Winslow steve@swinslow.net

Signed-off-by: Steve Winslow <steve@swinslow.net>
@swinslow swinslow marked this pull request as draft June 28, 2025 21:23
@swinslow swinslow changed the title [WIP - Do not merge] Change to JSON-formatted expected warnings Change to JSON-formatted expected warnings Jul 1, 2025
@swinslow swinslow marked this pull request as ready for review July 1, 2025 15:36
Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

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

The original functionality was to ignore any warning strings - not just the duplicate IDs.

It's been some time since I've looked at the code - it's quite possible that the only warnings are duplicate ID's but I would need to check.

Perhaps we can accomodate other warnings by making the JSON file a bit more descriptive by having a property "duplicateIds" with the array and then having another property "additionalWarnings" which would have additional strings.

We should also document the format in the usage field of the command line.

@swinslow
Copy link
Member Author

swinslow commented Jul 8, 2025

Thanks @goneall! I'll take a look at this -- apologies for the delayed response as I was away and traveling much of last week. Understood on the goal for adding extensibility here, and I'll take a look to revise it.

Signed-off-by: Steve Winslow <steve@swinslow.net>
Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks @swinslow

@goneall
Copy link
Member

goneall commented Aug 3, 2025

@swinslow - let me know once the license list XML repo changes are approved - after that, I'll go ahead and merge and spin another release.

@goneall
Copy link
Member

goneall commented Oct 10, 2025

@swinslow - Has the license list XML website been updated? Thinking of spinning another release and would like to include this PR if it's OK to merge.

@swinslow
Copy link
Member Author

+1, I'm good with merging this. Happy to get it in and test things out before we push the next release (sometime after end of October). Thank you @goneall!

@swinslow
Copy link
Member Author

I forgot I need to update spdx/license-list-XML#2772 first to align with the changes in #216. Ugh, sorry. Will try to do so tomorrow on my way back from the conference...

@goneall
Copy link
Member

goneall commented Oct 25, 2025

Attached is an updated JSON file that works with spdx/license-list-XML#2772
expected-warnings.json

@goneall
Copy link
Member

goneall commented Oct 25, 2025

I tested this with the following JSON file:

expected-warnings.json

It all works good - I'll go ahead and merge. I can add the JSON file to the license-list-XML repo when I update the tool if @swinslow doesn't have time to update.

@goneall goneall merged commit cd92158 into spdx:master Oct 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants