From 036c42cb10ee72a5fc71161aa5108677b021833f Mon Sep 17 00:00:00 2001 From: kamleshluhana Date: Tue, 8 Aug 2023 11:26:01 +0530 Subject: [PATCH 1/6] Apply Coding standard baseline github action --- .../workflows/coding-standard-baseline.yml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/coding-standard-baseline.yml diff --git a/.github/workflows/coding-standard-baseline.yml b/.github/workflows/coding-standard-baseline.yml new file mode 100644 index 000000000000..c3de61c37110 --- /dev/null +++ b/.github/workflows/coding-standard-baseline.yml @@ -0,0 +1,67 @@ +name: M2 Coding Testing + +on: + push: + branches: [ 2.4-develop, develop, phpcs_baseline ] + pull_request: + branches: [ 2.4-develop, develop, phpcs_baseline ] + workflow_call: + inputs: + php_version: + type: string + required: true + default: "8.1" + description: "PHP version used to do the coding standard check." + + composer_version: + type: string + required: true + default: "2" + description: "The version of composer to use." + + path: + type: string + required: true + default: 'app/code' + description: "The directory (relative to the project root) in which the coding standard will be checked. Used when the event is not a pull request." + + version: + type: string + required: false + description: "The version of the coding standard to use. If not provided, will use the latest version." + + severity: + type: string + required: false + default: "8" + description: "The minimum severity required to display an error or warning (default: 5)" + + warning_severity: + type: string + required: false + default: "8" + description: "The minimum severity required to display a warning" + + error_severity: + type: string + required: false + default: "8" + description: "The minimum severity required to display an error" + +permissions: + contents: read + +jobs: + coding-standard: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: mage-os/github-actions/coding-standard-baseline@main + with: + php_version: "8.1" # Optional, will be used for Php version + composer_version: "2" + version: "31" # Optional, will use the latest if omitted. + severity: "8" # Optional, will use phpcs default of 5 if not specified. + warning_severity: "4" # Optional, will use warning severity value if not specified. + error_severity: "7" # Optional, will use error severity value if not specified. + baseline_version: "1.1.2" # Optional, will use for php codesniffer baseline version From b9f9a04de5ca3e19f489be3b4a537dc496402a37 Mon Sep 17 00:00:00 2001 From: kamleshluhana Date: Tue, 8 Aug 2023 11:33:04 +0530 Subject: [PATCH 2/6] Apply Coding standard baseline github action --- .github/workflows/coding-standard-baseline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coding-standard-baseline.yml b/.github/workflows/coding-standard-baseline.yml index c3de61c37110..c513ae257369 100644 --- a/.github/workflows/coding-standard-baseline.yml +++ b/.github/workflows/coding-standard-baseline.yml @@ -2,9 +2,9 @@ name: M2 Coding Testing on: push: - branches: [ 2.4-develop, develop, phpcs_baseline ] + branches: [ 2.4-develop, develop, codingstandard_baseline_integration ] pull_request: - branches: [ 2.4-develop, develop, phpcs_baseline ] + branches: [ 2.4-develop, develop, codingstandard_baseline_integration ] workflow_call: inputs: php_version: From 02a34e2cc05c1ff9511dd61135946c834b97fd1d Mon Sep 17 00:00:00 2001 From: kamleshluhana Date: Tue, 8 Aug 2023 14:00:50 +0530 Subject: [PATCH 3/6] Fix php baseline issues --- .github/workflows/coding-standard-baseline.yml | 17 +++++------------ .../Magento/Backup/Block/Adminhtml/Backup.php | 1 + 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/coding-standard-baseline.yml b/.github/workflows/coding-standard-baseline.yml index c513ae257369..90dc1aeca001 100644 --- a/.github/workflows/coding-standard-baseline.yml +++ b/.github/workflows/coding-standard-baseline.yml @@ -1,10 +1,10 @@ -name: M2 Coding Testing +name: Coding Standard With Baseline on: push: branches: [ 2.4-develop, develop, codingstandard_baseline_integration ] pull_request: - branches: [ 2.4-develop, develop, codingstandard_baseline_integration ] + branches: [ 2.4-develop, develop] workflow_call: inputs: php_version: @@ -55,13 +55,6 @@ jobs: coding-standard: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: mage-os/github-actions/coding-standard-baseline@main - with: - php_version: "8.1" # Optional, will be used for Php version - composer_version: "2" - version: "31" # Optional, will use the latest if omitted. - severity: "8" # Optional, will use phpcs default of 5 if not specified. - warning_severity: "4" # Optional, will use warning severity value if not specified. - error_severity: "7" # Optional, will use error severity value if not specified. - baseline_version: "1.1.2" # Optional, will use for php codesniffer baseline version + - name: Run Coding Standard + uses: mage-os/github-actions/coding-standard-baseline@main + diff --git a/app/code/Magento/Backup/Block/Adminhtml/Backup.php b/app/code/Magento/Backup/Block/Adminhtml/Backup.php index 2a4100805577..a950e8653bbb 100644 --- a/app/code/Magento/Backup/Block/Adminhtml/Backup.php +++ b/app/code/Magento/Backup/Block/Adminhtml/Backup.php @@ -29,6 +29,7 @@ class Backup extends \Magento\Backend\Block\Template protected function _prepareLayout() { parent::_prepareLayout(); + echo "1"; $this->getToolbar()->addChild( 'createSnapshotButton', From a3564f42ca5df96f613d4ab387a712228ffec0fb Mon Sep 17 00:00:00 2001 From: kamleshluhana Date: Tue, 8 Aug 2023 14:07:34 +0530 Subject: [PATCH 4/6] Fix php baseline issues --- .../workflows/coding-standard-baseline.yml | 52 ++----------------- .../Magento/Backup/Block/Adminhtml/Backup.php | 1 + 2 files changed, 4 insertions(+), 49 deletions(-) diff --git a/.github/workflows/coding-standard-baseline.yml b/.github/workflows/coding-standard-baseline.yml index 90dc1aeca001..cc7d9cfc61fe 100644 --- a/.github/workflows/coding-standard-baseline.yml +++ b/.github/workflows/coding-standard-baseline.yml @@ -1,60 +1,14 @@ name: Coding Standard With Baseline - on: - push: - branches: [ 2.4-develop, develop, codingstandard_baseline_integration ] pull_request: - branches: [ 2.4-develop, develop] - workflow_call: - inputs: - php_version: - type: string - required: true - default: "8.1" - description: "PHP version used to do the coding standard check." - - composer_version: - type: string - required: true - default: "2" - description: "The version of composer to use." - - path: - type: string - required: true - default: 'app/code' - description: "The directory (relative to the project root) in which the coding standard will be checked. Used when the event is not a pull request." - - version: - type: string - required: false - description: "The version of the coding standard to use. If not provided, will use the latest version." - - severity: - type: string - required: false - default: "8" - description: "The minimum severity required to display an error or warning (default: 5)" - - warning_severity: - type: string - required: false - default: "8" - description: "The minimum severity required to display a warning" - - error_severity: - type: string - required: false - default: "8" - description: "The minimum severity required to display an error" - + branches: + - 2.4-develop permissions: contents: read - jobs: coding-standard: runs-on: ubuntu-latest steps: - - name: Run Coding Standard + - name: Run Coding Standard Baseline uses: mage-os/github-actions/coding-standard-baseline@main diff --git a/app/code/Magento/Backup/Block/Adminhtml/Backup.php b/app/code/Magento/Backup/Block/Adminhtml/Backup.php index a950e8653bbb..c97395ad88c5 100644 --- a/app/code/Magento/Backup/Block/Adminhtml/Backup.php +++ b/app/code/Magento/Backup/Block/Adminhtml/Backup.php @@ -30,6 +30,7 @@ protected function _prepareLayout() { parent::_prepareLayout(); echo "1"; + echo "22"; $this->getToolbar()->addChild( 'createSnapshotButton', From e8eff1c59afc32f4e2edb4cb9829efed7214f7b4 Mon Sep 17 00:00:00 2001 From: kamleshluhana Date: Tue, 8 Aug 2023 14:14:01 +0530 Subject: [PATCH 5/6] revert backup file to original one --- app/code/Magento/Backup/Block/Adminhtml/Backup.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Backup/Block/Adminhtml/Backup.php b/app/code/Magento/Backup/Block/Adminhtml/Backup.php index c97395ad88c5..2a4100805577 100644 --- a/app/code/Magento/Backup/Block/Adminhtml/Backup.php +++ b/app/code/Magento/Backup/Block/Adminhtml/Backup.php @@ -29,8 +29,6 @@ class Backup extends \Magento\Backend\Block\Template protected function _prepareLayout() { parent::_prepareLayout(); - echo "1"; - echo "22"; $this->getToolbar()->addChild( 'createSnapshotButton', From 894356d6a7c27e1fd6ab02f97ea75799e0f2f9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tjitse=20Efd=C3=A9?= Date: Mon, 18 Sep 2023 10:54:20 +0200 Subject: [PATCH 6/6] ci: remove phpcs coding standard workflow --- .github/workflows/coding-standard.yml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .github/workflows/coding-standard.yml diff --git a/.github/workflows/coding-standard.yml b/.github/workflows/coding-standard.yml deleted file mode 100644 index 03a87ff180d0..000000000000 --- a/.github/workflows/coding-standard.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Coding Standard - -on: - pull_request: - branches: - - 2.4-develop - -permissions: - contents: read - -jobs: - coding-standard: - runs-on: ubuntu-latest - steps: - - name: Run Coding Standard - uses: mage-os/github-actions/coding-standard@main