Skip to content

Commit

Permalink
Update Gitea version to 1.22.0 (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
CamaradeRoman committed Jul 2, 2024
1 parent 1990dd1 commit c9c7102
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ springdoc-openapi.version=2.3.0
external-systems-client.version=2.0.43
gitlab4j-api.version=6.0.0-rc.4
bitbucket.version=8.14.0-jdk11
gitea.version=1.21.10
gitea.version=1.22.0
gitlab.version=16.2.4-ce.0
postgres.version=13-alpine
opensearch.version=2.11.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.octopusden.octopus.vcsfacade.service.impl

import java.math.BigInteger
import java.net.URI
import java.net.URISyntaxException
import java.security.MessageDigest
import java.util.Date
import org.octopusden.octopus.infrastructure.client.commons.ClientParametersProvider
Expand Down Expand Up @@ -272,7 +274,19 @@ class GiteaService(
val organization = giteaRepository.fullName.lowercase().removeSuffix("/$repository")
return Repository("ssh://git@$host/$organization/$repository.git", //TODO: add "useColon" parameter?
"$httpUrl/$organization/$repository",
giteaRepository.avatarUrl.ifBlank { null })
//IMPORTANT:
//Gitea version 1.22.0 started to return host url instead of empty string as avatar_url for repository with no avatar
//Will be fixed in 1.22.1, see https://github.com/go-gitea/gitea/pull/31187
giteaRepository.avatarUrl.let {
val path = try {
URI(it).path
} catch (e: URISyntaxException) {
""
}
if (path.trim('/').isEmpty()) null else it
}
//TODO: restore `giteaRepository.avatarUrl.ifBlank { null }` after Gitea update to 1.22.1 or higher
)
}

companion object {
Expand Down

0 comments on commit c9c7102

Please sign in to comment.