Skip to content

Conversation

@0marperez
Copy link
Contributor

Issue #, if available:
N/A

Description of changes:
Collect artifact size metrics for private repos as well.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment on lines 58 to 62
} ?: 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

@0marperez 0marperez requested a review from lauzadis May 14, 2025 16:27
@0marperez 0marperez merged commit 21e3c54 into main May 14, 2025
5 checks passed
@0marperez 0marperez deleted the private-repo-metrics branch May 14, 2025 17:44
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.

2 participants