From 8b7928072106d46dadf2734d4de600866f05a41a Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 4 Jul 2023 21:44:30 +0545 Subject: [PATCH 1/7] Remove special PR-based drone actions from CI --- .drone.star | 58 ++--------------------------------------------------- 1 file changed, 2 insertions(+), 56 deletions(-) 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 [{ From 8dd59e90ae82d2c5adbd062035573e89b6fdf84b Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 6 Jul 2023 14:06:35 +0545 Subject: [PATCH 2/7] Adjust cache_s3 usage in drone CI --- .drone.star | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/.drone.star b/.drone.star index 430b51bb..1ee9c5cc 100644 --- a/.drone.star +++ b/.drone.star @@ -38,7 +38,7 @@ dir = { config = { "rocketchat": { "channel": "builds", - "from_secret": "private_rocketchat", + "from_secret": "rocketchat_chat_webhook", }, "branches": [ "master", @@ -682,7 +682,7 @@ def javascript(ctx, withCoverage): "image": PLUGINS_S3, "settings": { "endpoint": { - "from_secret": "cache_s3_endpoint", + "from_secret": "cache_s3_server", }, "bucket": "cache", "source": "./coverage/lcov.info", @@ -910,7 +910,7 @@ def phpTests(ctx, testType, withCoverage): "image": PLUGINS_S3, "settings": { "endpoint": { - "from_secret": "cache_s3_endpoint", + "from_secret": "cache_s3_server", }, "bucket": "cache", "source": "tests/output/clover-%s.xml" % (name), @@ -1324,13 +1324,19 @@ def sonarAnalysis(ctx, phpVersion = DEFAULT_PHP_VERSION): "name": "sync-from-cache", "image": MINIO_MC, "environment": { - "MC_HOST_cache": { - "from_secret": "cache_s3_connection_url", + "S3_ACCESS_KEY": { + "from_secret": "cache_s3_access_key", + }, + "S3_SECRET_KEY": { + "from_secret": "cache_s3_secret_key", + }, + "S3_SERVER": { + "from_secret": "cache_s3_server", }, }, "commands": [ "mkdir -p results", - "mc mirror cache/cache/%s/%s results/" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"), + "export MC_HOST_cache=\"https://$S3_ACCESS_KEY:$S3_SECRET_KEY@$${S3_SERVER:8}\"; mc mirror cache/cache/%s/%s results/" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"), ], }, { @@ -1355,12 +1361,18 @@ def sonarAnalysis(ctx, phpVersion = DEFAULT_PHP_VERSION): "name": "purge-cache", "image": MINIO_MC, "environment": { - "MC_HOST_cache": { - "from_secret": "cache_s3_connection_url", + "S3_ACCESS_KEY": { + "from_secret": "cache_s3_access_key", + }, + "S3_SECRET_KEY": { + "from_secret": "cache_s3_secret_key", + }, + "S3_SERVER": { + "from_secret": "cache_s3_server", }, }, "commands": [ - "mc rm --recursive --force cache/cache/%s/%s" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"), + "export MC_HOST_cache=\"https://$S3_ACCESS_KEY:$S3_SECRET_KEY@$${S3_SERVER:8}\"; mc rm --recursive --force cache/cache/%s/%s" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"), ], }, ], @@ -1691,7 +1703,7 @@ def cacheRestore(): "from_secret": "cache_s3_access_key", }, "endpoint": { - "from_secret": "cache_s3_endpoint", + "from_secret": "cache_s3_server", }, "restore": True, "secret_key": { From d870396e7187e5873c7b63079eecac20e0227de8 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 6 Jul 2023 19:47:33 +0545 Subject: [PATCH 3/7] use MINIO_MC_ENV variables and 'mc alias' for S3 cache access --- .drone.star | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.drone.star b/.drone.star index 1ee9c5cc..3ba46661 100644 --- a/.drone.star +++ b/.drone.star @@ -26,6 +26,22 @@ THEGEEKLAB_DRONE_GITHUB_COMMENT = "thegeeklab/drone-github-comment:1" DEFAULT_PHP_VERSION = "7.4" DEFAULT_NODEJS_VERSION = "14" +# minio mc environment variables +MINIO_MC_ENV = { + "CACHE_BUCKET": { + "from_secret": "cache_s3_bucket", + }, + "MC_HOST": { + "from_secret": "cache_s3_server", + }, + "AWS_ACCESS_KEY_ID": { + "from_secret": "cache_s3_access_key", + }, + "AWS_SECRET_ACCESS_KEY": { + "from_secret": "cache_s3_secret_key", + }, +} + dir = { "base": "/var/www/owncloud", "federated": "/var/www/owncloud/federated", @@ -1323,20 +1339,11 @@ def sonarAnalysis(ctx, phpVersion = DEFAULT_PHP_VERSION): { "name": "sync-from-cache", "image": MINIO_MC, - "environment": { - "S3_ACCESS_KEY": { - "from_secret": "cache_s3_access_key", - }, - "S3_SECRET_KEY": { - "from_secret": "cache_s3_secret_key", - }, - "S3_SERVER": { - "from_secret": "cache_s3_server", - }, - }, + "environment": MINIO_MC_ENV, "commands": [ "mkdir -p results", - "export MC_HOST_cache=\"https://$S3_ACCESS_KEY:$S3_SECRET_KEY@$${S3_SERVER:8}\"; mc mirror cache/cache/%s/%s results/" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"), + "mc alias set cache $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror cache/cache/%s/%s results/" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"), ], }, { @@ -1360,19 +1367,10 @@ def sonarAnalysis(ctx, phpVersion = DEFAULT_PHP_VERSION): { "name": "purge-cache", "image": MINIO_MC, - "environment": { - "S3_ACCESS_KEY": { - "from_secret": "cache_s3_access_key", - }, - "S3_SECRET_KEY": { - "from_secret": "cache_s3_secret_key", - }, - "S3_SERVER": { - "from_secret": "cache_s3_server", - }, - }, + "environment": MINIO_MC_ENV, "commands": [ - "export MC_HOST_cache=\"https://$S3_ACCESS_KEY:$S3_SECRET_KEY@$${S3_SERVER:8}\"; mc rm --recursive --force cache/cache/%s/%s" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"), + "mc alias set cache $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc rm --recursive --force cache/cache/%s/%s" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"), ], }, ], From 6b40da0cd6048ca22c58d22c07141bde125892be Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 12 Jul 2023 10:08:39 +0545 Subject: [PATCH 4/7] Remove githubComment and unused earlyFail from drone CI --- .drone.star | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/.drone.star b/.drone.star index 3ba46661..b3934291 100644 --- a/.drone.star +++ b/.drone.star @@ -21,7 +21,6 @@ PLUGINS_SLACK = "plugins/slack:1" SELENIUM_STANDALONE_CHROME_DEBUG = "selenium/standalone-chrome-debug:3.141.59-oxygen" SELENIUM_STANDALONE_FIREFOX_DEBUG = "selenium/standalone-firefox-debug:3.8.1" SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli" -THEGEEKLAB_DRONE_GITHUB_COMMENT = "thegeeklab/drone-github-comment:1" DEFAULT_PHP_VERSION = "7.4" DEFAULT_NODEJS_VERSION = "14" @@ -997,7 +996,6 @@ def acceptance(ctx): "skip": False, "debugSuites": [], "skipExceptParts": [], - "earlyFail": True, "enableApp": True, "selUserNeeded": False, } @@ -1035,14 +1033,6 @@ def acceptance(ctx): if params["skip"]: continue - # switch off earlyFail if the PR title contains full-ci - if ("full-ci" in ctx.build.title.lower()): - params["earlyFail"] = False - - # switch off earlyFail when running cron builds (for example, nightly CI) - if (ctx.build.event == "cron"): - params["earlyFail"] = False - if "externalScality" in params and len(params["externalScality"]) != 0: # We want to use an external scality server for this pipeline. # That uses some "standard" extraSetup and extraTeardown. @@ -1254,7 +1244,7 @@ def acceptance(ctx): "path": "%s/downloads" % dir["server"], }], }), - ] + testConfig["extraTeardown"] + githubComment(params["earlyFail"]), + ] + testConfig["extraTeardown"], "services": databaseService(testConfig["database"]) + browserService(testConfig["browser"]) + emailService(testConfig["emailNeeded"]) + @@ -2081,33 +2071,6 @@ def buildTestConfig(params): configs.append(config) return configs -def githubComment(earlyFail): - if (earlyFail): - return [{ - "name": "github-comment", - "image": THEGEEKLAB_DRONE_GITHUB_COMMENT, - "pull": "if-not-exists", - "settings": { - "message": ":boom: Acceptance tests pipeline ${DRONE_STAGE_NAME} failed. The build has been cancelled.\\n\\n${DRONE_BUILD_LINK}/${DRONE_JOB_NUMBER}${DRONE_STAGE_NUMBER}", - "key": "pr-${DRONE_PULL_REQUEST}", - "update": "true", - "api_key": { - "from_secret": "github_token", - }, - }, - "when": { - "status": [ - "failure", - ], - "event": [ - "pull_request", - ], - }, - }] - - else: - return [] - def checkStarlark(): return [{ "kind": "pipeline", From 03898385c8b81aef0268320ef7ce4d00f82daeb7 Mon Sep 17 00:00:00 2001 From: ownClouders Date: Wed, 12 Jul 2023 20:57:07 +0000 Subject: [PATCH 5/7] [tx] updated from transifex --- l10n/pl_PL.js | 3 +++ l10n/pl_PL.json | 3 +++ 2 files changed, 6 insertions(+) diff --git a/l10n/pl_PL.js b/l10n/pl_PL.js index 43d2cdea..aa3932b8 100644 --- a/l10n/pl_PL.js +++ b/l10n/pl_PL.js @@ -7,6 +7,7 @@ OC.L10N.register( "Load more activities" : "Załaduj więcej aktywności", ", " : ", ", "{parameterList} and {lastParameter}" : "{parameterList} i {lastParameter}", + "_{parameterList} and {linkStart}%n more{linkEnd}_::_{parameterList} and {linkStart}%n more{linkEnd}_" : ["{parameterList} i {linkStart}%n więcej{linkEnd}","{parameterList} i {linkStart}%n więcej{linkEnd}","{parameterList} i {linkStart}%n więcej{linkEnd}","{parameterList} i {linkStart}%n więcej{linkEnd}"], "in {directory}" : "w {directory}", "This stream will show events like additions, changes & shares" : "Ten strumień pokaże informacje o dodatkach, zmianachi udostępnieniach", "There are no events for this filter" : "Nie ma zdarzeń dla tych filtrów", @@ -26,8 +27,10 @@ OC.L10N.register( "Hello %s," : "Witaj %s,", "You are receiving this email because the following things happened at %s" : "Otrzymujesz tę wiadomość, ponieważ w chmurze %s miały miejsce następujące aktywności:", "* %1$s - %2$s" : "* %1$s - %2$s", + "_* and %n more _::_* and %n more _" : ["* i %n więcej ","* i %n więcej ","* i %n więcej ","* i %n więcej "], "You are receiving this email because the following things happened at %s" : "Otrzymałeś tą wiadomość ponieważ zaszły następujące zdarzenia na %s", "%1$s - %2$s" : "%1$s - %2$s", + "_and %n more _::_and %n more _" : ["i %n więcej","i %n więcej","i %n więcej","i %n więcej"], "Activity" : "Aktywność", "List your own file actions in the stream" : "Wyświetl Twoje czynności w strumieniu", "Notify about your own actions via email" : "Powiadamiaj mnie o moich aktywnościach przez email", diff --git a/l10n/pl_PL.json b/l10n/pl_PL.json index 4ee86f6e..61a74f83 100644 --- a/l10n/pl_PL.json +++ b/l10n/pl_PL.json @@ -5,6 +5,7 @@ "Load more activities" : "Załaduj więcej aktywności", ", " : ", ", "{parameterList} and {lastParameter}" : "{parameterList} i {lastParameter}", + "_{parameterList} and {linkStart}%n more{linkEnd}_::_{parameterList} and {linkStart}%n more{linkEnd}_" : ["{parameterList} i {linkStart}%n więcej{linkEnd}","{parameterList} i {linkStart}%n więcej{linkEnd}","{parameterList} i {linkStart}%n więcej{linkEnd}","{parameterList} i {linkStart}%n więcej{linkEnd}"], "in {directory}" : "w {directory}", "This stream will show events like additions, changes & shares" : "Ten strumień pokaże informacje o dodatkach, zmianachi udostępnieniach", "There are no events for this filter" : "Nie ma zdarzeń dla tych filtrów", @@ -24,8 +25,10 @@ "Hello %s," : "Witaj %s,", "You are receiving this email because the following things happened at %s" : "Otrzymujesz tę wiadomość, ponieważ w chmurze %s miały miejsce następujące aktywności:", "* %1$s - %2$s" : "* %1$s - %2$s", + "_* and %n more _::_* and %n more _" : ["* i %n więcej ","* i %n więcej ","* i %n więcej ","* i %n więcej "], "You are receiving this email because the following things happened at %s" : "Otrzymałeś tą wiadomość ponieważ zaszły następujące zdarzenia na %s", "%1$s - %2$s" : "%1$s - %2$s", + "_and %n more _::_and %n more _" : ["i %n więcej","i %n więcej","i %n więcej","i %n więcej"], "Activity" : "Aktywność", "List your own file actions in the stream" : "Wyświetl Twoje czynności w strumieniu", "Notify about your own actions via email" : "Powiadamiaj mnie o moich aktywnościach przez email", From 473d9aec38be24f014501f5005493cbc4a258204 Mon Sep 17 00:00:00 2001 From: Florian Schade Date: Tue, 8 Aug 2023 10:27:55 +0200 Subject: [PATCH 6/7] chore: bump security related js vendor dependencies --- package.json | 5 +++++ yarn.lock | 19 ++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 16e5c853..0a52d6d1 100644 --- a/package.json +++ b/package.json @@ -19,5 +19,10 @@ "karma-jasmine-sinon": "^1.0.4", "karma-phantomjs-launcher": "*" }, + "resolutions": { + "minimist": "0.2.4", + "json-schema": "0.4.0", + "qs": "json-schema" + }, "engine": "node >= 0.8" } diff --git a/yarn.lock b/yarn.lock index 54b18bcb..33b53bee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -672,9 +672,10 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" +json-schema@0.2.3, json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== json-stringify-safe@~5.0.1: version "5.0.1" @@ -840,14 +841,10 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== +minimist@0.0.8, minimist@0.2.4, minimist@^1.2.5: + version "0.2.4" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.2.4.tgz#0085d5501e29033748a2f2a4da0180142697a475" + integrity sha512-Pkrrm8NjyQ8yVt8Am9M+yUt74zE3iokhzbG1bFVNjLB92vwM71hf40RkEsryg98BujhVOncKm/C1xROxZ030LQ== mkdirp@0.5.1: version "0.5.1" From 26fa13860da95b498256c2ea747c4a1c1fdd3836 Mon Sep 17 00:00:00 2001 From: Florian Schade Date: Tue, 8 Aug 2023 14:28:28 +0200 Subject: [PATCH 7/7] chore: fix version --- package.json | 2 +- yarn.lock | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 0a52d6d1..efd01ef7 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "resolutions": { "minimist": "0.2.4", "json-schema": "0.4.0", - "qs": "json-schema" + "qs": "6.7.3" }, "engine": "node >= 0.8" } diff --git a/yarn.lock b/yarn.lock index 33b53bee..85d8ddb6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -988,15 +988,10 @@ qjobs@^1.2.0: resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== - -qs@~6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" - integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== +qs@6.7.0, qs@6.7.3, qs@~6.5.2: + version "6.7.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.3.tgz#67634d715101aa950601f58dbef353b7e1696b95" + integrity sha512-WBoQWf5L/UOLqUj8Mvr4Om7J+ZTCqPbYPHyeLNRS9t9Q3M3/o/9ctpWnlo8yyETPclx7FhH5LidjKKJa9kdSRQ== range-parser@^1.2.1: version "1.2.1"