Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 - Using Profile with role_arn from config over credential file #190

Merged
merged 4 commits into from
Jun 4, 2019

Conversation

popei69
Copy link
Contributor

@popei69 popei69 commented Jun 4, 2019

Addressing #189

One main difference is that config file support [profile {profile_name}] where credentials looks into [{profile_name}].

For example: iam profile defined would be [iam] in credentials but [profile iam] in config file. I also make sure we support default profile (which doesn't need the prefix in config).

I also update some related documentation to it.

@hlintBot
Copy link

hlintBot commented Jun 4, 2019

15 Warnings
⚠️ src/Lib.hs#L262 - Found Reduce duplication

let finalRepositoryMapEntries
      = if _noIgnore noIgnoreFlag then repositoryMapEntries else
          repositoryMapEntries `filterRomeFileEntriesByPlatforms`
            ignoreMapEntries
let repositoryMap = toRepositoryMap finalRepositoryMapEntries
let reverseRepositoryMap
      = toInvertedRepositoryMap finalRepositoryMapEntries
let finalIgnoreNames
      = if _noIgnore noIgnoreFlag then [] else ignoreFrameworks

Why Not

Combine with src/Lib.hs:365:5

    
⚠️ src/Lib.hs#L281 - Found Reduce duplication

let filteredCurrentMapEntries
      = currentMapEntries `filterRomeFileEntriesByPlatforms`
          ignoreMapEntries
let currentFrameworks
      = concatMap (snd . romeFileEntryToTuple) filteredCurrentMapEntries
let currentFrameworkVersions
      = map (flip FrameworkVersion currentVersion) currentFrameworks
let currentInvertedMap
      = toInvertedRepositoryMap filteredCurrentMapEntries

Why Not

Combine with src/Lib.hs:401:15

    
⚠️ src/Lib.hs#L301 - Found Redundant bracket

if _noSkipCurrent noSkipCurrentFlag then
  (currentFrameworkVersions `filterOutFrameworksAndVersionsIfNotIn`
     finalIgnoreNames)
  else []

Why Not

if _noSkipCurrent noSkipCurrentFlag then
  currentFrameworkVersions `filterOutFrameworksAndVersionsIfNotIn`
    finalIgnoreNames
  else []

    
⚠️ src/Lib.hs#L925 - Found Reduce duplication

dwarfUUIDs <- dwarfUUIDsFrom (frameworkDirectory </> fwn)
maybeUUIDsArchives <- liftIO $
                        forM dwarfUUIDs $
                          \ dwarfUUID ->
                            runMaybeT $
                              do dwarfArchive <- exceptToMaybeT $
                                                   createZipArchive (bcSymbolMapPath dwarfUUID)
                                                     verbose
                                 return (dwarfUUID, dwarfArchive)
unless skipLocalCache $
  forM_ maybeUUIDsArchives $
    mapM $
      \ (dwarfUUID, dwarfArchive) ->
        maybe (return ()) liftIO $
          runReaderT <$>
            (saveBcsymbolmapToLocalCache <$> mlCacheDir <*> Just dwarfUUID <*>
               Just dwarfArchive
               <*> Just reverseRomeMap
               <*> Just fVersion
               <*> Just platform)
            <*> Just (cachePrefix, s, verbose)

Why Not

Combine with src/Lib.hs:1133:7

    
⚠️ src/Lib.hs#L960 - Found Reduce duplication

frameworkNameWithFrameworkExtension = appendFrameworkExtensionTo f
platformBuildDirectory
  = carthageArtifactsBuildDirectoryForPlatform platform f
frameworkDirectory
  = platformBuildDirectory </> frameworkNameWithFrameworkExtension
dSYMNameWithDSYMExtension
  = frameworkNameWithFrameworkExtension <> ".dSYM"
dSYMdirectory
  = platformBuildDirectory </> dSYMNameWithDSYMExtension
bcSymbolMapPath d
  = platformBuildDirectory </> bcsymbolmapNameFrom d

Why Not

Combine with src/Lib.hs:1040:3

    
⚠️ src/Lib.hs#L960 - Found Reduce duplication

frameworkNameWithFrameworkExtension = appendFrameworkExtensionTo f
platformBuildDirectory
  = carthageArtifactsBuildDirectoryForPlatform platform f
frameworkDirectory
  = platformBuildDirectory </> frameworkNameWithFrameworkExtension
dSYMNameWithDSYMExtension
  = frameworkNameWithFrameworkExtension <> ".dSYM"
dSYMdirectory
  = platformBuildDirectory </> dSYMNameWithDSYMExtension
bcSymbolMapPath d
  = platformBuildDirectory </> bcsymbolmapNameFrom d

Why Not

Combine with src/Lib.hs:1168:3

    
⚠️ src/Lib.hs#L1226 - Found Reduce duplication

saveBinaryToLocalCache lCacheDir versionFileBinary
  (prefix </> versionFileRemotePath)
  versionFileName
  verbose
liftIO $ saveBinaryToFile versionFileBinary versionFileLocalPath
sayFunc $
  "Copied " <> versionFileName <> " to: " <> versionFileLocalPath

Why Not

Combine with src/Lib.hs:1740:17

    
⚠️ src/Lib.hs#L1241 - Found Reduce duplication

versionFileName
  = versionFileNameForProjectName $ fst projectNameAndVersion
versionFileLocalPath = carthageBuildDirectory </> versionFileName
versionFileRemotePath = remoteVersionFilePath projectNameAndVersion

Why Not

Combine with src/Lib.hs:1755:3

    
⚠️ src/Lib.hs#L1342 - Found Reduce duplication

saveBinaryToLocalCache lCacheDir frameworkBinary
  (prefix </> remoteFrameworkUploadPath)
  fwn
  verbose
deleteFrameworkDirectory fVersion platform verbose
unzipBinary frameworkBinary fwn frameworkZipName verbose <*
  ifExists frameworkExecutablePath
    (makeExecutable frameworkExecutablePath)

Why Not

Combine with src/Lib.hs:1555:17

    
⚠️ src/Lib.hs#L1374 - Found Reduce duplication

let symbolmapLoggingName
      = fwn <> "." <> bcsymbolmapNameFrom dwarfUUID
let bcsymbolmapZipName d = bcsymbolmapArchiveName d version
let localBcsymbolmapPathFrom d
      = platformBuildDirectory </> bcsymbolmapNameFrom d

Why Not

Combine with src/Lib.hs:1586:21

    
⚠️ src/Lib.hs#L1384 - Found Reduce duplication

saveBinaryToLocalCache lCacheDir symbolmapBinary
  (prefix </> remoteBcSymbolmapUploadPathFromDwarf dwarfUUID)
  fwn
  verbose
deleteFile (localBcsymbolmapPathFrom dwarfUUID) verbose
unzipBinary symbolmapBinary symbolmapLoggingName
  (bcsymbolmapZipName dwarfUUID)
  verbose

Why Not

Combine with src/Lib.hs:1596:21

    
⚠️ src/Lib.hs#L1419 - Found Reduce duplication

saveBinaryToLocalCache lCacheDir dSYMBinary
  (prefix </> remotedSYMUploadPath)
  dSYMName
  verbose
deleteDSYMDirectory fVersion platform verbose
unzipBinary dSYMBinary dSYMName dSYMZipName verbose

Why Not

Combine with src/Lib.hs:1630:17

    
⚠️ src/Lib.hs#L1430 - Found Reduce duplication

frameworkZipName = frameworkArchiveName f version
remoteFrameworkUploadPath
  = remoteFrameworkPath platform reverseRomeMap f version
remoteBcSymbolmapUploadPathFromDwarf dwarfUUID
  = remoteBcsymbolmapPath dwarfUUID platform reverseRomeMap f version
dSYMZipName = dSYMArchiveName f version
remotedSYMUploadPath
  = remoteDsymPath platform reverseRomeMap f version
platformBuildDirectory
  = carthageArtifactsBuildDirectoryForPlatform platform f
dSYMName = fwn <> ".dSYM"
frameworkExecutablePath
  = frameworkBuildBundleForPlatform platform f </> fwn

Why Not

Combine with src/Lib.hs:1641:3

    
⚠️ src/Lib.hs#L1472 - Found Use lambda-case

\ e ->
  case e of
      ErrorGettingDwarfUUIDs -> sayFunc $
                                  "Error: Cannot retrieve symbolmaps ids for " <> fwn
      (FailedDwarfUUIDs dwardUUIDsAndErrors) -> mapM_ (sayFunc . snd)
                                                  dwardUUIDsAndErrors

Why Not

\case
    ErrorGettingDwarfUUIDs -> sayFunc $
                                "Error: Cannot retrieve symbolmaps ids for " <> fwn
    (FailedDwarfUUIDs dwardUUIDsAndErrors) -> mapM_ (sayFunc . snd)
                                                dwardUUIDsAndErrors

    
⚠️ src/Lib.hs#L1684 - Found Use lambda-case

\ e ->
  case e of
      ErrorGettingDwarfUUIDs -> sayFunc $
                                  "Error: Cannot retrieve symbolmaps ids for " <> fwn
      (FailedDwarfUUIDs dwardUUIDsAndErrors) -> mapM_ (sayFunc . snd)
                                                  dwardUUIDsAndErrors

Why Not

\case
    ErrorGettingDwarfUUIDs -> sayFunc $
                                "Error: Cannot retrieve symbolmaps ids for " <> fwn
    (FailedDwarfUUIDs dwardUUIDsAndErrors) -> mapM_ (sayFunc . snd)
                                                dwardUUIDsAndErrors

    

Generated by 🚫 Danger

Copy link
Owner

@tmspzz tmspzz left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@tmspzz tmspzz merged commit ba9372c into tmspzz:master Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants