Skip to content

Commit 6284717

Browse files
chore: enhance debug logging / release 1.0.3
1 parent b46d647 commit 6284717

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description=CodeArtifact settings plugin for Gradle
33
kotlin.code.style=official
44

55
group=io.cloudshiftdev.codeartifact
6-
version=1.0.2
6+
version=1.0.3
77

88
org.gradle.jvmargs=-Dfile.encoding\=UTF-8
99
org.gradle.vfs.watch=true

src/main/kotlin/io/cloudshiftdev/gradle/codeartifact/LocalCache.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ internal class LocalCache {
4242
val cacheFile = cacheFile(endpoint)
4343

4444
try {
45+
logger.debug("Reading cached CodeArtifact token with key {}", endpoint.cacheKey)
4546
val decryptedBytes = decrypt(cacheFile.readBytes(), endpoint.cacheKey)
4647
val token: CodeArtifactToken = mapper.readValue(decryptedBytes)
47-
if (!token.expired) {
48-
logger.debug("CodeArtifact token expired {}", token.expiration)
49-
return token
50-
}
48+
if (!token.expired) return token
49+
logger.debug("CodeArtifact token expired {}", token.expiration)
5150
} catch (thrown: Exception) {
5251
logger.debug(
5352
"Failed to read cached CodeArtifact token {}: {}",

src/test/kotlin/io/cloudshiftdev/gradle/codeartifact/CodeArtifactEndpointTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ class CodeArtifactEndpointTest : FunSpec() {
4242
}
4343

4444
test("url parsing works") {
45-
val endpoint = "https://my_domain-111122223333.d.codeartifact.us-west-2.amazonaws.com/npm/my_repo/".toCodeArtifactEndpoint()
45+
val endpoint =
46+
"https://my_domain-111122223333.d.codeartifact.us-west-2.amazonaws.com/npm/my_repo/"
47+
.toCodeArtifactEndpoint()
4648
endpoint.domain.shouldBe("my_domain")
4749
endpoint.domainOwner.shouldBe("111122223333")
4850
endpoint.region.shouldBe("us-west-2")

0 commit comments

Comments
 (0)