diff --git a/Changelog.md b/Changelog.md index 18207c1d97..31fa222166 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,9 +1,13 @@ # FOSSA CLI Changelog +## 3.9.37 + +- License Scanning: Update Themis to include NOTICE files, and parse the additional NOTICE file fields in Themis's output. ([#1466](https://github.com/fossas/fossa-cli/pull/1466)) + ## 3.9.36 -- fossa-deps: Fixed an issue where Rocky Linux deps were not supported in the fossa-deps file ([#1473](https://github.com/fossas/fossa-cli/pull/1473)) -- `fossa report`: Remove subscription type check in preflight checks ([#1474](https://github.com/fossas/fossa-cli/pull/1474)) +- fossa-deps: Fixed an issue where Rocky Linux deps were not supported in the fossa-deps file ([#1473](https://github.com/fossas/fossa-cli/pull/1473)) +- `fossa report`: Remove subscription type check in preflight checks ([#1474](https://github.com/fossas/fossa-cli/pull/1474)) ## 3.9.35 diff --git a/src/App/Fossa/Lernie/Analyze.hs b/src/App/Fossa/Lernie/Analyze.hs index 3da0b10895..555b8b5116 100644 --- a/src/App/Fossa/Lernie/Analyze.hs +++ b/src/App/Fossa/Lernie/Analyze.hs @@ -304,5 +304,6 @@ createLicenseUnitSingles ((path, title), licenseUnitData) = , licenseUnitDir = "" , licenseUnitFiles = NE.singleton (unCustomLicensePath path) , licenseUnitData = NE.singleton licenseUnitData + , licenseUnitNoticeFiles = [] , licenseUnitInfo = LicenseUnitInfo{licenseUnitInfoDescription = Just $ "custom license search " <> unCustomLicenseTitle title} } diff --git a/src/App/Fossa/ManualDeps.hs b/src/App/Fossa/ManualDeps.hs index 1901e85222..20f8952ddf 100644 --- a/src/App/Fossa/ManualDeps.hs +++ b/src/App/Fossa/ManualDeps.hs @@ -206,6 +206,7 @@ toSourceUnit root depsFile manualDeps@ManualDependencies{..} maybeApiOpts vendor , sourceUnitType = "user-specific-yaml" , sourceUnitBuild = build , sourceUnitGraphBreadth = Complete + , sourceUnitNoticeFiles = [] , sourceUnitOriginPaths = [someBaseToOriginPath originPath] , additionalData = additional } @@ -508,7 +509,8 @@ instance FromJSON CustomDependency where <$> (obj `neText` "name") <*> (unTextLike <$> obj `neText` "version") <*> (obj `neText` "license") - <*> obj .:? "metadata" + <*> obj + .:? "metadata" <* forbidMembers "custom dependencies" ["type", "path", "url"] obj instance FromJSON RemoteDependency where diff --git a/src/Srclib/Converter.hs b/src/Srclib/Converter.hs index 21f60ffef9..7e4d61f838 100644 --- a/src/Srclib/Converter.hs +++ b/src/Srclib/Converter.hs @@ -71,6 +71,7 @@ toSourceUnit leaveUnfiltered path dependencies projectType graphBreadth originPa , buildDependencies = deps } , sourceUnitGraphBreadth = graphBreadth + , sourceUnitNoticeFiles = [] , sourceUnitOriginPaths = originPaths , additionalData = Nothing } diff --git a/src/Srclib/Types.hs b/src/Srclib/Types.hs index c6155bd442..8cfda99519 100644 --- a/src/Srclib/Types.hs +++ b/src/Srclib/Types.hs @@ -5,6 +5,7 @@ module Srclib.Types ( SourceUnit (..), SourceUnitBuild (..), SourceUnitDependency (..), + SourceUnitNoticeFile (..), AdditionalDepData (..), SourceUserDefDep (..), SourceRemoteDep (..), @@ -112,6 +113,28 @@ textToOriginPath = OriginPath . toString -- Manifest?: string; -- } +data SourceUnitNoticeFile = SourceUnitNoticeFile + { sourceUnitNoticeFilePath :: Text + , sourceUnitNoticeFileContents :: Text + , sourceUnitNoticeFileCopyrights :: [Text] + } + deriving (Eq, Ord, Show) + +instance ToJSON SourceUnitNoticeFile where + toJSON SourceUnitNoticeFile{..} = + object + [ "path" .= sourceUnitNoticeFilePath + , "contents" .= sourceUnitNoticeFileContents + , "copyrights" .= sourceUnitNoticeFileCopyrights + ] + +instance FromJSON SourceUnitNoticeFile where + parseJSON = withObject "SourceUnitNoticeFile" $ \obj -> + SourceUnitNoticeFile + <$> obj .: "path" + <*> obj .: "contents" + <*> obj .:? "copyrights" .!= [] + data FullSourceUnit = FullSourceUnit { fullSourceUnitName :: Text , fullSourceUnitType :: Text @@ -119,6 +142,7 @@ data FullSourceUnit = FullSourceUnit , fullSourceUnitManifest :: Maybe Text , fullSourceUnitBuild :: Maybe SourceUnitBuild , fullSourceUnitGraphBreadth :: GraphBreadth + , fullSourceUnitNoticeFiles :: [SourceUnitNoticeFile] , fullSourceUnitOriginPaths :: [OriginPath] , fullSourceUnitAdditionalData :: Maybe AdditionalDepData , fullSourceUnitFiles :: Maybe (NonEmpty Text) @@ -136,6 +160,7 @@ licenseUnitToFullSourceUnit LicenseUnit{..} = , fullSourceUnitManifest = Nothing , fullSourceUnitBuild = Nothing , fullSourceUnitGraphBreadth = Complete + , fullSourceUnitNoticeFiles = licenseUnitNoticeFiles , fullSourceUnitOriginPaths = [] , fullSourceUnitAdditionalData = Nothing , fullSourceUnitFiles = Just licenseUnitFiles @@ -153,6 +178,7 @@ sourceUnitToFullSourceUnit SourceUnit{..} = , fullSourceUnitBuild = sourceUnitBuild , fullSourceUnitGraphBreadth = sourceUnitGraphBreadth , fullSourceUnitOriginPaths = sourceUnitOriginPaths + , fullSourceUnitNoticeFiles = sourceUnitNoticeFiles , fullSourceUnitAdditionalData = additionalData , fullSourceUnitFiles = Nothing , fullSourceUnitData = Nothing @@ -169,6 +195,7 @@ instance ToJSON FullSourceUnit where , "Build" .= fullSourceUnitBuild , "GraphBreadth" .= fullSourceUnitGraphBreadth , "OriginPaths" .= fullSourceUnitOriginPaths + , "NoticeFiles" .= fullSourceUnitNoticeFiles , "AdditionalDependencyData" .= fullSourceUnitAdditionalData , "Files" .= fullSourceUnitFiles , "Data" .= fullSourceUnitData @@ -204,6 +231,7 @@ data LicenseUnit = LicenseUnit , licenseUnitDir :: Text , licenseUnitFiles :: (NonEmpty Text) , licenseUnitData :: (NonEmpty LicenseUnitData) + , licenseUnitNoticeFiles :: [SourceUnitNoticeFile] , licenseUnitInfo :: LicenseUnitInfo } deriving (Eq, Ord, Show) @@ -217,6 +245,7 @@ emptyLicenseUnit = , licenseUnitDir = "" , licenseUnitFiles = "" :| [] , licenseUnitData = emptyLicenseUnitData :| [] + , licenseUnitNoticeFiles = [] , licenseUnitInfo = LicenseUnitInfo{licenseUnitInfoDescription = Nothing} } @@ -235,6 +264,7 @@ instance ToJSON LicenseUnit where , "Dir" .= licenseUnitDir , "Files" .= licenseUnitFiles , "Data" .= licenseUnitData + , "NoticeFiles" .= licenseUnitNoticeFiles , "Info" .= licenseUnitInfo ] @@ -247,6 +277,7 @@ instance FromJSON LicenseUnit where <*> obj .: "Dir" <*> obj .: "Files" <*> obj .: "Data" + <*> obj .:? "NoticeFiles" .!= [] <*> obj .: "Info" newtype LicenseUnitInfo = LicenseUnitInfo @@ -350,6 +381,7 @@ data SourceUnit = SourceUnit -- ^ path to manifest file , sourceUnitBuild :: Maybe SourceUnitBuild , sourceUnitGraphBreadth :: GraphBreadth + , sourceUnitNoticeFiles :: [SourceUnitNoticeFile] , sourceUnitOriginPaths :: [OriginPath] , additionalData :: Maybe AdditionalDepData } @@ -431,6 +463,7 @@ instance ToJSON SourceUnit where , "Manifest" .= sourceUnitManifest , "Build" .= sourceUnitBuild , "GraphBreadth" .= sourceUnitGraphBreadth + , "NoticeFiles" .= sourceUnitNoticeFiles , "OriginPaths" .= sourceUnitOriginPaths , "AdditionalDependencyData" .= additionalData ] @@ -443,6 +476,7 @@ instance FromJSON SourceUnit where <*> obj .: "Manifest" <*> obj .:? "Build" <*> obj .: "GraphBreadth" + <*> obj .:? "NoticeFiles" .!= [] <*> obj .: "OriginPaths" <*> obj .:? "AdditionalDependencyData" diff --git a/test/App/Fossa/Analyze/UploadSpec.hs b/test/App/Fossa/Analyze/UploadSpec.hs index 6c9021fe9b..3a7452449c 100644 --- a/test/App/Fossa/Analyze/UploadSpec.hs +++ b/test/App/Fossa/Analyze/UploadSpec.hs @@ -88,6 +88,7 @@ expectedMergedFullSourceUnits = NE.fromList [fullSourceUnit, fullLicenseUnit] , fullSourceUnitFiles = Nothing , fullSourceUnitData = Nothing , fullSourceUnitInfo = Nothing + , fullSourceUnitNoticeFiles = [] } fullLicenseUnit = FullSourceUnit @@ -102,6 +103,7 @@ expectedMergedFullSourceUnits = NE.fromList [fullSourceUnit, fullLicenseUnit] , fullSourceUnitFiles = Just $ "" NE.:| [] , fullSourceUnitData = Just $ emptyLicenseUnitData NE.:| [] , fullSourceUnitInfo = Just LicenseUnitInfo{licenseUnitInfoDescription = Nothing} + , fullSourceUnitNoticeFiles = [] } expectGetSuccessWithReachability :: Has MockApi sig m => m () diff --git a/test/App/Fossa/Container/AnalyzeNativeSpec.hs b/test/App/Fossa/Container/AnalyzeNativeSpec.hs index 53a9795d5f..70c5cabef7 100644 --- a/test/App/Fossa/Container/AnalyzeNativeSpec.hs +++ b/test/App/Fossa/Container/AnalyzeNativeSpec.hs @@ -236,6 +236,7 @@ jarsInContainerSpec = describe "Jars in Containers" $ do } , sourceUnitGraphBreadth = Complete , sourceUnitOriginPaths = [textToOriginPath "package-lock.json"] + , sourceUnitNoticeFiles = [] , additionalData = Nothing } diff --git a/test/App/Fossa/FirstPartyScanSpec.hs b/test/App/Fossa/FirstPartyScanSpec.hs index c6c7091299..826deb14cb 100644 --- a/test/App/Fossa/FirstPartyScanSpec.hs +++ b/test/App/Fossa/FirstPartyScanSpec.hs @@ -10,10 +10,11 @@ import Control.Effect.FossaApiClient (FossaApiClientF (..)) import Data.List qualified as List import Data.List.NonEmpty qualified as NE import Data.Maybe (isJust) +import Data.Text (strip) import Fossa.API.Types (Organization (..)) import Path (Dir, Path, Rel, mkRelDir, ()) import Path.IO (getCurrentDir) -import Srclib.Types (LicenseSourceUnit (..), LicenseUnit (licenseUnitData, licenseUnitName), LicenseUnitData (licenseUnitDataContents)) +import Srclib.Types (LicenseSourceUnit (..), LicenseUnit (..), LicenseUnitData (licenseUnitDataContents), SourceUnitNoticeFile (..)) import Test.Effect (expectFatal', expectationFailure', it', shouldBe') import Test.Fixtures qualified as Fixtures import Test.Hspec (Spec, describe, runIO) @@ -25,12 +26,16 @@ fixtureDir = $(mkRelDir "test/App/Fossa/VendoredDependency/testdata/repo") fixtureDirWithVendoredDeps :: Path Rel Dir fixtureDirWithVendoredDeps = $(mkRelDir "test/App/Fossa/VendoredDependency/testdata/firstparty") +fixtureDirWithNoticeFiles :: Path Rel Dir +fixtureDirWithNoticeFiles = $(mkRelDir "test/App/Fossa/VendoredDependency/testdata/firstparty-with-notice") + spec :: Spec spec = do describe "runFirstPartyScan" $ do currDir <- runIO getCurrentDir let scanDir = currDir fixtureDir let scanDirWithVendoredDeps = currDir fixtureDirWithVendoredDeps + let scanDirWithNoticeFiles = currDir fixtureDirWithNoticeFiles it' "should fail if the organization does not support first party scans and you force it on" $ do expectGetOrganizationThatDoesNotSupportFirstPartyScans @@ -99,6 +104,26 @@ spec = do licenseUnitName secondUnit `shouldBe'` "apache-2.0" licenseUnitDataContents unitData `shouldBe'` Nothing + it' "should find notice files" $ do + expectGetOrganizationThatDefaultsToFirstPartyScans + licenseSourceUnit <- firstPartyScanWithOrgInfo scanDirWithNoticeFiles Fixtures.standardAnalyzeConfig + case licenseSourceUnit of + Nothing -> expectationFailure' "first party scan should have run" + Just LicenseSourceUnit{licenseSourceUnitLicenseUnits = units} -> do + length units `shouldBe'` 3 + let noticeUnit = NE.head units + licenseUnitName noticeUnit `shouldBe'` "" + licenseUnitType noticeUnit `shouldBe'` "NoticeFileMatches" + let noticeFiles = licenseUnitNoticeFiles noticeUnit + length noticeFiles `shouldBe'` 1 + let noticeFile = head noticeFiles + let copyrights = sourceUnitNoticeFileCopyrights noticeFile + length copyrights `shouldBe'` 1 + let copyright = head copyrights + copyright `shouldBe'` "2024 Frank Frankson" + strip (sourceUnitNoticeFileContents noticeFile) `shouldBe'` "This is a notice file that is copyright 2024 Frank Frankson" + sourceUnitNoticeFilePath noticeFile `shouldBe'` "NOTICE.txt" + -- The default org defaults to not running first party scans but has first-party scans enabled expectGetOrganizationThatDefaultsToNoFirstPartyScans :: Has MockApi sig m => m () expectGetOrganizationThatDefaultsToNoFirstPartyScans = GetOrganization `alwaysReturns` Fixtures.organization diff --git a/test/App/Fossa/LernieSpec.hs b/test/App/Fossa/LernieSpec.hs index d58a409701..69535b0dd4 100644 --- a/test/App/Fossa/LernieSpec.hs +++ b/test/App/Fossa/LernieSpec.hs @@ -172,6 +172,7 @@ expectedLicenseUnit = , licenseUnitFiles = NE.singleton $ toText . toFilePath $ absDir $(mkRelDir "two.txt") , licenseUnitData = NE.singleton expectedUnitData , licenseUnitInfo = LicenseUnitInfo{licenseUnitInfoDescription = Just "custom license search Proprietary License"} + , licenseUnitNoticeFiles = [] } expectedDoubleSourceUnit :: LicenseSourceUnit diff --git a/test/App/Fossa/LicenseScannerSpec.hs b/test/App/Fossa/LicenseScannerSpec.hs index d907321518..b2a9ffaf65 100644 --- a/test/App/Fossa/LicenseScannerSpec.hs +++ b/test/App/Fossa/LicenseScannerSpec.hs @@ -43,6 +43,7 @@ unitOne = , licenseUnitFiles = NE.fromList ["foo/bar/LICENSE", "foo/bar/one.txt"] , licenseUnitInfo = info + , licenseUnitNoticeFiles = [] } unitTwo :: LicenseUnit @@ -55,6 +56,7 @@ unitTwo = , licenseUnitData = NE.fromList [emptyLicenseUnitData{licenseUnitDataPath = "foo/bar/baz/ANOTHER_LICENSE"}, emptyLicenseUnitData{licenseUnitDataPath = "foo/bar/baz/two.txt"}] , licenseUnitFiles = NE.fromList ["foo/bar/baz/ANOTHER_LICENSE", "foo/bar/baz/two.txt"] , licenseUnitInfo = info + , licenseUnitNoticeFiles = [] } expectedCombinedUnit :: LicenseUnit expectedCombinedUnit = @@ -78,6 +80,7 @@ expectedCombinedUnit = , "foo/bar/one.txt" ] , licenseUnitInfo = info + , licenseUnitNoticeFiles = [] } fixtureDir :: Path Rel Dir diff --git a/test/App/Fossa/VendoredDependency/testdata/firstparty-with-notice/APACHE_LICENSE b/test/App/Fossa/VendoredDependency/testdata/firstparty-with-notice/APACHE_LICENSE new file mode 100644 index 0000000000..f49a4e16e6 --- /dev/null +++ b/test/App/Fossa/VendoredDependency/testdata/firstparty-with-notice/APACHE_LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/test/App/Fossa/VendoredDependency/testdata/firstparty-with-notice/NOTICE.txt b/test/App/Fossa/VendoredDependency/testdata/firstparty-with-notice/NOTICE.txt new file mode 100644 index 0000000000..53ebdc28c3 --- /dev/null +++ b/test/App/Fossa/VendoredDependency/testdata/firstparty-with-notice/NOTICE.txt @@ -0,0 +1 @@ +This is a notice file that is copyright 2024 Frank Frankson diff --git a/test/App/Fossa/VendoredDependency/testdata/firstparty-with-notice/fossa-deps.yml b/test/App/Fossa/VendoredDependency/testdata/firstparty-with-notice/fossa-deps.yml new file mode 100644 index 0000000000..308a0eb8b0 --- /dev/null +++ b/test/App/Fossa/VendoredDependency/testdata/firstparty-with-notice/fossa-deps.yml @@ -0,0 +1,5 @@ +vendored-dependencies: + - name: bar + path: vendored/bar.zip + - name: foo + path: vendored/foo diff --git a/test/Test/Fixtures.hs b/test/Test/Fixtures.hs index abbcf31bff..7bc753afc4 100644 --- a/test/Test/Fixtures.hs +++ b/test/Test/Fixtures.hs @@ -244,6 +244,7 @@ sourceUnits = [unit] , sourceUnitBuild = Nothing , sourceUnitGraphBreadth = Complete , sourceUnitOriginPaths = [] + , sourceUnitNoticeFiles = [] , additionalData = Nothing } @@ -310,6 +311,7 @@ vsiSourceUnit = } , sourceUnitGraphBreadth = Complete , sourceUnitOriginPaths = ["/tmp/one/two"] + , sourceUnitNoticeFiles = [] , additionalData = Nothing }