@@ -54,7 +54,9 @@ getSettings :: Manager -> BuildType -> IO Settings
54getSettings man Nightly = do
54getSettings man Nightly = do
55 day <- tshow . utctDay <$> getCurrentTime
55 day <- tshow . utctDay <$> getCurrentTime
56 let slug' = "nightly-" ++ day
56 let slug' = "nightly-" ++ day
57+ bc <- defaultBuildConstraints man
58+ pkgs <- getLatestAllowedPlans bc
57− plan' <- defaultBuildConstraints man >>= newBuildPlan
59+ plan' <- newBuildPlan pkgs bc
58 return Settings
60 return Settings
59 { planFile = fpFromText ("nightly-" ++ day) <.> "yaml"
61 { planFile = fpFromText ("nightly-" ++ day) <.> "yaml"
60 , buildDir = fpFromText $ "builds/stackage-nightly-" ++ day
62 , buildDir = fpFromText $ "builds/stackage-nightly-" ++ day
@@ -81,14 +83,18 @@ getSettings man (LTS bumpType) = do
81 case mlts of
83 case mlts of
82 Nothing -> LTSVer 0 0
84 Nothing -> LTSVer 0 0
83 Just (LTSVer x _) -> LTSVer (x + 1) 0
85 Just (LTSVer x _) -> LTSVer (x + 1) 0
86+ bc <- defaultBuildConstraints man
87+ pkgs <- getLatestAllowedPlans bc
84− plan' <- defaultBuildConstraints man >>= newBuildPlan
88+ plan' <- newBuildPlan pkgs bc
85 return (new, plan')
89 return (new, plan')
86 Minor -> do
90 Minor -> do
87 old <- maybe (error "No LTS plans found in current directory") return mlts
91 old <- maybe (error "No LTS plans found in current directory") return mlts
88 oldplan <- decodeFileEither (fpToString $ renderLTSVer old)
92 oldplan <- decodeFileEither (fpToString $ renderLTSVer old)
89 >>= either throwM return
93 >>= either throwM return
90 let new = incrLTSVer old
94 let new = incrLTSVer old
91− plan' <- updateBuildPlan oldplan
95+ let bc = updateBuildConstraints oldplan
96+ pkgs <- getLatestAllowedPlans bc
97+ plan' <- newBuildPlan pkgs bc
92 return (new, plan')
98 return (new, plan')
94 let newfile = renderLTSVer new
100 let newfile = renderLTSVer new
@@ -148,7 +154,8 @@ justCheck = withManager tlsManagerSettings $ \man -> do
148 bc <- defaultBuildConstraints man
154 bc <- defaultBuildConstraints man
150 putStrLn "Creating build plan"
156 putStrLn "Creating build plan"
157+ plans <- getLatestAllowedPlans bc
151− plan <- newBuildPlan bc
158+ plan <- newBuildPlan plans bc
153 putStrLn $ "Writing build plan to check-plan.yaml"
160 putStrLn $ "Writing build plan to check-plan.yaml"
154 encodeFile "check-plan.yaml" plan
161 encodeFile "check-plan.yaml" plan