Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

Split inferProject into inferProjectFromVCS + inferProjectDefault + saveRevision; add inferProjectCached #188

Merged
merged 4 commits into from
Feb 3, 2021

Conversation

cnr
Copy link
Contributor

@cnr cnr commented Feb 3, 2021

This fixes a bug where a missing .fossa.revision file would prevent a successful analysis, and correctly overlays "override" information from the CLI args

Fixes fossas/issues#353

@cnr cnr requested a review from skilly-lily February 3, 2021 02:26
@@ -194,7 +195,8 @@ analyze basedir destination override unpackArchives filters = do
FoundSome someProjects -> case destination of
OutputStdout -> logStdout . pretty . decodeUtf8 . Aeson.encode . buildResult $ NE.toList someProjects
UploadScan apiOpts metadata -> do
revision <- mergeOverride override <$> inferProject (unBaseDir basedir)
revision <- mergeOverride override <$> (inferProjectFromVCS basedir <||> inferProjectDefault basedir)
saveRevision revision
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trick is that we use (inferProjectFromVCS basedir <||> inferProjectDefault basedir) followed by a saveRevision in places where we do analysis, and (inferProjectFromVCS basedir <||> inferProjectCached basedir <||> inferProjectDefault basedir) elsewhere

@cnr cnr force-pushed the cached-inference-fix branch from 009749e to 402baa4 Compare February 3, 2021 03:02
Copy link
Contributor

@skilly-lily skilly-lily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great change! Removing part of the mess that was here and fixing a critical issue.

@cnr cnr merged commit 3b9249a into master Feb 3, 2021
@cnr cnr deleted the cached-inference-fix branch February 3, 2021 03:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants