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

Update Gitea version to 1.22.0 #46

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading