Compare commits

...

13 Commits

Author SHA1 Message Date
takezoe
4b93534473 Release 4.38.4 2022-11-02 13:01:04 +09:00
Naoki Takezoe
5f51f3136c Downgrade MariaDB driver to 2.7.4 (#3186) 2022-11-02 12:58:54 +09:00
takezoe
96948ede69 Release 4.38.3 2022-10-30 10:30:59 +09:00
Naoki Takezoe
9bd0b6a801 Fix an issue that assignees are not saved in PR creation (#3178) 2022-10-30 10:26:18 +09:00
Naoki Takezoe
8b969927e1 Fix duplications in issue labels and assignees (#3168) 2022-10-30 10:26:07 +09:00
Naoki Takezoe
c2ffdf6d63 Upgrade Scalatra to 2.8.4 (#3165) 2022-10-30 10:26:02 +09:00
Naoki Takezoe
4c76b6dd96 Release 4.38.2 (#3141) 2022-09-20 17:52:14 +09:00
Scala Steward
7e66917993 Update scala-library to 2.13.9 2022-09-20 07:35:35 +09:00
Scala Steward
eb0f985399 Update jetty-continuation, jetty-http, ... to 9.4.49.v20220914 2022-09-16 07:13:32 +09:00
Naoki Takezoe
3a2908c3a3 Resurrect assignee icons on the issue list (#3136) 2022-09-13 23:19:38 +09:00
Naoki Takezoe
f13c10859f Fix warnings in AccountService (#3135) 2022-09-13 15:42:43 +09:00
Scala Steward
8e8a314c91 Update oauth2-oidc-sdk to 9.43.1 2022-09-10 07:07:24 +09:00
Naoki Takezoe
dad0478b87 Remove unused import statement (#3134) 2022-09-10 03:06:21 +09:00
11 changed files with 83 additions and 62 deletions

View File

@@ -1,6 +1,13 @@
# Changelog
All changes to the project will be documented in this file.
## 4.38.3 - 30 Oct 2022
- Fix several issues around multiple assignees in issues and pull requests
- Fix IllegalStateException when returning unknown avatar image
## 4.38.2 - 20 Sep 2022
- Resurrect assignee icons on the issue list
## 4.38.1 - 10 Sep 2022
- Fix comment diff in Chrome 105
- Fix Markdown table CSS

View File

@@ -61,6 +61,16 @@ Support
What's New in 4.38.x
-------------
## 4.38.4 - 2 Nov 2022
- Fix MariaDB issue
## 4.38.3 - 30 Oct 2022
- Fix several issues around multiple assignees in issues and pull requests
- Fix IllegalStateException when returning unknown avatar image
## 4.38.2 - 20 Sep 2022
- Resurrect assignee icons on the issue list
## 4.38.1 - 10 Sep 2022
- Fix comment diff in Chrome 105
- Fix Markdown table CSS

View File

@@ -3,9 +3,9 @@ import com.jsuereth.sbtpgp.PgpKeys._
val Organization = "io.github.gitbucket"
val Name = "gitbucket"
val GitBucketVersion = "4.38.1"
val ScalatraVersion = "2.8.2"
val JettyVersion = "9.4.48.v20220622"
val GitBucketVersion = "4.38.4"
val ScalatraVersion = "2.8.4"
val JettyVersion = "9.4.49.v20220914"
val JgitVersion = "5.13.1.202206130422-r"
lazy val root = (project in file("."))
@@ -15,7 +15,7 @@ sourcesInBase := false
organization := Organization
name := Name
version := GitBucketVersion
scalaVersion := "2.13.8"
scalaVersion := "2.13.9"
scalafmtOnCompile := true
@@ -46,7 +46,7 @@ libraryDependencies ++= Seq(
"com.github.takezoe" %% "blocking-slick-32" % "0.0.12" cross CrossVersion.for3Use2_13,
"com.novell.ldap" % "jldap" % "2009-10-07",
"com.h2database" % "h2" % "1.4.199",
"org.mariadb.jdbc" % "mariadb-java-client" % "3.0.7",
"org.mariadb.jdbc" % "mariadb-java-client" % "2.7.4",
"org.postgresql" % "postgresql" % "42.5.0",
"ch.qos.logback" % "logback-classic" % "1.2.11",
"com.zaxxer" % "HikariCP" % "4.0.3" exclude ("org.slf4j", "slf4j-api"),
@@ -56,7 +56,7 @@ libraryDependencies ++= Seq(
"org.cache2k" % "cache2k-all" % "1.6.0.Final",
"net.coobird" % "thumbnailator" % "0.4.17",
"com.github.zafarkhaja" % "java-semver" % "0.9.0",
"com.nimbusds" % "oauth2-oidc-sdk" % "9.43",
"com.nimbusds" % "oauth2-oidc-sdk" % "9.43.1",
"org.eclipse.jetty" % "jetty-webapp" % JettyVersion % "provided",
"javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided",
"junit" % "junit" % "4.13.2" % "test",

View File

@@ -112,5 +112,8 @@ object GitBucketCoreModule
new Version("4.37.1"),
new Version("4.37.2"),
new Version("4.38.0", new LiquibaseMigration("update/gitbucket-core_4.38.xml")),
new Version("4.38.1")
new Version("4.38.1"),
new Version("4.38.2"),
new Version("4.38.3"),
new Version("4.38.4")
)

View File

@@ -45,7 +45,7 @@ trait PrioritiesControllerBase extends ControllerBase {
get("/:owner/:repository/issues/priorities")(referrersOnly { repository =>
html.list(
getPriorities(repository.owner, repository.name),
countIssueGroupByPriorities(repository.owner, repository.name, IssuesService.IssueSearchCondition(), Map.empty),
countIssueGroupByPriorities(repository.owner, repository.name, IssuesService.IssueSearchCondition()),
repository,
hasDeveloperRole(repository.owner, repository.name, context.loginAccount)
)
@@ -60,7 +60,7 @@ trait PrioritiesControllerBase extends ControllerBase {
createPriority(repository.owner, repository.name, form.priorityName, form.description, form.color.substring(1))
html.priority(
getPriority(repository.owner, repository.name, priorityId).get,
countIssueGroupByPriorities(repository.owner, repository.name, IssuesService.IssueSearchCondition(), Map.empty),
countIssueGroupByPriorities(repository.owner, repository.name, IssuesService.IssueSearchCondition()),
repository,
hasDeveloperRole(repository.owner, repository.name, context.loginAccount)
)
@@ -84,7 +84,7 @@ trait PrioritiesControllerBase extends ControllerBase {
)
html.priority(
getPriority(repository.owner, repository.name, params("priorityId").toInt).get,
countIssueGroupByPriorities(repository.owner, repository.name, IssuesService.IssueSearchCondition(), Map.empty),
countIssueGroupByPriorities(repository.owner, repository.name, IssuesService.IssueSearchCondition()),
repository,
hasDeveloperRole(repository.owner, repository.name, context.loginAccount)
)

View File

@@ -69,7 +69,7 @@ trait PullRequestsControllerBase extends ControllerBase {
"commitIdFrom" -> trim(text(required, maxlength(40))),
"commitIdTo" -> trim(text(required, maxlength(40))),
"isDraft" -> trim(boolean(required)),
"assignedUserName" -> trim(optional(text())),
"assigneeUserNames" -> trim(optional(text())),
"milestoneId" -> trim(optional(number())),
"priorityId" -> trim(optional(number())),
"labelNames" -> trim(optional(text()))
@@ -92,7 +92,7 @@ trait PullRequestsControllerBase extends ControllerBase {
commitIdFrom: String,
commitIdTo: String,
isDraft: Boolean,
assignedUserNames: Option[String],
assigneeUserNames: Option[String],
milestoneId: Option[Int],
priorityId: Option[Int],
labelNames: Option[String]
@@ -593,7 +593,7 @@ trait PullRequestsControllerBase extends ControllerBase {
if (manageable) {
// insert assignees
form.assignedUserNames.foreach { value =>
form.assigneeUserNames.foreach { value =>
value.split(",").foreach { userName =>
registerIssueAssignee(repository.owner, repository.name, issueId, userName)
}

View File

@@ -7,7 +7,7 @@ import gitbucket.core.model.Profile.profile.blockingApi._
import gitbucket.core.model.Profile.dateColumnType
import gitbucket.core.util.{LDAPUtil, StringUtil}
import StringUtil._
import com.nimbusds.jose.{Algorithm, JWSAlgorithm, JWSHeader}
import com.nimbusds.jose.{JWSAlgorithm, JWSHeader}
import com.nimbusds.jose.crypto.{MACSigner, MACVerifier}
import com.nimbusds.jwt.{JWTClaimsSet, SignedJWT}
import gitbucket.core.plugin.PluginRegistry
@@ -65,28 +65,28 @@ trait AccountService {
case Right(ldapUserInfo) => {
// Create or update account by LDAP information
getAccountByUserName(ldapUserInfo.userName, true) match {
case Some(x) if (!x.isRemoved) => {
if (settings.ldap.get.mailAttribute.getOrElse("").isEmpty) {
updateAccount(x.copy(fullName = ldapUserInfo.fullName))
case Some(x) =>
if (x.isRemoved) {
logger.info("LDAP Authentication Failed: Account is already registered but disabled.")
defaultAuthentication(userName, password)
} else {
updateAccount(x.copy(mailAddress = ldapUserInfo.mailAddress, fullName = ldapUserInfo.fullName))
if (settings.ldap.get.mailAttribute.getOrElse("").isEmpty) {
updateAccount(x.copy(fullName = ldapUserInfo.fullName))
} else {
updateAccount(x.copy(mailAddress = ldapUserInfo.mailAddress, fullName = ldapUserInfo.fullName))
}
getAccountByUserName(ldapUserInfo.userName)
}
getAccountByUserName(ldapUserInfo.userName)
}
case Some(x) if (x.isRemoved) => {
logger.info("LDAP Authentication Failed: Account is already registered but disabled.")
defaultAuthentication(userName, password)
}
case None =>
getAccountByMailAddress(ldapUserInfo.mailAddress, true) match {
case Some(x) if (!x.isRemoved) => {
updateAccount(x.copy(fullName = ldapUserInfo.fullName))
getAccountByUserName(ldapUserInfo.userName)
}
case Some(x) if (x.isRemoved) => {
logger.info("LDAP Authentication Failed: Account is already registered but disabled.")
defaultAuthentication(userName, password)
}
case Some(x) =>
if (x.isRemoved) {
logger.info("LDAP Authentication Failed: Account is already registered but disabled.")
defaultAuthentication(userName, password)
} else {
updateAccount(x.copy(fullName = ldapUserInfo.fullName))
getAccountByUserName(ldapUserInfo.userName)
}
case None => {
createAccount(
ldapUserInfo.userName,

View File

@@ -147,7 +147,7 @@ trait IssuesService {
t3.labelName
}
.map {
case labelName ~ t =>
case (labelName, t) =>
labelName -> t.length
}
.list
@@ -165,8 +165,7 @@ trait IssuesService {
def countIssueGroupByPriorities(
owner: String,
repository: String,
condition: IssueSearchCondition,
filterUser: Map[String, String]
condition: IssueSearchCondition
)(implicit s: Session): Map[String, Int] = {
searchIssueQuery(Seq(owner -> repository), condition.copy(labels = Set.empty), IssueSearchOption.Issues)
@@ -180,7 +179,7 @@ trait IssuesService {
t2.priorityName
}
.map {
case priorityName ~ t =>
case (priorityName, t) =>
priorityName -> t.length
}
.list
@@ -216,9 +215,11 @@ trait IssuesService {
.on { case t1 ~ t2 ~ i ~ t3 ~ t4 ~ t5 ~ t6 => t1.byPriority(t6.userName, t6.repositoryName, t6.priorityId) }
.joinLeft(PullRequests)
.on { case t1 ~ t2 ~ i ~ t3 ~ t4 ~ t5 ~ t6 ~ t7 => t1.byIssue(t7.userName, t7.repositoryName, t7.issueId) }
.sortBy { case t1 ~ t2 ~ i ~ t3 ~ t4 ~ t5 ~ t6 ~ t7 => i asc }
.joinLeft(IssueAssignees)
.on { case t1 ~ t2 ~ i ~ t3 ~ t4 ~ t5 ~ t6 ~ t7 ~ t8 => t1.byIssue(t8.userName, t8.repositoryName, t8.issueId) }
.sortBy { case t1 ~ t2 ~ i ~ t3 ~ t4 ~ t5 ~ t6 ~ t7 ~ t8 => i asc }
.map {
case t1 ~ t2 ~ i ~ t3 ~ t4 ~ t5 ~ t6 ~ t7 =>
case t1 ~ t2 ~ i ~ t3 ~ t4 ~ t5 ~ t6 ~ t7 ~ t8 =>
(
t1,
t2.commentCount,
@@ -227,7 +228,8 @@ trait IssuesService {
t4.map(_.color),
t5.map(_.title),
t6.map(_.priorityName),
t7.map(_.commitIdTo)
t7.map(_.commitIdTo),
t8.map(_.assigneeUserName)
)
}
.list
@@ -237,16 +239,20 @@ trait IssuesService {
result.map { issues =>
issues.head match {
case (issue, commentCount, _, _, _, milestone, priority, commitId) =>
case (issue, commentCount, _, _, _, milestone, priority, commitId, _) =>
IssueInfo(
issue,
issues.flatMap { t =>
t._3.map(Label(issue.userName, issue.repositoryName, _, t._4.get, t._5.get))
} toList,
issues
.flatMap { t =>
t._3.map(Label(issue.userName, issue.repositoryName, _, t._4.get, t._5.get))
}
.distinct
.toList,
milestone,
priority,
commentCount,
commitId
commitId,
issues.flatMap(_._9).distinct
)
}
} toList
@@ -270,7 +276,7 @@ trait IssuesService {
.map { case t1 ~ t2 ~ i ~ t3 ~ t4 ~ t5 => (t1, t3, t5) }
.list
.groupBy {
case (issue, account, assignedUsers) =>
case (issue, account, _) =>
(issue, account)
}
.map {
@@ -748,12 +754,12 @@ trait IssuesService {
s: Session
): Int = {
Issues.filter(_.byPrimaryKey(owner, repository, issueId)).map(_.updatedDate).update(currentDate)
IssueComments.filter(_.byPrimaryKey(commentId)).firstOption match {
case Some(c) if c.action == "reopen_comment" =>
IssueComments.filter(_.byPrimaryKey(commentId)).first match {
case c if c.action == "reopen_comment" =>
IssueComments.filter(_.byPrimaryKey(commentId)).map(t => (t.content, t.action)).update("Reopen", "reopen")
case Some(c) if c.action == "close_comment" =>
case c if c.action == "close_comment" =>
IssueComments.filter(_.byPrimaryKey(commentId)).map(t => (t.content, t.action)).update("Close", "close")
case Some(_) =>
case _ =>
IssueComments.filter(_.byPrimaryKey(commentId)).delete
IssueComments insert IssueComment(
userName = owner,
@@ -1084,7 +1090,8 @@ object IssuesService {
milestone: Option[String],
priority: Option[String],
commentCount: Int,
commitId: Option[String]
commitId: Option[String],
assignees: Seq[String]
)
}

View File

@@ -17,7 +17,7 @@
</tr>
</thead>
<tbody>
@issues.map { case (IssueInfo(issue, labels, milestone, priority, commentCount, commitId), status) =>
@issues.map { case (IssueInfo(issue, labels, milestone, priority, commentCount, commitId, assignedUserNames), status) =>
<tr>
<td style="padding-top: 12px; padding-bottom: 12px;">
<a href="@context.path/@issue.userName/@issue.repositoryName">@issue.userName/@issue.repositoryName</a>&nbsp;&#xFF65;
@@ -33,11 +33,9 @@
<span class="label-color small" style="background-color: #@label.color; color: #@label.fontColor; padding-left: 4px; padding-right: 4px">@label.labelName</span>
}
<span class="pull-right muted">
@*
@issue.assignedUserName.map { userName =>
@assignedUserNames.map { userName =>
@helpers.avatar(userName, 20, tooltip = true)
}
*@
@if(commentCount > 0){
<a href="@context.path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-comment-count">
<i class="octicon octicon-comment active"></i> @commentCount

View File

@@ -206,7 +206,7 @@
</td>
</tr>
}
@issues.map { case (IssueInfo(issue, labels, milestone, priority, commentCount, commitId), status) =>
@issues.map { case (IssueInfo(issue, labels, milestone, priority, commentCount, commitId, assignedUserNames), status) =>
<tr>
<td style="padding-top: 12px; padding-bottom: 12px;">
@if(isManageable){
@@ -230,11 +230,9 @@
<span class="label-color small" style="background-color: #@label.color; color: #@label.fontColor; padding-left: 4px; padding-right: 4px">@label.labelName</span>
}
<span class="pull-right small">
@*
@issue.assignedUserName.map { userName =>
@assignedUserNames.map { userName =>
@helpers.avatar(userName, 20, tooltip = true)
}
*@
@if(commentCount > 0){
<a href="@context.path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-comment-count">
<i class="octicon octicon-comment active"></i> @commentCount

View File

@@ -62,7 +62,7 @@
</td>
</tr>
}
@issues.map { case (IssueInfo(issue, labels, milestone, priority, commentCount, commitId), status) =>
@issues.map { case (IssueInfo(issue, labels, milestone, priority, commentCount, commitId, assignedUserNames), status) =>
<tr>
<td style="padding-top: 12px; padding-bottom: 12px;">
@if(isManageable){
@@ -90,11 +90,9 @@
<span class="label-color small" style="background-color: #@label.color; color: #@label.fontColor; padding-left: 4px; padding-right: 4px">@label.labelName</span>
}
<span class="pull-right small">
@*
@issue.assignedUserName.map { userName =>
@assignedUserNames.map { userName =>
@helpers.avatar(userName, 20, tooltip = true)
}
*@
@if(commentCount > 0){
<a href="@context.path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-comment-count">
<i class="octicon octicon-comment active"></i> @commentCount