From 4146a71f242ea84606c675efeab563f4c0a06930 Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Wed, 16 Aug 2023 15:10:52 +0530 Subject: [PATCH 01/18] Enable SAST --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6119917f..db2f360c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,3 +7,5 @@ include: - project: "e/infra/ecloud/nextcloud-apps/ci-templates" ref: main file: "nc-apps-deploy.yml" + - template: Jobs/SAST.gitlab-ci.yml + -- GitLab From 772adedc70b7e5ca228ca11a556fe5948a0b3dbc Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Wed, 16 Aug 2023 15:22:41 +0530 Subject: [PATCH 02/18] Cleanup --- .gitlab-ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db2f360c..e3a4e72d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - TO_PACKAGE: 'appinfo l10n lib templates js img' + TO_PACKAGE: 'appinfo l10n lib templates js img' include: - project: "e/infra/ecloud/nextcloud-apps/ci-templates" ref: main @@ -9,3 +9,7 @@ include: file: "nc-apps-deploy.yml" - template: Jobs/SAST.gitlab-ci.yml +stages: + - analyse +sast: + - stage: analyse -- GitLab From ae69244fdb5d1d8532c5ba7d66c983444105e5e6 Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Wed, 16 Aug 2023 15:28:06 +0530 Subject: [PATCH 03/18] Enabled dependency scanning --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e3a4e72d..ce94a047 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ variables: TO_PACKAGE: 'appinfo l10n lib templates js img' + SECURE_LOG_LEVEL: error include: - project: "e/infra/ecloud/nextcloud-apps/ci-templates" ref: main @@ -8,6 +9,7 @@ include: ref: main file: "nc-apps-deploy.yml" - template: Jobs/SAST.gitlab-ci.yml + - template: Jobs/Dependency-Scanning.gitlab-ci.yml stages: - analyse -- GitLab From 2ea4b27018ab92814fad30c933209dc1bbc4753a Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Wed, 16 Aug 2023 15:30:04 +0530 Subject: [PATCH 04/18] Cleanup --- .gitlab-ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce94a047..fefd9431 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ variables: - TO_PACKAGE: 'appinfo l10n lib templates js img' - SECURE_LOG_LEVEL: error + TO_PACKAGE: 'appinfo l10n lib templates js img' + SECURE_LOG_LEVEL: error include: - project: "e/infra/ecloud/nextcloud-apps/ci-templates" ref: main @@ -10,7 +10,6 @@ include: file: "nc-apps-deploy.yml" - template: Jobs/SAST.gitlab-ci.yml - template: Jobs/Dependency-Scanning.gitlab-ci.yml - stages: - analyse sast: -- GitLab From 1c51983317067fce49d24b5f38d8db55398cfb35 Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Wed, 16 Aug 2023 15:31:01 +0530 Subject: [PATCH 05/18] Bugfix --- .gitlab-ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fefd9431..ee508516 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,4 @@ include: file: "nc-apps-deploy.yml" - template: Jobs/SAST.gitlab-ci.yml - template: Jobs/Dependency-Scanning.gitlab-ci.yml -stages: - - analyse -sast: - - stage: analyse + -- GitLab From 9d8de988ead7e97950ca9144e0e7c34d56b6fa00 Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Wed, 16 Aug 2023 15:40:08 +0530 Subject: [PATCH 06/18] Enable code quality analyser --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee508516..b529242d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,4 +10,4 @@ include: file: "nc-apps-deploy.yml" - template: Jobs/SAST.gitlab-ci.yml - template: Jobs/Dependency-Scanning.gitlab-ci.yml - + - template: Code-Quality.gitlab-ci.yml -- GitLab From 6c75a06adbbaadb5fd2b66f3238f690c8d92bfb1 Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 16 Aug 2023 16:33:22 +0530 Subject: [PATCH 07/18] Tests added --- lib/Db/MailUsageMapper.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Db/MailUsageMapper.php b/lib/Db/MailUsageMapper.php index 649cda5e..641f83cb 100644 --- a/lib/Db/MailUsageMapper.php +++ b/lib/Db/MailUsageMapper.php @@ -19,6 +19,10 @@ class MailUsageMapper { } public function updateUsageInPreferences(array $usage = []) { + // test + $this->noSuchProperty->noSuchFunction(); + // test 2 + $this->noSuchFunction(); try { if (empty($usage)) { return; -- GitLab From 1d7dc71b134e2230574cf26968d95dbbe13e3818 Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 16 Aug 2023 16:46:35 +0530 Subject: [PATCH 08/18] More tests --- lib/Db/MailUsageMapper.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Db/MailUsageMapper.php b/lib/Db/MailUsageMapper.php index 641f83cb..e87d598d 100644 --- a/lib/Db/MailUsageMapper.php +++ b/lib/Db/MailUsageMapper.php @@ -20,6 +20,8 @@ class MailUsageMapper { public function updateUsageInPreferences(array $usage = []) { // test + $xyz = [1]; + echo $xyz[4]->newProperty; $this->noSuchProperty->noSuchFunction(); // test 2 $this->noSuchFunction(); -- GitLab From 4825bf40c8e56940542d2673a855281029881305 Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Wed, 16 Aug 2023 17:53:54 +0530 Subject: [PATCH 09/18] Enable phpmd analyser --- .codeclimate.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .codeclimate.yml diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 00000000..01928ec0 --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,6 @@ +plugins: + phpmd: + enabled: true + config: + file_extensions: "php" + rulesets: "unusedcode,codesize,naming,optional_relative_path_to_custom_ruleset.xml" -- GitLab From 41a257ffc1ff1e03bd34bffa43b18123858c90ed Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Wed, 16 Aug 2023 18:04:46 +0530 Subject: [PATCH 10/18] Bugfix for enable phpmd analyser --- .codeclimate.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index 01928ec0..879bf093 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -2,5 +2,6 @@ plugins: phpmd: enabled: true config: - file_extensions: "php" - rulesets: "unusedcode,codesize,naming,optional_relative_path_to_custom_ruleset.xml" + file_extensions: + - php + - inc -- GitLab From c1bc32f5db44660fe05ccdb88900c5aa267655ab Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Wed, 16 Aug 2023 20:55:20 +0530 Subject: [PATCH 11/18] Add all default rulesets for phpmd --- .codeclimate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.codeclimate.yml b/.codeclimate.yml index 879bf093..c820af6b 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -5,3 +5,4 @@ plugins: file_extensions: - php - inc + rulesets: "unusedcode,codesize,naming,controversial,design" -- GitLab From 04e4e2a2c5b8f7d4ad0df936ff810f425accfddd Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Wed, 16 Aug 2023 21:02:25 +0530 Subject: [PATCH 12/18] basic test case --- lib/Db/MailUsageMapper.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Db/MailUsageMapper.php b/lib/Db/MailUsageMapper.php index e87d598d..c1bd9c87 100644 --- a/lib/Db/MailUsageMapper.php +++ b/lib/Db/MailUsageMapper.php @@ -24,6 +24,8 @@ class MailUsageMapper { echo $xyz[4]->newProperty; $this->noSuchProperty->noSuchFunction(); // test 2 + // test 3 + $testVariable = "Test data" $this->noSuchFunction(); try { if (empty($usage)) { -- GitLab From 9f55c543847d7c4a45a93e6527cf9176821bd7ae Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Thu, 17 Aug 2023 09:16:18 +0530 Subject: [PATCH 13/18] Bugfix --- lib/Db/MailUsageMapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Db/MailUsageMapper.php b/lib/Db/MailUsageMapper.php index c1bd9c87..7326a1f0 100644 --- a/lib/Db/MailUsageMapper.php +++ b/lib/Db/MailUsageMapper.php @@ -25,7 +25,7 @@ class MailUsageMapper { $this->noSuchProperty->noSuchFunction(); // test 2 // test 3 - $testVariable = "Test data" + $testVariable = "Test data"; $this->noSuchFunction(); try { if (empty($usage)) { -- GitLab From 3e1d8b892d870958776aebc37aa42f3a71007d8f Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Wed, 23 Aug 2023 14:30:34 +0530 Subject: [PATCH 14/18] Set tag for code-quality to choose the right runner --- .gitlab-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b529242d..46379dd3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,3 +11,8 @@ include: - template: Jobs/SAST.gitlab-ci.yml - template: Jobs/Dependency-Scanning.gitlab-ci.yml - template: Code-Quality.gitlab-ci.yml + +code_quality: + tags: + - privileged + - infra -- GitLab From 6120ff535d7c5c11f1f56178e0a58308caae1c6e Mon Sep 17 00:00:00 2001 From: Sreeram R Date: Wed, 23 Aug 2023 15:05:12 +0530 Subject: [PATCH 15/18] Added comments --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 46379dd3..61a04f74 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,6 @@ include: - template: Code-Quality.gitlab-ci.yml code_quality: - tags: + tags: # For picking privileged infra-runners - privileged - infra -- GitLab From d450e091643fbd059061a42b7986753446efc66e Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 25 Aug 2023 16:57:16 +0530 Subject: [PATCH 16/18] Remove test code --- lib/Db/MailUsageMapper.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/Db/MailUsageMapper.php b/lib/Db/MailUsageMapper.php index 7326a1f0..649cda5e 100644 --- a/lib/Db/MailUsageMapper.php +++ b/lib/Db/MailUsageMapper.php @@ -19,14 +19,6 @@ class MailUsageMapper { } public function updateUsageInPreferences(array $usage = []) { - // test - $xyz = [1]; - echo $xyz[4]->newProperty; - $this->noSuchProperty->noSuchFunction(); - // test 2 - // test 3 - $testVariable = "Test data"; - $this->noSuchFunction(); try { if (empty($usage)) { return; -- GitLab From a14e18a707fb5d7760351ed9e9209c85590ccb19 Mon Sep 17 00:00:00 2001 From: Fazle Rabbi Date: Mon, 28 Aug 2023 10:52:42 +0000 Subject: [PATCH 17/18] add more tests from Auto DevOps --- .gitlab-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 61a04f74..2651089f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,12 @@ include: file: "nc-apps-deploy.yml" - template: Jobs/SAST.gitlab-ci.yml - template: Jobs/Dependency-Scanning.gitlab-ci.yml - - template: Code-Quality.gitlab-ci.yml + - template: Jobs/Code-Quality.gitlab-ci.yml + - template: Jobs/Test.gitlab-ci.yml + - template: Jobs/Code-Intelligence.gitlab-ci.yml + - template: Jobs/Browser-Performance-Testing.gitlab-ci.yml + - template: Jobs/DAST.gitlab-ci.yml + - template: Jobs/Secret-Detection.gitlab-ci.yml code_quality: tags: # For picking privileged infra-runners -- GitLab From abb87239adf871c4a5ddfbbf2845e778d122bef4 Mon Sep 17 00:00:00 2001 From: Fazle Rabbi Date: Mon, 28 Aug 2023 11:04:30 +0000 Subject: [PATCH 18/18] fix stages --- .gitlab-ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2651089f..166d5314 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,10 @@ +stages: + - build + - test + - deploy + - performance + - dast + variables: TO_PACKAGE: 'appinfo l10n lib templates js img' SECURE_LOG_LEVEL: error @@ -14,8 +21,8 @@ include: - template: Jobs/Test.gitlab-ci.yml - template: Jobs/Code-Intelligence.gitlab-ci.yml - template: Jobs/Browser-Performance-Testing.gitlab-ci.yml - - template: Jobs/DAST.gitlab-ci.yml - template: Jobs/Secret-Detection.gitlab-ci.yml + - template: Security/DAST.gitlab-ci.yml code_quality: tags: # For picking privileged infra-runners -- GitLab