fossas / fossa-cli

Fast, portable and reliable dependency analysis for any codebase. Supports license & vulnerability scanning for large monoliths. Language-agnostic; integrates with 20+ build systems.
https://fossa.com
Other
1.26k stars 173 forks source link

add includeCopyrightList query param to JSON attribution report request #1450

Closed spatten closed 1 month ago

spatten commented 1 month ago

Overview

https://teamfossa.slack.com/archives/C0155DTGWB1/p1721159453386859

As part of https://fossa.atlassian.net/browse/CORE-3105, we need to include a includeCopyrightList=true query param when we're getting a JSON attribution report.

This PR adds that.

Acceptance criteria

Testing plan

Use the fossa-deps.yml from the ticket:

referenced-dependencies:
 - type: pypi
   name: cffi
   version: 1.14.4

Run fossa analyze and then fossa report attribution --format json against current core. Compare the output to the results from this branch.

fossa analyze
fossa report attribution --format json > ~/tmp/report-cli-master-core-master.json
# In fossa-cli, with this branch checked out:
make install-dev
# in the directory with the fossa-deps file from above:
fossa-dev report attribution --format json > ~/tmp/report-cli-dev-core-master.json
# Compare the two. There should be no changes
diff ~/tmp/report-cli-master-core-master.json ~/tmp/report-cli-dev-core-master.json 

Now run against core locally, but with the branch from https://github.com/fossas/FOSSA/pull/13269 checked out:

fossa-dev analyze -e http://localhost:9578
fossa-dev report attribution --format json -e http://localhost:9578 > ~/tmp/report-cli-dev-core-dev.json

Note the difference in the copyrights.

Before:

  "copyrightsByLicense": {
    "MIT": [
      "1996, 1998, 1999, 2001 Red Hat, Inc."
    ]
  },

After:

  "copyrightsByLicense": {
    "MIT": [
      "1996, 1998, 1999, 2001 Red Hat, Inc.",
      "1996, 1998, 2001, 2002 Red Hat, Inc.",
      "2001 John Beniton",
      "2002 Ranjit Mathew",
      "1996, 1998 Red Hat, Inc.",
      "1996-2003 Red Hat, Inc.",
      "2002 Bo Thorsen",
      "2002 Roger Sayle"
    ]

Risks

This is very low risk

Metrics

N/A

References

Checklist

jssblck commented 1 month ago

@spatten make sure to add it to the changelog please!