Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ internal abstract class CollectDelegatedArtifactSizeMetrics : DefaultTask() {
prefix = pluginConfig.bucketPrefixOverride ?: "[TEMP]${pluginConfig.projectRepositoryName}-$identifier-"
}.contents?.map {
it.key ?: throw AwsSdkGradleException("A file from the artifact size metrics bucket is missing a key")
} ?: s3.listObjects {
bucket = S3_ARTIFACT_SIZE_METRICS_BUCKET
prefix = pluginConfig.bucketPrefixOverride ?: "[TEMP]private-${pluginConfig.projectRepositoryName}-staging-$identifier-"
}.contents?.map {
it.key ?: throw AwsSdkGradleException("A file from the artifact size metrics bucket is missing a key")
Copy link
Member

Choose a reason for hiding this comment

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

reduce duplicated code:

        val prefixes = pluginConfig.bucketPrefixOverride?.let { listOf(it) } ?: listOf(
            "[TEMP]${pluginConfig.projectRepositoryName}-$identifier-",
            "[TEMP]private-${pluginConfig.projectRepositoryName}-staging-$identifier-"
        )

        prefixes.firstNotNullOfOrNull { prefix ->
            ...
        }

Copy link
Member

Choose a reason for hiding this comment

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

Also add a comment explaining why we need to check this extra prefix

}
}
}
Expand Down