clearlydefined / website

Website for clearlydefined.io
https://clearlydefined.io
MIT License
26 stars 29 forks source link

Error curating component when license expressions contain empty element #999

Open qtomlinson opened 2 years ago

qtomlinson commented 2 years ago

Reproducing Steps:

  1. Go to https://dev.clearlydefined.io/definitions/git/github/gardener/external-dns-management/ae804dcb1b3a49ded12169c694130993c68ced9f
  2. Click the "SPDX license" place holder under Licensd.Declared to open License Expression editor
  3. Select "MIT" license
  4. Click Add Rule, select "Apache-2.0" license
  5. Click Add Group, Click And, select "BSD-3-Clause" license
  6. Save (see license expression image)
  7. Click Contribute and fill out the contribution information and click OK.
  8. Error in popup: Contribution ERROR: undefined: [{"coordinates":{"type":"git","provider":"github","namespace":"gardener","name":"external-dns-management","revision":"ae804dcb1b3a49ded12169c694130993c68ced9f"},"revisions":{"ae804dcb1b3a49ded12169c694130993c68ced9f":{"licensed":{"declared":"MIT AND Apache-2.0 AND BSD-3-Clause "}}}}]
qtomlinson commented 2 years ago

License expression: image

qtomlinson commented 2 years ago

In the debug console: PATCH call to https://dev-api.clearlydefined.io/curations results in 400 The error in response is { "errors": [ [ { "message": "Invalid license in curation", "error": "ae804dcb1b3a49ded12169c694130993c68ced9f licensed.declared with value \"MIT AND Apache-2.0 AND BSD-3-Clause \" is not SPDX compliant" } ] ], "patchesInError": [ { "coordinates": { "type": "git", "provider": "github", "namespace": "gardener", "name": "external-dns-management", "revision": "ae804dcb1b3a49ded12169c694130993c68ced9f" }, "revisions": { "ae804dcb1b3a49ded12169c694130993c68ced9f": { "licensed": { "declared": "MIT AND Apache-2.0 AND BSD-3-Clause " } } } } ] }

The reason that the patch call failed is that there is a trailing space after "BSD-3-Clause" in licensed.declared: "MIT AND Apache-2.0 AND BSD-3-Clause ". Removing the trailing space, the patch call and the curation workflow is successful.