Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gitbucket/gitbucket-notifications-plugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.8.0
Choose a base ref
...
head repository: gitbucket/gitbucket-notifications-plugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @takezoe @xuwei-k
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [11]
steps:
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
env:
cache-name: cache-sbt-libs
with:
path: |
~/.ivy2/cache
~/.sbt
~/.coursier
key: build-${{ env.cache-name }}-${{ hashFiles('build.sbt') }}
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
- uses: sbt/setup-sbt@v1
- name: Run tests
run: |
git clone https://github.com/gitbucket/gitbucket.git
cd gitbucket
sbt publishLocal
cd ../
sbt test
- name: Assembly
run: sbt assembly
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gitbucket-notifications-plugin-java${{ matrix.java }}-${{ github.sha }}
path: ./target/scala-2.13/*.jar
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ lib_managed/
src_managed/
project/boot/
project/plugins/project/
.bsp/

# Scala-IDE specific
.scala_dependencies
@@ -25,5 +26,7 @@ project/plugins/project/
.ensime_cache/

# Metals
.bloop
.metals
.bloop/
.metals/
.vscode/
**/metals.sbt
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# gitbucket-notifications-plugin [![Build Status](https://travis-ci.org/gitbucket/gitbucket-notifications-plugin.svg)](https://travis-ci.org/gitbucket/gitbucket-notifications-plugin)
# gitbucket-notifications-plugin [![build](https://github.com/gitbucket/gitbucket-notifications-plugin/workflows/build/badge.svg?branch=master)](https://github.com/gitbucket/gitbucket-notifications-plugin/actions?query=workflow%3Abuild+branch%3Amaster)

This plug-in provides notifications feature on GitBucket.

Plugin version | GitBucket version
:--------------|:--------------------
1.8.x | 4.32.x
1.7.x | 4.30.x
1.6.x | 4.26.x
1.5.x | 4.23.x - 4.25.x
1.4.x | 4.19.x - 4.22.x
1.2.x, 1.3.x | 4.17.x - 4.18.x
1.1.x | 4.16.x
1.0.x | 4.15.x
| Plugin version | GitBucket version |
|:---------------|:------------------|
| 1.11.x | 4.37.x |
| 1.10.x | 4.35.x |
| 1.9.x | 4.34.x |
| 1.8.x | 4.32.x - 4.33.x |
| 1.7.x | 4.30.x - 4.31.x |
| 1.6.x | 4.26.x - 4.29.x |
| 1.5.x | 4.23.x - 4.25.x |
| 1.4.x | 4.19.x - 4.22.x |
| 1.2.x, 1.3.x | 4.17.x - 4.18.x |
| 1.1.x | 4.16.x |
| 1.0.x | 4.15.x |

## Features

7 changes: 4 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name := "gitbucket-notifications-plugin"
organization := "io.github.gitbucket"
version := "1.8.0"
scalaVersion := "2.13.0"
gitbucketVersion := "4.32.0"
version := "1.11.0"
scalaVersion := "2.13.16"
gitbucketVersion := "4.43.0"
scalacOptions := Seq("-deprecation", "-language:postfixOps", "-feature")
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.2.8
sbt.version=1.11.3
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("io.github.gitbucket" % "sbt-gitbucket-plugin" % "1.5.0")
addSbtPlugin("io.github.gitbucket" % "sbt-gitbucket-plugin" % "1.6.0")
5 changes: 4 additions & 1 deletion src/main/scala/Plugin.scala
Original file line number Diff line number Diff line change
@@ -33,7 +33,10 @@ class Plugin extends gitbucket.core.plugin.Plugin {
new Version("1.6.0"),
new Version("1.7.0"),
new Version("1.7.1"),
new Version("1.8.0")
new Version("1.8.0"),
new Version("1.9.0"),
new Version("1.10.0"),
new Version("1.11.0")
)

override val controllers = Seq(
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ trait NotificationsControllerBase extends ControllerBase {
val userName = params("userName")
val disable = params.getAs[Boolean]("disable").getOrElse(false)
updateEmailNotification(userName, disable)
flash += "info" -> "Notification setting has been updated."
flash.update("info", "Notification setting has been updated.")
redirect(s"/${userName}/_notifications")
})

Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ trait IssueNotificationComponent { self: gitbucket.core.model.Profile =>
val issueId = column[Int]("ISSUE_ID")
val notificationUserName = column[String]("NOTIFICATION_USER_NAME")
val subscribed = column[Boolean]("SUBSCRIBED")
def * = (userName, repositoryName, issueId, notificationUserName, subscribed) <> (IssueNotification.tupled, IssueNotification.unapply)
def * = (userName, repositoryName, issueId, notificationUserName, subscribed).<>(IssueNotification.tupled, IssueNotification.unapply)
}
}

Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ trait NotificationsAccountComponent { self: gitbucket.core.model.Profile =>
class NotificationsAccounts(tag: Tag) extends Table[NotificationsAccount](tag, "NOTIFICATIONS_ACCOUNT") {
val userName = column[String]("USER_NAME")
val disableEmail = column[Boolean]("DISABLE_EMAIL")
def * = (userName, disableEmail) <> (NotificationsAccount.tupled, NotificationsAccount.unapply)
def * = (userName, disableEmail).<>(NotificationsAccount.tupled, NotificationsAccount.unapply)
}
}

2 changes: 1 addition & 1 deletion src/main/scala/gitbucket/notifications/model/Watch.scala
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ trait WatchComponent { self: gitbucket.core.model.Profile =>
val repositoryName = column[String]("REPOSITORY_NAME")
val notificationUserName = column[String]("NOTIFICATION_USER_NAME")
val notification = column[Watch.Notification]("NOTIFICATION")
def * = (userName, repositoryName, notificationUserName, notification) <> ((Watch.apply _).tupled, Watch.unapply)
def * = (userName, repositoryName, notificationUserName, notification).<>((Watch.apply _).tupled, Watch.unapply)
}
}

Original file line number Diff line number Diff line change
@@ -179,8 +179,12 @@ class IssueHook extends gitbucket.core.plugin.IssueHook
.filterNot (_.isGroupAccount)
.filterNot (LDAPUtil.isDummyMailAddress)
.filterNot (isDisableEmailNotification)
.map (_.mailAddress)
)
.map (account =>
account.mailAddress :: getAccountExtraMailAddresses(account.userName)
)
)
.flatten
.distinct
}

}