From 3c098f5a25e0e598cb134407f3bd62163d06abf3 Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Fri, 24 Jul 2020 15:28:54 +0300 Subject: Denormalize BSD-4-Clause license --- spec/integration/python/pip_spec.rb | 42 ++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index 9c2721d..84fbd89 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -46,6 +46,28 @@ RSpec.describe "pip" do end end + context 'with BSD licenses dependencies' do + let(:requirements) do + [ + 'webencodings', + 'idna', + 'click', + 'EasyProcess' + ].join("\n") + end + + it 'finds proper versions of BSD license' do + runner.add_file('requirements.txt', requirements) + + report = runner.scan + + expect(report.licenses_for('webencodings')).to eq(['BSD']) + expect(report.licenses_for('idna')).to eq(['BSD-like']) + expect(report.licenses_for('click')).to eq(['BSD-3-Clause']) + expect(report.licenses_for('EasyProcess')).to eq(['BSD']) + end + end + [{ version: '2', commit: '04dce91b' }, { version: '3', commit: '48e250a1' }].each do |python| ['1.0', '1.1', '2.0', '2.1'].each do |report_version| context "when generating a `#{report_version}` report using Python `#{python[:version]}`" do @@ -148,14 +170,14 @@ RSpec.describe "pip" do runner.add_file('setup.py') do <<~RAW -from setuptools import setup, find_packages - -setup( - name='gitlab-sp-test-python-pip', - version='1.2.0', - packages=find_packages(), - install_requires=['requests'], -) + from setuptools import setup, find_packages + + setup( + name='gitlab-sp-test-python-pip', + version='1.2.0', + packages=find_packages(), + install_requires=['requests'], + ) RAW end end @@ -178,9 +200,9 @@ setup( before do runner.add_file('custom.sh') do <<~SCRIPT - #!/bin/bash -l + #!/bin/bash -l - python --version &> '#{output_file}' + python --version &> '#{output_file}' SCRIPT end end -- cgit v1.2.3 From a2a1e0d8ea63b9735fe5fc85f35d61f3f2dada9c Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Fri, 24 Jul 2020 15:28:54 +0300 Subject: Denormalize BSD-4-Clause license --- normalized-licenses.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/normalized-licenses.yml b/normalized-licenses.yml index 46c7d26..2961e06 100644 --- a/normalized-licenses.yml +++ b/normalized-licenses.yml @@ -10,9 +10,7 @@ ids: ASL, version 2: Apache-2.0 BSD 3-Clause: BSD-3-Clause BSD (3 clause): BSD-3-Clause - BSD: BSD-4-Clause BSD-derived (http://www.repoze.org/LICENSE.txt): BSD-2-Clause - BSD-like: BSD-4-Clause BSD style: BSD-3-Clause CC0 1.0 Universal: CC0-1.0 CC01: CC0-1.0 -- cgit v1.2.3 From 3b32a036bf5aa4497cb4bbeb91c2cacf22f5d146 Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Fri, 24 Jul 2020 17:33:41 +0300 Subject: Test with separate specs --- normalized-licenses.yml | 1 + spec/integration/python/pip_spec.rb | 30 ++++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/normalized-licenses.yml b/normalized-licenses.yml index 2961e06..4df6161 100644 --- a/normalized-licenses.yml +++ b/normalized-licenses.yml @@ -8,6 +8,7 @@ ids: Apache Software License - Version 2.0: Apache-2.0 ASF 2.0: Apache-2.0 ASL, version 2: Apache-2.0 + BSD: bsd BSD 3-Clause: BSD-3-Clause BSD (3 clause): BSD-3-Clause BSD-derived (http://www.repoze.org/LICENSE.txt): BSD-2-Clause diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index 84fbd89..cead027 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -47,14 +47,7 @@ RSpec.describe "pip" do end context 'with BSD licenses dependencies' do - let(:requirements) do - [ - 'webencodings', - 'idna', - 'click', - 'EasyProcess' - ].join("\n") - end + let(:requirements) { %w(webencodings idna click EasyProcess).join("\n") } it 'finds proper versions of BSD license' do runner.add_file('requirements.txt', requirements) @@ -62,8 +55,29 @@ RSpec.describe "pip" do report = runner.scan expect(report.licenses_for('webencodings')).to eq(['BSD']) + end + + it 'finds proper versions of BSD license' do + runner.add_file('requirements.txt', requirements) + + report = runner.scan + expect(report.licenses_for('idna')).to eq(['BSD-like']) + end + + it 'finds proper versions of BSD license' do + runner.add_file('requirements.txt', requirements) + + report = runner.scan + expect(report.licenses_for('click')).to eq(['BSD-3-Clause']) + end + + it 'finds proper versions of BSD license' do + runner.add_file('requirements.txt', requirements) + + report = runner.scan + expect(report.licenses_for('EasyProcess')).to eq(['BSD']) end end -- cgit v1.2.3 From 4acbcb86caea35b176f379675ea0ccc4b76d0897 Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Mon, 27 Jul 2020 19:57:05 +0300 Subject: Remove redundant normalization --- normalized-licenses.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/normalized-licenses.yml b/normalized-licenses.yml index 4df6161..2961e06 100644 --- a/normalized-licenses.yml +++ b/normalized-licenses.yml @@ -8,7 +8,6 @@ ids: Apache Software License - Version 2.0: Apache-2.0 ASF 2.0: Apache-2.0 ASL, version 2: Apache-2.0 - BSD: bsd BSD 3-Clause: BSD-3-Clause BSD (3 clause): BSD-3-Clause BSD-derived (http://www.repoze.org/LICENSE.txt): BSD-2-Clause -- cgit v1.2.3 From b272c287f2709c8a2dce0c2311842c3ddb260999 Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Mon, 27 Jul 2020 20:01:39 +0300 Subject: Fix failed tests --- spec/integration/python/pip_spec.rb | 30 +++++--------------------- spec/unit/license/management/report/v2_spec.rb | 1 - 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index cead027..3d6b82f 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -47,39 +47,19 @@ RSpec.describe "pip" do end context 'with BSD licenses dependencies' do - let(:requirements) { %w(webencodings idna click EasyProcess).join("\n") } - - it 'finds proper versions of BSD license' do - runner.add_file('requirements.txt', requirements) - - report = runner.scan - - expect(report.licenses_for('webencodings')).to eq(['BSD']) - end - - it 'finds proper versions of BSD license' do - runner.add_file('requirements.txt', requirements) - - report = runner.scan - - expect(report.licenses_for('idna')).to eq(['BSD-like']) - end + let(:requirements) { %w[webencodings idna click EasyProcess].join("\n") } it 'finds proper versions of BSD license' do runner.add_file('requirements.txt', requirements) report = runner.scan + expect(report.licenses_for('webencodings')).to eq(['bsd']) + expect(report.licenses_for('idna')).to eq(['bsd-like']) + expect(report.licenses_for('EasyProcess')).to eq(['bsd']) + expect(report.licenses_for('PyVirtualDisplay')).to eq(['bsd']) expect(report.licenses_for('click')).to eq(['BSD-3-Clause']) end - - it 'finds proper versions of BSD license' do - runner.add_file('requirements.txt', requirements) - - report = runner.scan - - expect(report.licenses_for('EasyProcess')).to eq(['BSD']) - end end [{ version: '2', commit: '04dce91b' }, { version: '3', commit: '48e250a1' }].each do |python| diff --git a/spec/unit/license/management/report/v2_spec.rb b/spec/unit/license/management/report/v2_spec.rb index 1bcdb16..a7c0d18 100644 --- a/spec/unit/license/management/report/v2_spec.rb +++ b/spec/unit/license/management/report/v2_spec.rb @@ -7,7 +7,6 @@ RSpec.describe License::Management::Report::V2 do 'AGPL-3.0' => 'AGPL-3.0', 'Apache 2.0' => 'Apache-2.0', 'Artistic-2.0' => 'Artistic-2.0', - 'BSD' => 'BSD-4-Clause', 'CC0 1.0 Universal' => 'CC0-1.0', 'CDDL-1.0' => 'CDDL-1.0', 'CDDL-1.1' => 'CDDL-1.1', -- cgit v1.2.3 From e08b5a38a7fcade1851637bd401a6097193db00d Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Mon, 3 Aug 2020 23:39:21 +0300 Subject: Fix some failed tests --- spec/fixtures/expected/java/maven-multimodules/v2.0.json | 14 +++++++------- spec/fixtures/expected/java/maven-multimodules/v2.1.json | 14 +++++++------- spec/integration/python/pip_spec.rb | 2 ++ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/spec/fixtures/expected/java/maven-multimodules/v2.0.json b/spec/fixtures/expected/java/maven-multimodules/v2.0.json index 594c36e..c901899 100644 --- a/spec/fixtures/expected/java/maven-multimodules/v2.0.json +++ b/spec/fixtures/expected/java/maven-multimodules/v2.0.json @@ -8,9 +8,9 @@ "count": 16 }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause", + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_.28original_.22BSD_License.22.29", "count": 4 }, { @@ -41,7 +41,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -52,7 +52,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -63,7 +63,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -252,7 +252,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/java/maven-multimodules/v2.1.json b/spec/fixtures/expected/java/maven-multimodules/v2.1.json index 492f36c..227cab0 100644 --- a/spec/fixtures/expected/java/maven-multimodules/v2.1.json +++ b/spec/fixtures/expected/java/maven-multimodules/v2.1.json @@ -7,9 +7,9 @@ "url": "https://opensource.org/licenses/Apache-2.0" }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause" + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_.28original_.22BSD_License.22.29" }, { "id": "LGPL-2.1", @@ -34,7 +34,7 @@ "package_manager": "maven", "path": "pom.xml", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -43,7 +43,7 @@ "package_manager": "maven", "path": "pom.xml", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -52,7 +52,7 @@ "package_manager": "maven", "path": "pom.xml", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -207,7 +207,7 @@ "package_manager": "maven", "path": "pom.xml", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index 3d6b82f..0bf27a4 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -54,6 +54,8 @@ RSpec.describe "pip" do report = runner.scan + pp report + expect(report.licenses_for('webencodings')).to eq(['bsd']) expect(report.licenses_for('idna')).to eq(['bsd-like']) expect(report.licenses_for('EasyProcess')).to eq(['bsd']) -- cgit v1.2.3 From 533e4496f4f79634179291a18fd99765ace506f2 Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Thu, 13 Aug 2020 18:43:27 +0300 Subject: Patch url for not specified BSD license --- lib/license/management/repository.rb | 9 ++++++++- spec/unit/license/management/repository_spec.rb | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/license/management/repository.rb b/lib/license/management/repository.rb index 4b6e8a5..3d16b78 100644 --- a/lib/license/management/repository.rb +++ b/lib/license/management/repository.rb @@ -64,7 +64,7 @@ module License { 'id' => name.downcase, 'name' => name, - 'url' => present?(license.url) ? license.url : '' + 'url' => normalized_url(license.url) } end @@ -90,6 +90,13 @@ module License logger.error(e) nil end + + def normalized_url(url) + return '' unless present?(url) + return 'http://en.wikipedia.org/wiki/BSD_licenses' if url.match?('BSD_licenses#4-clause_license') + + url + end end end end diff --git a/spec/unit/license/management/repository_spec.rb b/spec/unit/license/management/repository_spec.rb index 04eb469..c54af77 100644 --- a/spec/unit/license/management/repository_spec.rb +++ b/spec/unit/license/management/repository_spec.rb @@ -60,5 +60,21 @@ RSpec.describe License::Management::Repository do it { expect(subject.item_for(license)['id']).to eql(spdx_id) } end end + + context 'with BSD license' do + subject(:item_license) { described_class.new.item_for(license) } + + let(:license) do + LicenseFinder::License.new( + short_name: 'BSD', + other_names: ['BSD4', 'bsd-old', '4-clause BSD', 'BSD-4-Clause', 'BSD 4-Clause', 'BSD License'], + url: 'http://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_.28original_.22BSD_License.22.29' + ) + end + + it 'returns general url' do + expect(item_license['url']).to eq('http://en.wikipedia.org/wiki/BSD_licenses') + end + end end end -- cgit v1.2.3 From 6bb687f6355e4077fe45e2e0b2646aaf0214be74 Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Thu, 13 Aug 2020 18:43:54 +0300 Subject: Doc how to run one test --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc652d2..a34e2f7 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ You can run the tests from inside a docker container: $ ./bin/docker-build $ ./bin/docker-shell $ ./bin/setup -$ ./bin/test +$ ./bin/test [path to file] ``` If you need to debug any specific issues you can do this from within the docker container by -- cgit v1.2.3 From d221c4aa84c3f4457836023de742f4e922a59ce5 Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Mon, 17 Aug 2020 17:29:53 +0300 Subject: Fix failed specs --- spec/fixtures/expected/python/2/pip/v2.0.json | 14 +++++++------- spec/fixtures/expected/python/2/pip/v2.1.json | 14 +++++++------- spec/fixtures/expected/python/pipenv/v2.0.json | 9 ++++----- spec/fixtures/expected/python/pipenv/v2.1.json | 8 ++++---- spec/integration/js/npm_spec.rb | 6 +++--- spec/integration/python/pip_spec.rb | 2 +- 6 files changed, 26 insertions(+), 27 deletions(-) diff --git a/spec/fixtures/expected/python/2/pip/v2.0.json b/spec/fixtures/expected/python/2/pip/v2.0.json index 8ed6ee7..5515387 100644 --- a/spec/fixtures/expected/python/2/pip/v2.0.json +++ b/spec/fixtures/expected/python/2/pip/v2.0.json @@ -2,9 +2,9 @@ "version": "2.0", "licenses": [ { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause", + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses", "count": 4 }, { @@ -47,7 +47,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -80,7 +80,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -91,7 +91,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -113,7 +113,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/python/2/pip/v2.1.json b/spec/fixtures/expected/python/2/pip/v2.1.json index 3203679..36d625d 100644 --- a/spec/fixtures/expected/python/2/pip/v2.1.json +++ b/spec/fixtures/expected/python/2/pip/v2.1.json @@ -7,9 +7,9 @@ "url": "https://opensource.org/licenses/BSD-3-Clause" }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause" + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" }, { "id": "MIT", @@ -39,7 +39,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -66,7 +66,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -75,7 +75,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -93,7 +93,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/python/pipenv/v2.0.json b/spec/fixtures/expected/python/pipenv/v2.0.json index ba4d529..c41d970 100644 --- a/spec/fixtures/expected/python/pipenv/v2.0.json +++ b/spec/fixtures/expected/python/pipenv/v2.0.json @@ -8,10 +8,9 @@ "count": 1 }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause", - "count": 1 + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" }, { "id": "MIT", @@ -35,7 +34,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/python/pipenv/v2.1.json b/spec/fixtures/expected/python/pipenv/v2.1.json index 30161e1..9c58d29 100644 --- a/spec/fixtures/expected/python/pipenv/v2.1.json +++ b/spec/fixtures/expected/python/pipenv/v2.1.json @@ -7,9 +7,9 @@ "url": "https://opensource.org/licenses/Apache-2.0" }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause" + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" }, { "id": "MIT", @@ -29,7 +29,7 @@ "package_manager": "pip", "path": "Pipfile.lock", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/integration/js/npm_spec.rb b/spec/integration/js/npm_spec.rb index 8ab5be6..1481748 100644 --- a/spec/integration/js/npm_spec.rb +++ b/spec/integration/js/npm_spec.rb @@ -95,7 +95,7 @@ RSpec.describe "npm" do ["isstream", "0.1.2", ["MIT"]], ["jsbn", "0.1.1", ["MIT"]], ["jsdom", "15.2.1", ["MIT"]], - ["json-schema", "0.2.3", ["AFL-2.1", "BSD-4-Clause"]], + ["json-schema", "0.2.3", ["AFL-2.1", "bsd"]], ["json-schema-traverse", "0.4.1", ["MIT"]], ["json-stringify-safe", "5.0.1", ["ISC"]], ["jsonfile", "4.0.0", ["MIT"]], @@ -242,7 +242,7 @@ RSpec.describe "npm" do ["isstream", "0.1.2", ["MIT"]], ["jsbn", "0.1.1", ["MIT"]], ["jsdom", "15.2.1", ["MIT"]], - ["json-schema", "0.2.3", ["AFL-2.1", "BSD-4-Clause"]], + ["json-schema", "0.2.3", ["AFL-2.1", "bsd"]], ["json-schema-traverse", "0.4.1", ["MIT"]], ["json-stringify-safe", "5.0.1", ["ISC"]], ["jsonfile", "4.0.0", ["MIT"]], @@ -397,7 +397,7 @@ RSpec.describe "npm" do ["isstream", "0.1.2", ["MIT"]], ["jsbn", "0.1.1", ["MIT"]], ["jsdom", "15.2.1", ["MIT"]], - ["json-schema", "0.2.3", ["AFL-2.1", "BSD-4-Clause"]], + ["json-schema", "0.2.3", ["AFL-2.1", "bsd"]], ["json-schema-traverse", "0.4.1", ["MIT"]], ["json-stringify-safe", "5.0.1", ["ISC"]], ["jsonfile", "4.0.0", ["MIT"]], diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index 0bf27a4..86cdc2b 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -14,7 +14,7 @@ RSpec.describe "pip" do expect(report).to match_schema expect(report[:version]).to start_with('2') expect(report.dependency_names).to include("sentry-sdk") - expect(report.licenses_for('sentry-sdk')).to match_array(["BSD-4-Clause"]) + expect(report.licenses_for('sentry-sdk')).to match_array(["bsd"]) end end -- cgit v1.2.3 From 4510deb87ee0acb985ebeb7478cae5909741776e Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Mon, 17 Aug 2020 19:12:34 +0300 Subject: Fix failed python specs --- spec/fixtures/expected/python/2/pip/v2.1.json | 10 +++++----- spec/fixtures/expected/python/3/pip/v2.0.json | 15 +++++++-------- spec/fixtures/expected/python/3/pip/v2.1.json | 18 +++++++++--------- spec/fixtures/expected/python/pipenv/v2.1.json | 10 +++++----- spec/integration/python/pip_spec.rb | 2 +- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/spec/fixtures/expected/python/2/pip/v2.1.json b/spec/fixtures/expected/python/2/pip/v2.1.json index 36d625d..05492d6 100644 --- a/spec/fixtures/expected/python/2/pip/v2.1.json +++ b/spec/fixtures/expected/python/2/pip/v2.1.json @@ -6,11 +6,6 @@ "name": "BSD 3-Clause \"New\" or \"Revised\" License", "url": "https://opensource.org/licenses/BSD-3-Clause" }, - { - "id": "bsd", - "name": "BSD", - "url": "http://en.wikipedia.org/wiki/BSD_licenses" - }, { "id": "MIT", "name": "MIT License", @@ -26,6 +21,11 @@ "name": "Python License 2.0", "url": "https://opensource.org/licenses/Python-2.0" }, + { + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" + }, { "id": "copyright (c) 2015, julien fache", "name": "Copyright (c) 2015, Julien Fache", diff --git a/spec/fixtures/expected/python/3/pip/v2.0.json b/spec/fixtures/expected/python/3/pip/v2.0.json index b5c23ae..f4f3e1c 100644 --- a/spec/fixtures/expected/python/3/pip/v2.0.json +++ b/spec/fixtures/expected/python/3/pip/v2.0.json @@ -2,10 +2,9 @@ "version": "2.0", "licenses": [ { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause", - "count": 4 + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" }, { "id": "MIT", @@ -53,7 +52,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -86,7 +85,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -97,7 +96,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -119,7 +118,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/python/3/pip/v2.1.json b/spec/fixtures/expected/python/3/pip/v2.1.json index 787b800..a23b401 100644 --- a/spec/fixtures/expected/python/3/pip/v2.1.json +++ b/spec/fixtures/expected/python/3/pip/v2.1.json @@ -11,11 +11,6 @@ "name": "BSD 3-Clause \"New\" or \"Revised\" License", "url": "https://opensource.org/licenses/BSD-3-Clause" }, - { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause" - }, { "id": "MIT", "name": "MIT License", @@ -31,6 +26,11 @@ "name": "Python License 2.0", "url": "https://opensource.org/licenses/Python-2.0" }, + { + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" + }, { "id": "copyright (c) 2015, julien fache", "name": "Copyright (c) 2015, Julien Fache", @@ -44,7 +44,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -71,7 +71,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -80,7 +80,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -98,7 +98,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/python/pipenv/v2.1.json b/spec/fixtures/expected/python/pipenv/v2.1.json index 9c58d29..9e64c02 100644 --- a/spec/fixtures/expected/python/pipenv/v2.1.json +++ b/spec/fixtures/expected/python/pipenv/v2.1.json @@ -6,16 +6,16 @@ "name": "Apache License 2.0", "url": "https://opensource.org/licenses/Apache-2.0" }, - { - "id": "bsd", - "name": "BSD", - "url": "http://en.wikipedia.org/wiki/BSD_licenses" - }, { "id": "MIT", "name": "MIT License", "url": "https://opensource.org/licenses/MIT" }, + { + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" + }, { "id": "public domain, python, 2-clause bsd, gpl 3 (see copying.txt)", "name": "public domain, Python, 2-Clause BSD, GPL 3 (see COPYING.txt)", diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index 86cdc2b..7aec470 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -47,7 +47,7 @@ RSpec.describe "pip" do end context 'with BSD licenses dependencies' do - let(:requirements) { %w[webencodings idna click EasyProcess].join("\n") } + let(:requirements) { %w[webencodings idna click EasyProcess PyVirtualDisplay].join("\n") } it 'finds proper versions of BSD license' do runner.add_file('requirements.txt', requirements) -- cgit v1.2.3 From d0194bf226723746bd73b3bf8bdcdf19bec6ac95 Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Mon, 17 Aug 2020 19:22:25 +0300 Subject: Fix failed java specs --- spec/fixtures/expected/java/gradle/v2.0.json | 9 ++++----- spec/fixtures/expected/java/gradle/v2.1.json | 8 ++++---- spec/fixtures/expected/java/maven-multimodules/v2.0.json | 2 +- spec/fixtures/expected/java/maven-multimodules/v2.1.json | 10 +++++----- spec/fixtures/expected/java/maven/v2.0.json | 9 ++++----- spec/fixtures/expected/java/maven/v2.1.json | 8 ++++---- spec/integration/java/maven_spec.rb | 6 +++--- 7 files changed, 25 insertions(+), 27 deletions(-) diff --git a/spec/fixtures/expected/java/gradle/v2.0.json b/spec/fixtures/expected/java/gradle/v2.0.json index 4caca99..b210fb0 100644 --- a/spec/fixtures/expected/java/gradle/v2.0.json +++ b/spec/fixtures/expected/java/gradle/v2.0.json @@ -20,10 +20,9 @@ "count": 2 }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause", - "count": 1 + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" }, { "id": "LGPL-2.1", @@ -47,7 +46,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/java/gradle/v2.1.json b/spec/fixtures/expected/java/gradle/v2.1.json index b639938..c4e4fa2 100644 --- a/spec/fixtures/expected/java/gradle/v2.1.json +++ b/spec/fixtures/expected/java/gradle/v2.1.json @@ -7,9 +7,9 @@ "url": "https://opensource.org/licenses/Apache-2.0" }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause" + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" }, { "id": "LGPL-2.1", @@ -39,7 +39,7 @@ "package_manager": "gradle", "path": "build.gradle", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/java/maven-multimodules/v2.0.json b/spec/fixtures/expected/java/maven-multimodules/v2.0.json index c901899..4440793 100644 --- a/spec/fixtures/expected/java/maven-multimodules/v2.0.json +++ b/spec/fixtures/expected/java/maven-multimodules/v2.0.json @@ -10,7 +10,7 @@ { "id": "bsd", "name": "BSD", - "url": "http://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_.28original_.22BSD_License.22.29", + "url": "http://en.wikipedia.org/wiki/BSD_licenses", "count": 4 }, { diff --git a/spec/fixtures/expected/java/maven-multimodules/v2.1.json b/spec/fixtures/expected/java/maven-multimodules/v2.1.json index 227cab0..a2336bc 100644 --- a/spec/fixtures/expected/java/maven-multimodules/v2.1.json +++ b/spec/fixtures/expected/java/maven-multimodules/v2.1.json @@ -6,11 +6,6 @@ "name": "Apache License 2.0", "url": "https://opensource.org/licenses/Apache-2.0" }, - { - "id": "bsd", - "name": "BSD", - "url": "http://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_.28original_.22BSD_License.22.29" - }, { "id": "LGPL-2.1", "name": "GNU Lesser General Public License v2.1 only", @@ -21,6 +16,11 @@ "name": "Mozilla Public License 1.1", "url": "https://opensource.org/licenses/MPL-1.1" }, + { + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" + }, { "id": "unknown", "name": "unknown", diff --git a/spec/fixtures/expected/java/maven/v2.0.json b/spec/fixtures/expected/java/maven/v2.0.json index 4b4a06c..aeced14 100644 --- a/spec/fixtures/expected/java/maven/v2.0.json +++ b/spec/fixtures/expected/java/maven/v2.0.json @@ -20,10 +20,9 @@ "count": 2 }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause", - "count": 1 + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" }, { "id": "LGPL-2.1", @@ -47,7 +46,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/java/maven/v2.1.json b/spec/fixtures/expected/java/maven/v2.1.json index a02947a..9d03db0 100644 --- a/spec/fixtures/expected/java/maven/v2.1.json +++ b/spec/fixtures/expected/java/maven/v2.1.json @@ -7,9 +7,9 @@ "url": "https://opensource.org/licenses/Apache-2.0" }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause" + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" }, { "id": "LGPL-2.1", @@ -39,7 +39,7 @@ "package_manager": "maven", "path": "pom.xml", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/integration/java/maven_spec.rb b/spec/integration/java/maven_spec.rb index c9a7026..65d8bf5 100644 --- a/spec/integration/java/maven_spec.rb +++ b/spec/integration/java/maven_spec.rb @@ -71,8 +71,8 @@ RSpec.describe "maven" do expect(subject[:dependencies]).not_to be_empty [ - { name: "asm", licenses: ["BSD-4-Clause"] }, - { name: "asm-commons", licenses: ["BSD-4-Clause"] }, + { name: "asm", licenses: ["bsd"] }, + { name: "asm-commons", licenses: ["bsd"] }, { name: "jackson-annotations", licenses: ["Apache-2.0"] }, { name: "jackson-core", licenses: ["Apache-2.0"] }, { name: "jackson-databind", licenses: ["Apache-2.0"] }, @@ -81,7 +81,7 @@ RSpec.describe "maven" do { name: "log4j-api", licenses: ["Apache-2.0"] }, { name: "log4j-core", licenses: ["Apache-2.0"] }, { name: "netty-all", licenses: ["Apache-2.0"] }, - { name: "stax2-api", licenses: ["BSD-4-Clause"] } + { name: "stax2-api", licenses: ["bsd"] } ].each do |dependency| expect(subject.licenses_for(dependency[:name])).to match_array(dependency[:licenses]) end -- cgit v1.2.3 From ba0af496f034416bb7a9988f3b7c6be35ef6206c Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Tue, 18 Aug 2020 16:35:39 +0300 Subject: Fix failed tests --- spec/fixtures/expected/java/maven/v2.0.json | 3 ++- spec/fixtures/expected/java/maven/v2.1.json | 10 +++++----- spec/fixtures/expected/python/pipenv/v2.0.json | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/spec/fixtures/expected/java/maven/v2.0.json b/spec/fixtures/expected/java/maven/v2.0.json index aeced14..8840ee1 100644 --- a/spec/fixtures/expected/java/maven/v2.0.json +++ b/spec/fixtures/expected/java/maven/v2.0.json @@ -22,7 +22,8 @@ { "id": "bsd", "name": "BSD", - "url": "http://en.wikipedia.org/wiki/BSD_licenses" + "url": "http://en.wikipedia.org/wiki/BSD_licenses", + "count": 1 }, { "id": "LGPL-2.1", diff --git a/spec/fixtures/expected/java/maven/v2.1.json b/spec/fixtures/expected/java/maven/v2.1.json index 9d03db0..fea817f 100644 --- a/spec/fixtures/expected/java/maven/v2.1.json +++ b/spec/fixtures/expected/java/maven/v2.1.json @@ -6,11 +6,6 @@ "name": "Apache License 2.0", "url": "https://opensource.org/licenses/Apache-2.0" }, - { - "id": "bsd", - "name": "BSD", - "url": "http://en.wikipedia.org/wiki/BSD_licenses" - }, { "id": "LGPL-2.1", "name": "GNU Lesser General Public License v2.1 only", @@ -26,6 +21,11 @@ "name": "Mozilla Public License 2.0", "url": "https://opensource.org/licenses/MPL-2.0" }, + { + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" + }, { "id": "cddl + gplv2 with classpath exception", "name": "CDDL + GPLv2 with classpath exception", diff --git a/spec/fixtures/expected/python/pipenv/v2.0.json b/spec/fixtures/expected/python/pipenv/v2.0.json index c41d970..59913c2 100644 --- a/spec/fixtures/expected/python/pipenv/v2.0.json +++ b/spec/fixtures/expected/python/pipenv/v2.0.json @@ -10,7 +10,8 @@ { "id": "bsd", "name": "BSD", - "url": "http://en.wikipedia.org/wiki/BSD_licenses" + "url": "http://en.wikipedia.org/wiki/BSD_licenses", + "count": 1 }, { "id": "MIT", -- cgit v1.2.3 From df9129ee5ce3fe0ce060e828ca75f9219b3923d7 Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Wed, 19 Aug 2020 18:14:50 +0300 Subject: Fix test issues --- spec/fixtures/expected/java/gradle/v2.0.json | 3 ++- spec/fixtures/expected/java/gradle/v2.1.json | 10 +++++----- spec/fixtures/expected/python/3/pip/v2.0.json | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/spec/fixtures/expected/java/gradle/v2.0.json b/spec/fixtures/expected/java/gradle/v2.0.json index b210fb0..8592aaa 100644 --- a/spec/fixtures/expected/java/gradle/v2.0.json +++ b/spec/fixtures/expected/java/gradle/v2.0.json @@ -22,7 +22,8 @@ { "id": "bsd", "name": "BSD", - "url": "http://en.wikipedia.org/wiki/BSD_licenses" + "url": "http://en.wikipedia.org/wiki/BSD_licenses", + "count": 1 }, { "id": "LGPL-2.1", diff --git a/spec/fixtures/expected/java/gradle/v2.1.json b/spec/fixtures/expected/java/gradle/v2.1.json index c4e4fa2..4b3dff5 100644 --- a/spec/fixtures/expected/java/gradle/v2.1.json +++ b/spec/fixtures/expected/java/gradle/v2.1.json @@ -6,11 +6,6 @@ "name": "Apache License 2.0", "url": "https://opensource.org/licenses/Apache-2.0" }, - { - "id": "bsd", - "name": "BSD", - "url": "http://en.wikipedia.org/wiki/BSD_licenses" - }, { "id": "LGPL-2.1", "name": "GNU Lesser General Public License v2.1 only", @@ -26,6 +21,11 @@ "name": "Mozilla Public License 2.0", "url": "https://opensource.org/licenses/MPL-2.0" }, + { + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" + }, { "id": "cddl + gplv2 with classpath exception", "name": "CDDL + GPLv2 with classpath exception", diff --git a/spec/fixtures/expected/python/3/pip/v2.0.json b/spec/fixtures/expected/python/3/pip/v2.0.json index f4f3e1c..ad2a588 100644 --- a/spec/fixtures/expected/python/3/pip/v2.0.json +++ b/spec/fixtures/expected/python/3/pip/v2.0.json @@ -4,7 +4,8 @@ { "id": "bsd", "name": "BSD", - "url": "http://en.wikipedia.org/wiki/BSD_licenses" + "url": "http://en.wikipedia.org/wiki/BSD_licenses", + "count": 1 }, { "id": "MIT", -- cgit v1.2.3 From 418ee0d18d9bcc00a0746dc05579c31fa21f90be Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Thu, 20 Aug 2020 19:32:42 +0300 Subject: Fix test fixture --- spec/fixtures/expected/python/3/pip/v2.0.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/fixtures/expected/python/3/pip/v2.0.json b/spec/fixtures/expected/python/3/pip/v2.0.json index ad2a588..49c7328 100644 --- a/spec/fixtures/expected/python/3/pip/v2.0.json +++ b/spec/fixtures/expected/python/3/pip/v2.0.json @@ -5,7 +5,7 @@ "id": "bsd", "name": "BSD", "url": "http://en.wikipedia.org/wiki/BSD_licenses", - "count": 1 + "count": 4 }, { "id": "MIT", -- cgit v1.2.3 From a67692a51970cc219189ae731507cea6cc5b93d0 Mon Sep 17 00:00:00 2001 From: Tetiana Chupryna Date: Fri, 21 Aug 2020 13:13:36 +0300 Subject: Add changelog entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70cae4a..62ad140 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # GitLab License management changelog +## v3.24.0 + +- Removes `BSD-4-Clause` from a list of normalized licenses. (!196) + ## v3.23.0 - Upgrade [LicenseFinder](https://github.com/pivotal/LicenseFinder/) to `6.8.1` (!209) -- cgit v1.2.3 From 50a62393fe6ba477deb224480a2133482238754e Mon Sep 17 00:00:00 2001 From: mo khan Date: Fri, 21 Aug 2020 09:55:58 -0600 Subject: Update conan assertion --- spec/integration/c/conan_spec.rb | 2 +- spec/integration/python/pip_spec.rb | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/integration/c/conan_spec.rb b/spec/integration/c/conan_spec.rb index 52b7a39..baae361 100644 --- a/spec/integration/c/conan_spec.rb +++ b/spec/integration/c/conan_spec.rb @@ -16,7 +16,7 @@ RSpec.describe "conan" do specify { expect(subject).to match_schema } specify { expect { subject }.to perform_under(60).sec.warmup(0).times } - specify { expect(subject.dependency_names).to match_array(%w[openssl poco]) } + specify { expect(subject.dependency_names).to match_array(%w[bzip2 expat openssl pcre poco sqlite3 zlib]) } specify { expect(subject.licenses_for('openssl')).to match_array(['OpenSSL']) } specify { expect(subject.licenses_for('poco')).to match_array(['BSL-1.0']) } end diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index 7aec470..9911dc5 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -54,8 +54,6 @@ RSpec.describe "pip" do report = runner.scan - pp report - expect(report.licenses_for('webencodings')).to eq(['bsd']) expect(report.licenses_for('idna')).to eq(['bsd-like']) expect(report.licenses_for('EasyProcess')).to eq(['bsd']) -- cgit v1.2.3