Skip to content

Commit

Permalink
Fix license scan bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyHuynh1 committed May 24, 2024
1 parent c43e2e3 commit 181b4e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Control/Carrier/FossaApiClient/Internal/FossaAPIV1.hs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ import App.Support (
)
import App.Types (
DependencyRebuild,
FileUpload (FileUploadFullContent),
FileUpload (FileUploadMatchData),
Policy (..),
ProjectMetadata (..),
ProjectRevision (..),
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion src/Fossa/API/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 181b4e3

Please sign in to comment.