From 181b4e35e43ffda531df506924181deadb339387 Mon Sep 17 00:00:00 2001 From: Jeffrey Huynh Date: Fri, 24 May 2024 16:02:50 -0700 Subject: [PATCH] Fix license scan bug --- src/Control/Carrier/FossaApiClient/Internal/FossaAPIV1.hs | 4 ++-- src/Fossa/API/Types.hs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Control/Carrier/FossaApiClient/Internal/FossaAPIV1.hs b/src/Control/Carrier/FossaApiClient/Internal/FossaAPIV1.hs index cb1bf7429b..88f469d01c 100644 --- a/src/Control/Carrier/FossaApiClient/Internal/FossaAPIV1.hs +++ b/src/Control/Carrier/FossaApiClient/Internal/FossaAPIV1.hs @@ -98,7 +98,7 @@ import App.Support ( ) import App.Types ( DependencyRebuild, - FileUpload (FileUploadFullContent), + FileUpload (FileUploadMatchData), Policy (..), ProjectMetadata (..), ProjectRevision (..), @@ -947,7 +947,7 @@ archiveBuildUpload' apiOpts rebuild archive = context ("archive: '" <> toText ar (baseUrl, baseOpts) <- useApiOpts apiOpts let opts = "dependency" =: True <> "rawLicenseScan" =: True - let archiveProjects = ArchiveComponents [archive] rebuild FileUploadFullContent + let archiveProjects = ArchiveComponents [archive] rebuild FileUploadMatchData -- The response appears to either be "Created" for new builds, or an error message for existing builds. -- Making the actual return value of "Created" essentially worthless. diff --git a/src/Fossa/API/Types.hs b/src/Fossa/API/Types.hs index 38a6f54031..8d0c46dd1d 100644 --- a/src/Fossa/API/Types.hs +++ b/src/Fossa/API/Types.hs @@ -151,7 +151,9 @@ instance ToJSON ArchiveComponents where toJSON ArchiveComponents{..} = object [ "archives" .= archiveComponentsArchives - , "fullFiles" .= archiveComponentsUpload + , "fullFiles" .= case archiveComponentsUpload of + FileUploadFullContent -> True + FileUploadMatchData -> False , -- Don't use the ToJSON instance of DependencyRebuild since this endpoint has a different expectation. "forceRebuild" .= case archiveComponentsRebuild of DependencyRebuildReuseCache -> False