Skip to content

Commit

Permalink
Add advisories to hie.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
tchoutri committed Nov 13, 2024
1 parent d9385d9 commit 3e40540
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ source-repository-package
./code/hsec-sync
./code/hsec-tools


source-repository-package
type: git
location: https://github.com/scrive/tracing
Expand Down
9 changes: 6 additions & 3 deletions hie.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
cradle:
cabal:
- path: "././src/core"
- path: "./src/core"
component: "lib:flora"

- path: "././src/datatypes"
- path: "./src/datatypes"
component: "lib:flora"

- path: "././src/web"
- path: "./src/advisories"
component: "lib:flora"

- path: "./src/web"
component: "flora:lib:flora-web"

- path: "./src/jobs-worker"
Expand Down
6 changes: 3 additions & 3 deletions src/advisories/Advisories/Import.hs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ processAffectedPackage advisoryId affected = do
case affected.affectedComponentIdentifier of
Hackage affectedPackageName -> PackageName affectedPackageName
GHC _ -> PackageName "ghc"
let namespace = chooseNamespace packageName "hackage" Set.empty
let namespace = chooseNamespace packageName ("hackage", Set.empty)
package <- guardThatPackageExists namespace packageName $ \_ _ ->
throwError (NonEmpty.singleton $ AffectedPackageNotFound namespace packageName)
let declarations =
Expand Down Expand Up @@ -154,8 +154,8 @@ processAffectedVersionRanges affectedPackageId packageId affectedVersions = do
mFixedReleaseId <- case affectedVersion.affectedVersionRangeFixed of
Nothing -> pure Nothing
Just version -> do
release <- guardThatReleaseExists packageId version $ \version ->
throwError (NonEmpty.singleton $ AffectedVersionNotFound packageId version)
release <- guardThatReleaseExists packageId version $ \releaseVersion ->
throwError (NonEmpty.singleton $ AffectedVersionNotFound packageId releaseVersion)
pure $ Just release.releaseId
let versionRangeDAO =
AffectedVersionRangeDAO
Expand Down
2 changes: 1 addition & 1 deletion test/Flora/PackageSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ testGetNonDeprecatedPackages = do
testReleaseDeprecation :: TestEff ()
testReleaseDeprecation = do
result <- Query.getHackagePackagesWithoutReleaseDeprecationInformation
assertEqual 78 (length result)
assertEqual 79 (length result)

binary <- fromJust <$> Query.getPackageByNamespaceAndName (Namespace "haskell") (PackageName "binary")
deprecatedBinaryVersion' <- assertJust =<< Query.getReleaseByVersion binary.packageId (mkVersion [0, 10, 0, 0])
Expand Down

0 comments on commit 3e40540

Please sign in to comment.