From 67cc1f5492b43b4d721e5bb57187cdf9b250f042 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Thu, 6 Feb 2025 14:54:30 -0500 Subject: [PATCH 1/4] fix(deps): update resolver and Blammo Refactoring the CLI to use `WithLogger` should fix a bug with the logger not being flushed correctly in the presence of exceptions, and error logging being lost. --- package.yaml | 1 + src/Stackctl/AWS/CloudFormation.hs | 2 + src/Stackctl/AWS/Core.hs | 2 - src/Stackctl/AWS/Orphans.hs | 3 + src/Stackctl/CLI.hs | 63 ++++++++-------- src/Stackctl/Prelude.hs | 2 + src/Stackctl/StackSpecYaml.hs | 8 +- src/Stackctl/VerboseOption.hs | 1 + stack-lts-20.4.yaml | 22 ------ stack-lts-20.4.yaml.lock | 117 ----------------------------- stack.yaml | 15 +++- stack.yaml.lock | 109 ++++++++++++++++++++++++--- stackctl.cabal | 6 +- test/Stackctl/Test/App.hs | 1 + 14 files changed, 161 insertions(+), 191 deletions(-) delete mode 100644 stack-lts-20.4.yaml delete mode 100644 stack-lts-20.4.yaml.lock diff --git a/package.yaml b/package.yaml index 4661368..7cd0871 100644 --- a/package.yaml +++ b/package.yaml @@ -24,6 +24,7 @@ ghc-options: - -Wno-missing-import-lists - -Wno-missing-kind-signatures - -Wno-missing-local-signatures + - -Wno-missing-role-annotations - -Wno-missing-safe-haskell-mode - -Wno-prepositive-qualified-module - -Wno-unsafe diff --git a/src/Stackctl/AWS/CloudFormation.hs b/src/Stackctl/AWS/CloudFormation.hs index 728b52b..bb2e2c7 100644 --- a/src/Stackctl/AWS/CloudFormation.hs +++ b/src/Stackctl/AWS/CloudFormation.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE DuplicateRecordFields #-} + module Stackctl.AWS.CloudFormation ( Stack (..) , stack_stackName diff --git a/src/Stackctl/AWS/Core.hs b/src/Stackctl/AWS/Core.hs index b0db1f1..eff7c88 100644 --- a/src/Stackctl/AWS/Core.hs +++ b/src/Stackctl/AWS/Core.hs @@ -77,8 +77,6 @@ simple , MonadIO m , MonadAWS m , AWSRequest a - , Typeable a - , Typeable (AWSResponse a) ) => a -> (AWSResponse a -> Maybe b) diff --git a/src/Stackctl/AWS/Orphans.hs b/src/Stackctl/AWS/Orphans.hs index 00658c0..615cbfe 100644 --- a/src/Stackctl/AWS/Orphans.hs +++ b/src/Stackctl/AWS/Orphans.hs @@ -14,6 +14,9 @@ import Amazonka.CloudFormation.Types import Data.Aeson import GHC.Generics (Rep) +-- TODO: upstream +deriving newtype instance MonadUnliftIO m => MonadUnliftIO (WithLogger env m) + -- Makes it syntactally easier to do a bunch of these newtype Generically a = Generically {unGenerically :: a} diff --git a/src/Stackctl/CLI.hs b/src/Stackctl/CLI.hs index 612eaa8..2a0a833 100644 --- a/src/Stackctl/CLI.hs +++ b/src/Stackctl/CLI.hs @@ -7,6 +7,7 @@ module Stackctl.CLI import Stackctl.Prelude +import Blammo.Logging.LogSettings import qualified Blammo.Logging.LogSettings.Env as LoggingEnv import Control.Monad.AWS as AWS import Control.Monad.AWS.ViaReader as AWS @@ -60,7 +61,7 @@ instance HasAutoSSOOption options => HasAutoSSOOption (App options) where autoSSOOptionL = optionsL . autoSSOOptionL newtype AppT app m a = AppT - { unAppT :: ReaderT app (LoggingT (ResourceT m)) a + { unAppT :: ReaderT app (ResourceT m) a } deriving newtype ( Functor @@ -70,12 +71,13 @@ newtype AppT app m a = AppT , MonadUnliftIO , MonadResource , MonadReader app - , MonadLogger , MonadThrow , MonadCatch , MonadMask ) deriving (MonadAWS) via (ReaderAWS (AppT app m)) + deriving (MonadLogger) via (WithLogger app (ResourceT m)) + deriving (MonadLoggerIO) via (WithLogger app (ResourceT m)) runAppT :: ( MonadMask m @@ -94,36 +96,33 @@ runAppT options f = do . setLogSettingsConcurrency (Just 1) $ defaultLogSettings - logger <- - newLogger - $ adjustLogSettings - (options ^. colorOptionL) - (options ^. verboseOptionL) - envLogSettings - - app <- runResourceT $ runLoggerLoggingT logger $ do - aws <- runReaderT (handleAutoSSO options AWS.discover) logger - - App logger - <$> loadConfigOrExit - <*> pure options - <*> AWS.runEnvT fetchAwsScope aws - <*> pure aws - - let - AwsScope {..} = appAwsScope app - - context = - [ "region" .= awsRegion - , "accountId" .= awsAccountId - , "accountName" .= awsAccountName - ] - - runResourceT - $ runLoggerLoggingT app - $ flip runReaderT app - $ withThreadContext context - $ unAppT f + let logSettings = + adjustLogSettings + (options ^. colorOptionL) + (options ^. verboseOptionL) + envLogSettings + + withLogger logSettings $ \appLogger -> do + appAwsEnv <- runWithLogger appLogger $ handleAutoSSO options AWS.discover + appConfig <- runWithLogger appLogger loadConfigOrExit + appAwsScope <- AWS.runEnvT fetchAwsScope appAwsEnv + + let + AwsScope {..} = appAwsScope + + context = + [ "region" .= awsRegion + , "accountId" .= awsAccountId + , "accountName" .= awsAccountName + ] + + appOptions = options + app = App {..} + + runResourceT + $ flip runReaderT app + $ withThreadContext context + $ unAppT f adjustLogSettings :: Maybe ColorOption -> Verbosity -> LogSettings -> LogSettings diff --git a/src/Stackctl/Prelude.hs b/src/Stackctl/Prelude.hs index 614ec85..370271a 100644 --- a/src/Stackctl/Prelude.hs +++ b/src/Stackctl/Prelude.hs @@ -20,6 +20,8 @@ import RIO as X hiding ) import Blammo.Logging as X +import Blammo.Logging.Setup as X +import Blammo.Logging.ThreadContext as X import Control.Error.Util as X (hush, note) import Data.Aeson as X (ToJSON (..), object) import Data.Text as X (pack, unpack) diff --git a/src/Stackctl/StackSpecYaml.hs b/src/Stackctl/StackSpecYaml.hs index 7cb0e60..aebc651 100644 --- a/src/Stackctl/StackSpecYaml.hs +++ b/src/Stackctl/StackSpecYaml.hs @@ -107,7 +107,7 @@ instance ToJSON ParametersYaml where toJSON = object . parametersYamlPairs toEncoding = pairs . mconcat . parametersYamlPairs -parametersYamlPairs :: KeyValue kv => ParametersYaml -> [kv] +parametersYamlPairs :: KeyValue e kv => ParametersYaml -> [kv] parametersYamlPairs = map parameterYamlPair . unParametersYaml parametersYaml :: [ParameterYaml] -> ParametersYaml @@ -124,7 +124,7 @@ instance FromJSON ParameterYaml where (mkParameterYaml <$> o .: "Name" <*> o .:? "Value") <|> (mkParameterYaml <$> o .: "ParameterKey" <*> o .:? "ParameterValue") -parameterYamlPair :: KeyValue kv => ParameterYaml -> kv +parameterYamlPair :: KeyValue e kv => ParameterYaml -> kv parameterYamlPair ParameterYaml {..} = pyKey .= pyValue parameterYaml :: Parameter -> Maybe ParameterYaml @@ -235,7 +235,7 @@ instance ToJSON TagsYaml where toJSON = object . tagsYamlPairs toEncoding = pairs . mconcat . tagsYamlPairs -tagsYamlPairs :: KeyValue kv => TagsYaml -> [kv] +tagsYamlPairs :: KeyValue e kv => TagsYaml -> [kv] tagsYamlPairs = map tagYamlPair . unTagsYaml tagsYaml :: [TagYaml] -> TagsYaml @@ -251,5 +251,5 @@ instance FromJSON TagYaml where t <- newTag <$> o .: "Key" <*> o .: "Value" pure $ TagYaml t -tagYamlPair :: KeyValue kv => TagYaml -> kv +tagYamlPair :: KeyValue e kv => TagYaml -> kv tagYamlPair (TagYaml t) = Key.fromText (t ^. tag_key) .= (t ^. tag_value) diff --git a/src/Stackctl/VerboseOption.hs b/src/Stackctl/VerboseOption.hs index 9359c2c..1a6decf 100644 --- a/src/Stackctl/VerboseOption.hs +++ b/src/Stackctl/VerboseOption.hs @@ -7,6 +7,7 @@ module Stackctl.VerboseOption import Stackctl.Prelude +import Blammo.Logging.LogSettings import Blammo.Logging.LogSettings.LogLevels import Options.Applicative diff --git a/stack-lts-20.4.yaml b/stack-lts-20.4.yaml deleted file mode 100644 index 50d806a..0000000 --- a/stack-lts-20.4.yaml +++ /dev/null @@ -1,22 +0,0 @@ -resolver: lts-20.4 - -extra-deps: - - Blammo-1.1.2.3 - - cfn-flip-0.1.0.3 - - unliftio-0.2.25.0 - - - amazonka-2.0 - - amazonka-core-2.0 - - amazonka-certificatemanager-2.0 - - amazonka-cloudformation-2.0 - - amazonka-ec2-2.0 - - amazonka-ecr-2.0 - - amazonka-lambda-2.0 - - amazonka-sso-2.0 - - amazonka-sts-2.0 - - amazonka-mtl-0.1.1.0 - - - hspec-golden-0.2.1.0 - - # For amazonka-core-2.0 - - crypton-0.33 diff --git a/stack-lts-20.4.yaml.lock b/stack-lts-20.4.yaml.lock deleted file mode 100644 index 78e28b3..0000000 --- a/stack-lts-20.4.yaml.lock +++ /dev/null @@ -1,117 +0,0 @@ -# This file was autogenerated by Stack. -# You should not edit this file by hand. -# For more information, please see the documentation at: -# https://docs.haskellstack.org/en/stable/lock_files - -packages: -- completed: - hackage: Blammo-1.1.2.1@sha256:b74d553fb3557bb10381b806bd34b8bad0b800883f02dfd1cc847f58db40958c,4084 - pantry-tree: - sha256: bd28931f07beaaae8565a87d8c3b55d3e9ff5c332ae93dc32c1090a4c814e620 - size: 1567 - original: - hackage: Blammo-1.1.2.1 -- completed: - hackage: cfn-flip-0.1.0.3@sha256:8737882d818d74b29d3b1791a4df4dc89995870312374989c47c29352ea503ec,5615 - pantry-tree: - sha256: 715102dfcca7053390eda5be0504485fb93b8b84226fe373a6e62d297090d49b - size: 3139 - original: - hackage: cfn-flip-0.1.0.3 -- completed: - hackage: unliftio-0.2.25.0@sha256:d015242554890370bcbc3a575019be691d0edc279736ef97d29412fb9d0c4349,3410 - pantry-tree: - sha256: 08c62f256e740e1a78b175907c26cb06439a1b486ceb8021c5a2e4425ebb6c5b - size: 2494 - original: - hackage: unliftio-0.2.25.0 -- completed: - hackage: amazonka-2.0@sha256:3481da2fda6b210d15d41c1db7a588adf68123cfb7ea3882797a6230003259db,3505 - pantry-tree: - sha256: 01c7121bd5e4a3918a71ea6502412292c97facf20c9620f07af96e423d6437e2 - size: 1528 - original: - hackage: amazonka-2.0 -- completed: - hackage: amazonka-core-2.0@sha256:d9f0533c272ac92bd7b18699077038b6b51b3552e91b65743af4ce646286b4f8,4383 - pantry-tree: - sha256: 46e7e4de910b08ee2df98db9cda2becf388ce49510024018289a46c43e175ee0 - size: 3222 - original: - hackage: amazonka-core-2.0 -- completed: - hackage: amazonka-certificatemanager-2.0@sha256:9a203a46ec1eaae2c59aa891efa480f84411783d02ba973820d67e95cc67756c,5226 - pantry-tree: - sha256: 9ee7f26c6166f2b01f32efcf41d4a6315ff681823c698f49036f5b471ffb6e9c - size: 7191 - original: - hackage: amazonka-certificatemanager-2.0 -- completed: - hackage: amazonka-cloudformation-2.0@sha256:7a9618bf697cdaf0a51c2d7be557ad47820b926416d79f5138ff3befdbfcbafb,11870 - pantry-tree: - sha256: 177fbc16ea2fa072a7fca9f4a3b1d64f4d5e8fc7cd493e4e841f337c572745bd - size: 27257 - original: - hackage: amazonka-cloudformation-2.0 -- completed: - hackage: amazonka-ec2-2.0@sha256:9344b87d8f8328fd91023b96565e79e7676aa5e7dd40b87b3f3f3a22a9da7736,74154 - pantry-tree: - sha256: d1f2d4fce5b0664605d730d4232b25f26a5f49e3b7d07f4b282e8c36773e5ffd - size: 234434 - original: - hackage: amazonka-ec2-2.0 -- completed: - hackage: amazonka-ecr-2.0@sha256:88ec5dffb3c07f9e49eb4d9672ac62c175b6cf2c3e044ec0e4c705cd6bff3487,6925 - pantry-tree: - sha256: d0d5dc0ed4aab28f0d6183657e77985693c5ed011dd0cc40d335b6a334b1939a - size: 15627 - original: - hackage: amazonka-ecr-2.0 -- completed: - hackage: amazonka-lambda-2.0@sha256:aa74299380318b04429980eb76b7f0499a8241ff01de859042b0ff09bd7ef420,8281 - pantry-tree: - sha256: da8f346de9d1eb0fb12afa91e44f8179ac05176043919346e2e72a7880b7a9e5 - size: 21343 - original: - hackage: amazonka-lambda-2.0 -- completed: - hackage: amazonka-sso-2.0@sha256:902be13b604e4a3b51a9b8e1adc6a32f42322ae11f738a72a8c737b2d0a91a5e,2995 - pantry-tree: - sha256: f87dd959a78bf54295bd6f8c7da58f7f8f860251d5548ecb05ab758e03cba50b - size: 1817 - original: - hackage: amazonka-sso-2.0 -- completed: - hackage: amazonka-sts-2.0@sha256:5c721083e8d80883a893176de6105c27bbbd8176f467c27ac5f8d548a5e726d8,3209 - pantry-tree: - sha256: bde4691af7cac74e0a3705271b4d3ac05515863bfb6f668112e3f3950a27cb41 - size: 2880 - original: - hackage: amazonka-sts-2.0 -- completed: - hackage: amazonka-mtl-0.1.1.0@sha256:6735b3b77b38d705512480bf52e0602d35750b30b96d8a4a6dfc5025fcbe8358,6295 - pantry-tree: - sha256: e99311ec10875513e38d9402c73199bc567dddfffa6087769fe1889889627cd3 - size: 965 - original: - hackage: amazonka-mtl-0.1.1.0 -- completed: - hackage: hspec-golden-0.2.1.0@sha256:b695ae72685bbb5acd04cdd79d07c43de5ab8867e28662dd1a0002296f2a4940,2635 - pantry-tree: - sha256: d72fec5f2c0568ae958282c7a8b8f5bfba146e3e4ceee0510c0e22be5c8eb740 - size: 495 - original: - hackage: hspec-golden-0.2.1.0 -- completed: - hackage: crypton-0.33@sha256:5e92f29b9b7104d91fcdda1dec9400c9ad1f1791c231cc41ceebd783fb517dee,18202 - pantry-tree: - sha256: 38809499d7f9775ef45cd29ab5c3dc9b283a813f34c1cdc56681b24f8cf8bb4f - size: 23148 - original: - hackage: crypton-0.33 -snapshots: -- completed: - sha256: 3770dfd79f5aed67acdcc65c4e7730adddffe6dba79ea723cfb0918356fc0f94 - size: 648660 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/4.yaml - original: lts-20.4 diff --git a/stack.yaml b/stack.yaml index 71ce554..bf39091 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,6 +1,17 @@ -resolver: lts-22.6 +resolver: lts-23.7 extra-deps: - - Blammo-1.1.2.3 + - github: brendanhay/amazonka + commit: f3a7fca02fdbb832cc348e991983b1465225d50c + subdirs: + - lib/amazonka + - lib/amazonka-core + - lib/services/amazonka-cloudformation + - lib/services/amazonka-ec2 + - lib/services/amazonka-lambda + - lib/services/amazonka-sso + - lib/services/amazonka-sts + - amazonka-mtl-0.1.1.0 - cfn-flip-0.1.0.3 + - microlens-pro-0.2.0.2 diff --git a/stack.yaml.lock b/stack.yaml.lock index cb89bf7..23a363e 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -1,16 +1,100 @@ # This file was autogenerated by Stack. # You should not edit this file by hand. # For more information, please see the documentation at: -# https://docs.haskellstack.org/en/stable/lock_files +# https://docs.haskellstack.org/en/stable/topics/lock_files packages: - completed: - hackage: Blammo-1.1.2.3@sha256:33112de7280df78009ced5e815907ef62f902b8165434f538ce584df6cd9e47a,4710 + name: amazonka pantry-tree: - sha256: ec4524c3153eeb54a8554b3280e00011b21374e36df320733d0c35b8da0c9f23 - size: 1651 + sha256: cd18f37f7578d8b48e4c625df28753a644f204933a7e665541b9878876f4e05e + size: 1529 + sha256: 06f5e8430080e5a46e4489e12978725f4b01cfb896450a12a01bcde88168c7f2 + size: 34855734 + subdir: lib/amazonka + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz + version: '2.0' original: - hackage: Blammo-1.1.2.3 + subdir: lib/amazonka + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz +- completed: + name: amazonka-core + pantry-tree: + sha256: fbd62e7df53cf2f5b944a99d0ef024c77a10e3bde2e519fb95bcb262aed29fc4 + size: 3222 + sha256: 06f5e8430080e5a46e4489e12978725f4b01cfb896450a12a01bcde88168c7f2 + size: 34855734 + subdir: lib/amazonka-core + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz + version: '2.0' + original: + subdir: lib/amazonka-core + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz +- completed: + name: amazonka-cloudformation + pantry-tree: + sha256: 0cacf4a7cae64a63855bf1cce2b947084e4353f46756f36e65dd351087a7f63e + size: 27257 + sha256: 06f5e8430080e5a46e4489e12978725f4b01cfb896450a12a01bcde88168c7f2 + size: 34855734 + subdir: lib/services/amazonka-cloudformation + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz + version: '2.0' + original: + subdir: lib/services/amazonka-cloudformation + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz +- completed: + name: amazonka-ec2 + pantry-tree: + sha256: dc171159485af8773de82731ee1cf1df56acdf1e6c6fe76864dcf24d5d6b7e85 + size: 234434 + sha256: 06f5e8430080e5a46e4489e12978725f4b01cfb896450a12a01bcde88168c7f2 + size: 34855734 + subdir: lib/services/amazonka-ec2 + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz + version: '2.0' + original: + subdir: lib/services/amazonka-ec2 + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz +- completed: + name: amazonka-lambda + pantry-tree: + sha256: 249b7557046e64a2fae70acd3e7d7e20422ef7b3db49bf01d56c619e1d0a4470 + size: 21343 + sha256: 06f5e8430080e5a46e4489e12978725f4b01cfb896450a12a01bcde88168c7f2 + size: 34855734 + subdir: lib/services/amazonka-lambda + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz + version: '2.0' + original: + subdir: lib/services/amazonka-lambda + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz +- completed: + name: amazonka-sso + pantry-tree: + sha256: c4575f7b7cf61c3de65e43d0d77a14dfa14c47ebff5f1a3dcd2f6e1313aaaf0a + size: 1817 + sha256: 06f5e8430080e5a46e4489e12978725f4b01cfb896450a12a01bcde88168c7f2 + size: 34855734 + subdir: lib/services/amazonka-sso + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz + version: '2.0' + original: + subdir: lib/services/amazonka-sso + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz +- completed: + name: amazonka-sts + pantry-tree: + sha256: e0cb89013938230d257a2e546a78170dfdb6d507f37c6cb763a6cdf6290edb66 + size: 2880 + sha256: 06f5e8430080e5a46e4489e12978725f4b01cfb896450a12a01bcde88168c7f2 + size: 34855734 + subdir: lib/services/amazonka-sts + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz + version: '2.0' + original: + subdir: lib/services/amazonka-sts + url: https://github.com/brendanhay/amazonka/archive/f3a7fca02fdbb832cc348e991983b1465225d50c.tar.gz - completed: hackage: amazonka-mtl-0.1.1.0@sha256:90b45a950c0e398b0e48d1447766f331c2ac3d5a72e15be2bf0be3b3c56159c3,6572 pantry-tree: @@ -25,9 +109,16 @@ packages: size: 3139 original: hackage: cfn-flip-0.1.0.3 +- completed: + hackage: microlens-pro-0.2.0.2@sha256:2fd14b7f87d6aa76700dabf65fcdda835aa329a4fdd8a44eebdf399e798af7ab,3377 + pantry-tree: + sha256: be8ac1093c45ec46d640c56c06d8826d364ad1243d601e731e37581e8579e9c3 + size: 430 + original: + hackage: microlens-pro-0.2.0.2 snapshots: - completed: - sha256: 1b4c2669e26fa828451830ed4725e4d406acc25a1fa24fcc039465dd13d7a575 - size: 714100 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/6.yaml - original: lts-22.6 + sha256: 4ef79c30b9efcf07335cb3de532983a7ac4c5a4180bc17f6212a86b09ce2ff75 + size: 680777 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/7.yaml + original: lts-23.7 diff --git a/stackctl.cabal b/stackctl.cabal index 97fbfb9..7d0a84c 100644 --- a/stackctl.cabal +++ b/stackctl.cabal @@ -97,7 +97,7 @@ library StandaloneDeriving TypeApplications TypeFamilies - ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-local-signatures -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe -optP-Wno-nonportable-include-path + ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-local-signatures -Wno-missing-role-annotations -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe -optP-Wno-nonportable-include-path build-depends: Blammo >=1.1.2.3 , Glob @@ -175,7 +175,7 @@ executable stackctl StandaloneDeriving TypeApplications TypeFamilies - ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-local-signatures -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe -optP-Wno-nonportable-include-path -threaded -rtsopts -with-rtsopts=-N + ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-local-signatures -Wno-missing-role-annotations -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe -optP-Wno-nonportable-include-path -threaded -rtsopts -with-rtsopts=-N build-depends: base ==4.* , stackctl @@ -229,7 +229,7 @@ test-suite spec StandaloneDeriving TypeApplications TypeFamilies - ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-local-signatures -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe -optP-Wno-nonportable-include-path + ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-local-signatures -Wno-missing-role-annotations -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe -optP-Wno-nonportable-include-path build-depends: Blammo , Glob diff --git a/test/Stackctl/Test/App.hs b/test/Stackctl/Test/App.hs index 3e4f436..053d613 100644 --- a/test/Stackctl/Test/App.hs +++ b/test/Stackctl/Test/App.hs @@ -15,6 +15,7 @@ module Stackctl.Test.App import Stackctl.Prelude +import Blammo.Logging.LogSettings (defaultLogSettings) import Blammo.Logging.Logger (newTestLogger) import Control.Lens ((?~)) import Control.Monad.AWS From f4970e96db49663bf44db86df8372c0eb6980b12 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Thu, 6 Feb 2025 15:47:00 -0500 Subject: [PATCH 2/4] fix: correct glob in finding specs The correct glob is `us-east-1/**/*.yaml`, not `us-east-1**/*.yaml`. --- src/Stackctl/AWS/Scope.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Stackctl/AWS/Scope.hs b/src/Stackctl/AWS/Scope.hs index 909ec8d..0b56e99 100644 --- a/src/Stackctl/AWS/Scope.hs +++ b/src/Stackctl/AWS/Scope.hs @@ -27,12 +27,14 @@ awsScopeSpecPatterns AwsScope {..} = [ compile $ "stacks" unpack (unAccountId awsAccountId) <> ".*" - unpack (fromRegion awsRegion) <> "**" + unpack (fromRegion awsRegion) + "**" "*" <.> "yaml" , compile $ "stacks" "*." <> unpack (unAccountId awsAccountId) - unpack (fromRegion awsRegion) <> "**" + unpack (fromRegion awsRegion) + "**" "*" <.> "yaml" ] From 33e8be010fac68eba6789214422833cfd877c86f Mon Sep 17 00:00:00 2001 From: Pat Brisbin Date: Thu, 20 Feb 2025 08:00:15 -0500 Subject: [PATCH 3/4] chore(style): reformat yaml list Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- stack.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/stack.yaml b/stack.yaml index bf39091..bceca4c 100644 --- a/stack.yaml +++ b/stack.yaml @@ -4,13 +4,13 @@ extra-deps: - github: brendanhay/amazonka commit: f3a7fca02fdbb832cc348e991983b1465225d50c subdirs: - - lib/amazonka - - lib/amazonka-core - - lib/services/amazonka-cloudformation - - lib/services/amazonka-ec2 - - lib/services/amazonka-lambda - - lib/services/amazonka-sso - - lib/services/amazonka-sts + - lib/amazonka + - lib/amazonka-core + - lib/services/amazonka-cloudformation + - lib/services/amazonka-ec2 + - lib/services/amazonka-lambda + - lib/services/amazonka-sso + - lib/services/amazonka-sts - amazonka-mtl-0.1.1.0 - cfn-flip-0.1.0.3 From 5638a3b6a3470d562480ae1d73cfb32bfb0bc994 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Thu, 20 Feb 2025 08:42:14 -0500 Subject: [PATCH 4/4] chore(test): change order of tags yaml assertion Newer aeson seems to order differently. We don't have any real need to be robust to that, so let's just fix it to match what it is now. --- test/Stackctl/ConfigSpec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Stackctl/ConfigSpec.hs b/test/Stackctl/ConfigSpec.hs index 3d25d07..90fd683 100644 --- a/test/Stackctl/ConfigSpec.hs +++ b/test/Stackctl/ConfigSpec.hs @@ -63,7 +63,7 @@ spec = do tags `shouldBe` toTagsYaml - [("From", "Defaults"), ("Hi", "There"), ("Keep", "Me")] + [("Hi", "There"), ("From", "Defaults"), ("Keep", "Me")] loadConfigFromLines :: MonadError ConfigError m => [ByteString] -> m Config loadConfigFromLines = loadConfigFromBytes . mconcat . map (<> "\n")