diff --git a/.drone.star b/.drone.star index 3cf17da5..430b51bb 100644 --- a/.drone.star +++ b/.drone.star @@ -1,12 +1,10 @@ BANST_AWS_CLI = "banst/awscli" -DRONE_CLI = "drone/cli:alpine" INBUCKET_INBUCKET = "inbucket/inbucket" MINIO_MC = "minio/mc:RELEASE.2020-12-18T10-53-53Z" OC_CI_ALPINE = "owncloudci/alpine:latest" OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier" OC_CI_CEPH = "owncloudci/ceph:tag-build-master-jewel-ubuntu-16.04" OC_CI_CORE = "owncloudci/core" -OC_CI_DRONE_CANCEL_PREVIOUS_BUILDS = "owncloudci/drone-cancel-previous-builds" OC_CI_DRONE_SKIP_PIPELINE = "owncloudci/drone-skip-pipeline" OC_CI_NODEJS = "owncloudci/nodejs:%s" OC_CI_ORACLE_XE = "owncloudci/oracle-xe:latest" @@ -207,7 +205,7 @@ def main(ctx): return before + coverageTests + afterCoverageTests + nonCoverageTests + stages + after def beforePipelines(ctx): - return validateDailyTarballBuild() + codestyle(ctx) + jscodestyle(ctx) + cancelPreviousBuilds() + phpstan(ctx) + phan(ctx) + phplint(ctx) + checkStarlark() + return validateDailyTarballBuild() + codestyle(ctx) + jscodestyle(ctx) + phpstan(ctx) + phan(ctx) + phplint(ctx) + checkStarlark() def coveragePipelines(ctx): # All unit test pipelines that have coverage or other test analysis reported @@ -361,31 +359,6 @@ def jscodestyle(ctx): return pipelines -def cancelPreviousBuilds(): - return [{ - "kind": "pipeline", - "type": "docker", - "name": "cancel-previous-builds", - "clone": { - "disable": True, - }, - "steps": [{ - "name": "cancel-previous-builds", - "image": OC_CI_DRONE_CANCEL_PREVIOUS_BUILDS, - "settings": { - "DRONE_TOKEN": { - "from_secret": "drone_token", - }, - }, - }], - "depends_on": [], - "trigger": { - "ref": [ - "refs/pull/**", - ], - }, - }] - def phpstan(ctx): pipelines = [] @@ -1265,7 +1238,7 @@ def acceptance(ctx): "path": "%s/downloads" % dir["server"], }], }), - ] + testConfig["extraTeardown"] + githubComment(params["earlyFail"]) + stopBuild(ctx, params["earlyFail"]), + ] + testConfig["extraTeardown"] + githubComment(params["earlyFail"]), "services": databaseService(testConfig["database"]) + browserService(testConfig["browser"]) + emailService(testConfig["emailNeeded"]) + @@ -2098,33 +2071,6 @@ def buildTestConfig(params): configs.append(config) return configs -def stopBuild(ctx, earlyFail): - if (earlyFail): - return [{ - "name": "stop-build", - "image": DRONE_CLI, - "environment": { - "DRONE_SERVER": "https://drone.owncloud.com", - "DRONE_TOKEN": { - "from_secret": "drone_token", - }, - }, - "commands": [ - "drone build stop owncloud/%s ${DRONE_BUILD_NUMBER}" % ctx.repo.name, - ], - "when": { - "status": [ - "failure", - ], - "event": [ - "pull_request", - ], - }, - }] - - else: - return [] - def githubComment(earlyFail): if (earlyFail): return [{ diff --git a/lib/MailQueueHandler.php b/lib/MailQueueHandler.php index 8d7e454d..8c027dd4 100644 --- a/lib/MailQueueHandler.php +++ b/lib/MailQueueHandler.php @@ -257,12 +257,19 @@ protected function sendMail($user, $email, $lang, $timezone, $mailData, $skipped ->setTimestamp($activity['amq_timestamp']) ->setSubject($activity['amq_subject'], []); - $relativeDateTime = $this->dateFormatter->formatDateRelativeDay( + $relativeDate = $this->dateFormatter->formatDateRelativeDay( $activity['amq_timestamp'], 'long', new \DateTimeZone($timezone), $l ); + $relativeDateTime = $this->dateFormatter->formatDateTimeRelativeDay( + $activity['amq_timestamp'], + 'long', + 'short', + new \DateTimeZone($timezone), + $l + ); $message = $this->dataHelper->translation( $activity['amq_appid'], @@ -270,14 +277,25 @@ protected function sendMail($user, $email, $lang, $timezone, $mailData, $skipped $this->dataHelper->getParameters($event, 'subject', $activity['amq_subjectparams']) ); - $activityListPlain[] = [ - $plainParser->parseMessage($message), - $relativeDateTime, - ]; - $activityListHtml[] = [ - $htmlParser->parseMessage($message), - $relativeDateTime, - ]; + if ((strpos($activity['amq_subjectparams'], 'shareExpired') !== false)) { + $activityListPlain[] = [ + $plainParser->parseMessage($message), + $relativeDate, + ]; + $activityListHtml[] = [ + $htmlParser->parseMessage($message), + $relativeDate, + ]; + } else { + $activityListPlain[] = [ + $plainParser->parseMessage($message), + $relativeDateTime, + ]; + $activityListHtml[] = [ + $htmlParser->parseMessage($message), + $relativeDateTime, + ]; + } } $alttext = new Template('activity', 'email.notification', '', false);