From 085696497335131cdc3343491ebb9868acf7a268 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 2 Sep 2018 18:58:09 +0900 Subject: [PATCH 01/26] =?UTF-8?q?=E3=83=91=E3=83=BC=E3=83=9F=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E5=A4=89=E6=9B=B4=E3=80=82=E5=AE=9F?= =?UTF-8?q?=E8=A1=8C=E6=A8=A9=E3=82=92=E5=A4=96=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/AnnouncementBlockRolePermissionsController.php | 0 Model/Announcement.php | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 Controller/AnnouncementBlockRolePermissionsController.php mode change 100755 => 100644 Model/Announcement.php diff --git a/Controller/AnnouncementBlockRolePermissionsController.php b/Controller/AnnouncementBlockRolePermissionsController.php old mode 100755 new mode 100644 diff --git a/Model/Announcement.php b/Model/Announcement.php old mode 100755 new mode 100644 From fa7fd6b8ef53fe63ba97e397559944c68e27db1a Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 2 Sep 2018 23:01:59 +0900 Subject: [PATCH 02/26] =?UTF-8?q?=E3=83=91=E3=83=BC=E3=83=9F=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E5=A4=89=E6=9B=B4=E3=80=82=E5=AE=9F?= =?UTF-8?q?=E8=A1=8C=E6=A8=A9=E3=82=92=E5=A4=96=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/AnnouncementBlockRolePermissionsController.php | 0 Model/Announcement.php | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 Controller/AnnouncementBlockRolePermissionsController.php mode change 100755 => 100644 Model/Announcement.php diff --git a/Controller/AnnouncementBlockRolePermissionsController.php b/Controller/AnnouncementBlockRolePermissionsController.php old mode 100755 new mode 100644 diff --git a/Model/Announcement.php b/Model/Announcement.php old mode 100755 new mode 100644 From a105ec9c20124fce58412332a8311e80f617b255 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 23 Jan 2019 18:03:43 +0900 Subject: [PATCH 03/26] =?UTF-8?q?=E3=82=BF=E3=82=B0=E3=81=8C=E5=85=A5?= =?UTF-8?q?=E3=82=8C=E5=AD=90=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=A6=E3=80=81Token=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C?= =?UTF-8?q?=E5=87=BA=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=AA=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=80=82=20https://github.com/NetCommons3/NetCommons3?= =?UTF-8?q?/issues/1438?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Announcements/edit.ctp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/View/Announcements/edit.ctp b/View/Announcements/edit.ctp index fd5aea0..ffb7242 100644 --- a/View/Announcements/edit.ctp +++ b/View/Announcements/edit.ctp @@ -20,8 +20,8 @@ $announcement = NetCommonsAppController::camelizeKeyRecursive(array('announcemen ng-init="initialize()">
-
- NetCommonsForm->create('Announcement'); ?> + NetCommonsForm->create('Announcement'); ?> +
element('Announcements/edit_form'); ?>
From 798c6347c029b7c4f5a098561d9f8fb9798c005f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 25 May 2019 17:28:01 +0900 Subject: [PATCH 04/26] =?UTF-8?q?article=E3=82=BF=E3=82=B0=E3=81=8C?= =?UTF-8?q?=E4=B8=8D=E8=B6=B3=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=81=9F?= =?UTF-8?q?=E3=82=81=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Announcements/view.ctp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/View/Announcements/view.ctp b/View/Announcements/view.ctp index 78cb998..d601c8e 100644 --- a/View/Announcements/view.ctp +++ b/View/Announcements/view.ctp @@ -23,7 +23,9 @@ - +
+ +
From bb3b7b7ba73b698da50759c813918629943fd92c Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 3 Aug 2019 19:17:51 +0900 Subject: [PATCH 05/26] =?UTF-8?q?fix:=20test:=20UniteTest=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?468?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Case/Controller/AnnouncementBlocksController/EditTest.php | 4 ++-- Test/Case/Model/Announcement/GetAnnouncementTest.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Test/Case/Controller/AnnouncementBlocksController/EditTest.php b/Test/Case/Controller/AnnouncementBlocksController/EditTest.php index af885d5..dddc544 100644 --- a/Test/Case/Controller/AnnouncementBlocksController/EditTest.php +++ b/Test/Case/Controller/AnnouncementBlocksController/EditTest.php @@ -47,7 +47,7 @@ private function __getData($isEdit) { $frameId = '6'; if ($isEdit) { - $blockId = '4'; + $blockId = '2'; $blockKey = 'block_3'; $anouncementId = '4'; $anouncementKey = 'announcement_3'; @@ -154,7 +154,7 @@ public function dataProviderEdit() { * @return void */ public function dataProviderDelete() { - $blockId = '4'; + $blockId = '2'; $data = array( 'Block' => array( diff --git a/Test/Case/Model/Announcement/GetAnnouncementTest.php b/Test/Case/Model/Announcement/GetAnnouncementTest.php index 9703d02..b01f6b5 100644 --- a/Test/Case/Model/Announcement/GetAnnouncementTest.php +++ b/Test/Case/Model/Announcement/GetAnnouncementTest.php @@ -60,7 +60,7 @@ class AnnouncementGetAnnouncementTest extends WorkflowGetTest { */ public function testGetAnnouncementWOContentEditable() { //事前データセット - Current::$current['Permission']['content_editable']['value'] = false; + Current::writePermission('2', 'content_editable', false); $announcementId = '1'; //期待値 @@ -82,6 +82,7 @@ public function testGetAnnouncementWOContentEditable() { */ public function testGetAnnouncementContentEditable() { //事前データセット + Current::writePermission('2', 'content_editable', true); $announcementId = '2'; //期待値 From 788deca85bbab2cb89f4e4d0e7a11537087035a6 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 3 Aug 2019 19:34:26 +0900 Subject: [PATCH 06/26] =?UTF-8?q?fix:=20test:=20TravisCI=E3=81=A7=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=AA=E3=82=8B=E3=81=9F=E3=82=81?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/NetCommons3?= =?UTF-8?q?/issues/1468?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index acfb2de..c6e0797 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ php: - 7.1 sudo: false +dist: trusty env: matrix: From 58fa2b6073e9ec50458425f27d422f986df0b902 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 3 Aug 2019 21:51:49 +0900 Subject: [PATCH 07/26] =?UTF-8?q?add:=20test:=20travis=20php7.2=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c6e0797..c38462d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ php: - 5.6 - 7.0 - 7.1 + - 7.2 sudo: false dist: trusty From 53b99eb75b30e041749f843a78998ea777397847 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 7 Aug 2019 00:19:46 +0900 Subject: [PATCH 08/26] =?UTF-8?q?fix:=20test:=20travis=20php7.2=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?451?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpunit.xml.dist | 1 - 1 file changed, 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d912366..a64b80e 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,6 +14,5 @@ - From bd0da204dc8af37f96a1f65002c4d8bf51513653 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 8 Mar 2020 23:21:25 +0900 Subject: [PATCH 09/26] =?UTF-8?q?change:=20test:=20travis.yml=E3=81=8B?= =?UTF-8?q?=E3=82=89php5.4,5.5=E3=82=92=E5=89=8A=E9=99=A4=E3=80=82php7.3,7?= =?UTF-8?q?.4=E3=82=92=E8=BF=BD=E5=8A=A0=20https://github.com/NetCommons3/?= =?UTF-8?q?NetCommons3/issues/1560?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c38462d..1154164 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ language: php php: - - 5.4 - - 5.5 - 5.6 - 7.0 - 7.1 - 7.2 + - 7.3 + - 7.4 sudo: false dist: trusty From bfdd5a5998b4400e39f26b80891a439a7718031f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 31 Jul 2020 21:48:46 +0900 Subject: [PATCH 10/26] =?UTF-8?q?change:=20test:=20Travis=E3=81=8B?= =?UTF-8?q?=E3=82=89PHP5.6=E3=82=92=E5=89=8A=E9=99=A4,php72=E4=BB=A5?= =?UTF-8?q?=E9=99=8D=E3=81=A7UnitTest=E3=81=A7Warning=E3=81=8C=E5=87=BA?= =?UTF-8?q?=E3=82=8B=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.?= =?UTF-8?q?com/NetCommons3/NetCommons3/issues/1588?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 - phpunit.xml.dist | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1154164..6f80cc8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 5.6 - 7.0 - 7.1 - 7.2 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a64b80e..c8c653f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,11 @@ + + + + + + app/Plugin/Announcements From 7cca98beb3cf36a26b99fb6a16a4a8a4ee34eaa6 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 26 Aug 2020 20:14:49 +0900 Subject: [PATCH 11/26] change: Version number to 3.3.2 --- VERSION.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 VERSION.txt diff --git a/VERSION.txt b/VERSION.txt new file mode 100644 index 0000000..4772543 --- /dev/null +++ b/VERSION.txt @@ -0,0 +1 @@ +3.3.2 From 16f155a312d828ae2f39fbdb58466c6611b91b16 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 13 Dec 2020 15:33:21 +0900 Subject: [PATCH 12/26] =?UTF-8?q?fix:=20test:=20TravisCI=E3=81=AEphp7.3?= =?UTF-8?q?=E3=81=A7=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C=E5=87=BA=E3=82=8B?= =?UTF-8?q?=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.com/NetCo?= =?UTF-8?q?mmons3/NetCommons3/issues/1618?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6f80cc8..2c2000b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ php: - 7.0 - 7.1 - 7.2 - - 7.3 + - 7.3.24 - 7.4 sudo: false From 559f2d9c16ebc56ad5bcaf6fb37ea9c9037502c5 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 13:49:59 +0900 Subject: [PATCH 13/26] =?UTF-8?q?add:=20release=E3=82=BF=E3=82=B0=E4=BB=98?= =?UTF-8?q?=E3=81=91=E3=81=AEgithub=20action=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1619 --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a3225bc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - '3*' + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + NetCommons ${{ github.ref }} released. + draft: false + prerelease: false From 820a9c856204e14378eb2a3a908799dd4175d417 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 13:50:05 +0900 Subject: [PATCH 14/26] change: Version number to 3.3.3 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 4772543..619b537 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.2 +3.3.3 From 462fea78df67d0ecf48608ac1b71509d730d2e78 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 1 Jun 2021 09:40:45 +0900 Subject: [PATCH 15/26] =?UTF-8?q?fix:=20=E3=81=8A=E7=9F=A5=E3=82=89?= =?UTF-8?q?=E3=81=9B=E3=81=AE=E7=B7=A8=E9=9B=86=E7=94=BB=E9=9D=A2=E9=81=B7?= =?UTF-8?q?=E7=A7=BB=E6=99=82=E3=81=AEURL=E4=B8=8D=E6=AD=A3=E3=81=AE?= =?UTF-8?q?=E3=81=A8=E3=81=8D=E3=80=81Bad=20Request=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3(?= =?UTF-8?q?=E3=83=91=E3=83=96=E3=83=AA=E3=83=83=E3=82=AF=E3=81=AB=E7=B7=A8?= =?UTF-8?q?=E9=9B=86=E6=A8=A9=E9=99=90=E3=81=8C=E3=81=82=E3=82=8B=E6=99=82?= =?UTF-8?q?=E3=81=AE=E3=81=BF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/AnnouncementsController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Controller/AnnouncementsController.php b/Controller/AnnouncementsController.php index 052e62e..efedc09 100644 --- a/Controller/AnnouncementsController.php +++ b/Controller/AnnouncementsController.php @@ -78,6 +78,14 @@ public function view() { * @return void */ public function edit() { + //お知らせは、新規登録と編集が同じアクションであるため、block_idにあたる部分に + //不正な文字を入力しても、無視されてしまうため、チェック処理を別途追加。 + if (empty($this->params['block_id']) && + !empty($this->params['pass'][0]) && + !is_numeric($this->params['pass'][0])) { + return $this->throwBadRequest(); + } + if ($this->request->is('post') || $this->request->is('put')) { $data = $this->data; $data['Announcement']['status'] = $this->Workflow->parseStatus(); From 2a40eea8576942831cf0c31ebe6c3b75d99dca8d Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 30 Jul 2021 14:27:42 +0900 Subject: [PATCH 16/26] =?UTF-8?q?change:=20test:=20TravisCI=E3=81=8B?= =?UTF-8?q?=E3=82=89GithubAction=E3=81=AB=E5=A4=89=E6=9B=B4=20https://gith?= =?UTF-8?q?ub.com/NetCommons3/NetCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 137 ++++++++++++++++++++++++++++++++++++ .travis.yml | 42 ----------- README.md | 11 +-- phpunit.xml.dist | 4 +- 4 files changed, 141 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d6bd01e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,137 @@ +on: + push: + branches: + - main + - master + - availability + pull_request: + branches: + - main + - master + - availability + +name: tests + +jobs: + tests: + name: tests + runs-on: ubuntu-18.04 + strategy: + matrix: + php: [ '7.1', '7.2', '7.3', '7.4' ] + + env: + NC3_BUILD_DIR: "/opt/nc3" + NC3_DOCKER_DIR: "/opt/docker" + NC3_GIT_URL: "git://github.com/NetCommons3/NetCommons3.git" + NC3_GIT_BRANCH: "master" + PLUGIN_BUILD_DIR: ${{ github.workspace }} + PHP_VERSION: ${{ matrix.php }} + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: cakephp_test + + steps: + - uses: actions/checkout@v2 + + - name: environment + run: | + echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" + echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" + echo "PHP_VERSION=${PHP_VERSION}" + ls -al ${PLUGIN_BUILD_DIR} + + - name: docker-compose install + run: | + curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + chmod +x ~/docker-compose + sudo mv ~/docker-compose /usr/local/bin/docker-compose + docker-compose --version + + - name: git clone nc3 + run: git clone -b ${NC3_GIT_BRANCH} ${NC3_GIT_URL} ${NC3_BUILD_DIR} + + - name: git clone nc3_docker + run: git clone https://github.com/NetCommons3/nc3app-docker.git ${NC3_DOCKER_DIR} + + - name: docker-compose start + run: | + cd ${NC3_DOCKER_DIR} + docker-compose up -d + docker-compose start + + - run: docker ps + + - name: check libraries + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/start-on-docker.sh + + - name: nc3 build + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/app-build.sh + + - name: phpcs (PHP CodeSniffer) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh + + - name: phpmd (PHP Mess Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh + + - name: phpcpd (PHP Copy/Paste Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh + + - name: gjslint (JavaScript Style Check) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh + + - name: phpdoc (PHP Documentor) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh + + - name: phpunit (PHP UnitTest) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh + sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build + + - name: push coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.php }} + run: | + cd ${NC3_BUILD_DIR} + ls -la ${NC3_BUILD_DIR} + vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v + + - name: docker-compose remove + run: | + cd ${NC3_DOCKER_DIR} + docker-compose rm -f + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: good + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: danger diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2c2000b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - - 7.3.24 - - 7.4 - -sudo: false -dist: trusty - -env: - matrix: - - NETCOMMONS_VERSION=master DB=mysql - global: - - secure: "TTEVvTjbwUpxFv+KI5ABe5kR25AzbktixeBYmeJ+xZn99fpW2GZ4slLwVmAL6+/qnXez06tKJalSbU5D4Z+s12c0WEbo2vLgviYrhe4/iW0Pzry3CCTrWVXE/F5KlzSH3BWIt1hIG3Qkjk4K0FqfmXDlvt4Tg4Jmq5oUhpHf5gI=" - - GIT_COMMITTER_NAME=s-nakajima - - GIT_COMMITTER_EMAIL=nakajimashouhei@gmail.com - - GIT_AUTHOR_NAME=s-nakajima - - GIT_AUTHOR_EMAIL=nakajimashouhei@gmail.com - -before_script: - - export NETCOMMONS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/NetCommons3 - - git clone git://github.com/NetCommons3/NetCommons3 $NETCOMMONS_BUILD_DIR - - cd $NETCOMMONS_BUILD_DIR - - git checkout $NETCOMMONS_VERSION - - travis_wait . tools/build/plugins/cakephp/travis/pre.sh - - . tools/build/plugins/cakephp/travis/environment.sh - -script: - - . tools/build/plugins/cakephp/travis/main.sh - -after_script: - - . tools/build/plugins/cakephp/travis/post.sh - -notifications: - email: - recipients: - - netcommons3@googlegroups.com - on_success: never # default: change - on_failure: always # default: always diff --git a/README.md b/README.md index 255e566..d82123a 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,6 @@ Announcements ============== -Announcements for NetComomns3 - -[![Build Status](https://api.travis-ci.org/NetCommons3/Announcements.png?branch=master)](https://travis-ci.org/NetCommons3/Announcements) -[![Coverage Status](https://coveralls.io/repos/NetCommons3/Announcements/badge.png?branch=master)](https://coveralls.io/r/NetCommons3/Announcements?branch=master) - -| dependencies | status | -| ------------- | ------ | -| composer.json | [![Dependency Status](https://www.versioneye.com/user/projects/544a13d2c310f93677000088/badge.png)](https://www.versioneye.com/user/projects/544a13d2c310f93677000088) | +[![Tests Status](https://github.com/NetCommons3/Announcements/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/NetCommons3/Announcements/actions/workflows/tests.yml) +[![Coverage Status](https://coveralls.io/repos/NetCommons3/Announcements/badge.svg?branch=master)](https://coveralls.io/r/NetCommons3/Announcements?branch=master) +[![Stable Version](https://img.shields.io/packagist/v/netcommons/announcements.svg?label=stable)](https://packagist.org/packages/netcommons/announcements) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c8c653f..5e9949f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,9 +3,6 @@ - - - app/Plugin/Announcements @@ -20,5 +17,6 @@ + From bd8577a1e8758d47604bf3190a00e64878e4905f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 30 Jul 2021 15:33:42 +0900 Subject: [PATCH 17/26] =?UTF-8?q?change:=20test:=20phpunit.xml=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5e9949f..6f4c749 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -17,6 +17,6 @@ - + From 08bcd4a284c0974e6a0f246fad4ae7320b3c97da Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 10 Aug 2021 22:01:51 +0900 Subject: [PATCH 18/26] =?UTF-8?q?change:=20test:=20Slack=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3,=20mysql8.0=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20https://github.com/NetCommons3/NetCommons3?= =?UTF-8?q?/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++-- .github/workflows/tests.yml | 47 +++++++++++++++++++++++++---------- 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3225bc..592d72f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,16 +4,25 @@ on: tags: - '3*' -name: Create Release +name: create_release jobs: build: - name: Create Release + name: create_release runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + SLACK_MESSAGE: "Start Job" + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -26,3 +35,25 @@ jobs: NetCommons ${{ github.ref }} released. draft: false prerelease: false + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Finish + uses: rtCamp/action-slack-notify@v2.2.0 + if: success() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good + SLACK_MESSAGE: "Job Success" + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: danger + SLACK_MESSAGE: "Job Failure" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d6bd01e..1477ea2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,12 +13,26 @@ on: name: tests jobs: + setup: + name: setup + runs-on: ubuntu-18.04 + steps: + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + tests: name: tests + needs: setup runs-on: ubuntu-18.04 strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] + mysql: [ '5.7', '8.0' ] env: NC3_BUILD_DIR: "/opt/nc3" @@ -27,6 +41,7 @@ jobs: NC3_GIT_BRANCH: "master" PLUGIN_BUILD_DIR: ${{ github.workspace }} PHP_VERSION: ${{ matrix.php }} + MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test @@ -38,6 +53,7 @@ jobs: echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" echo "PHP_VERSION=${PHP_VERSION}" + echo "MYSQL_VERSION=${MYSQL_VERSION}" ls -al ${PLUGIN_BUILD_DIR} - name: docker-compose install @@ -116,22 +132,27 @@ jobs: cd ${NC3_DOCKER_DIR} docker-compose rm -f - # テスト成功時はこちらのステップが実行される - - name: Slack Notification on Success - if: success() - uses: rtCamp/action-slack-notify@v2.2.0 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" - SLACK_COLOR: good - # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 if: failure() env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}(php${{ matrix.php }}, mysql${{ matrix.mysql }})" SLACK_COLOR: danger + + teardown: + name: teardown + runs-on: ubuntu-18.04 + needs: tests + steps: + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good From 0e4bbf46958747d76250faf5b21363a2a7452966 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 13 Aug 2021 14:14:06 +0900 Subject: [PATCH 19/26] change: Version number to 3.3.4 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 619b537..a0891f5 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.3 +3.3.4 From 8d7fafbabe38bed9a1d981b4fa69552a7d2e9132 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 11 Feb 2022 17:46:00 +0900 Subject: [PATCH 20/26] change: Version number to 3.3.5 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index a0891f5..fa7adc7 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.4 +3.3.5 From 5890e881f97b8f582dd0c2a304de9e2a3f9154ae Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Wed, 18 Jan 2023 11:09:41 +0900 Subject: [PATCH 21/26] =?UTF-8?q?fix:=20=E6=96=B0=E8=A6=8F=E3=81=AE?= =?UTF-8?q?=E3=81=8A=E7=9F=A5=E3=82=89=E3=81=9B=E3=82=92=E7=99=BB=E9=8C=B2?= =?UTF-8?q?=E3=81=97=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AE=E6=96=B0=E7=9D=80?= =?UTF-8?q?=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=ABframe=5Fid?= =?UTF-8?q?=E3=81=8C=E5=85=A5=E3=82=89=E3=81=9A=E3=80=81=E6=96=B0=E7=9D=80?= =?UTF-8?q?=E3=81=8B=E3=82=89=E9=81=B7=E7=A7=BB=E3=81=97=E3=81=A6=E7=B7=A8?= =?UTF-8?q?=E9=9B=86=E3=81=97=E3=82=88=E3=81=86=E3=81=A8=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=A8=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=AA=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=82=92=E6=96=B0=E8=A6=8F=E3=81=8A=E7=9F=A5=E3=82=89?= =?UTF-8?q?=E3=81=9B=E7=99=BB=E9=8C=B2=E6=99=82=E3=81=AB=E6=96=B0=E7=9D=80?= =?UTF-8?q?=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=ABframe=5Fid?= =?UTF-8?q?=E3=81=8C=E5=85=A5=E3=82=8B=E6=A7=98=E3=81=AB=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Announcement.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Model/Announcement.php b/Model/Announcement.php index 0f72080..ecf9cbc 100644 --- a/Model/Announcement.php +++ b/Model/Announcement.php @@ -130,6 +130,12 @@ public function beforeValidate($options = array()) { * @see Model::save() */ public function beforeSave($options = array()) { + // 新規登録時でCurrent Frame.block_idがnullならCurrent Frame.block_idをセットする + // ここでFrame.block_idをセットしておかないと新着プラグインにFrame.idが登録されない。 + // @see app/Plugin/Topics/Model/Behavior/TopicsBaseBehavior.php:109 + if (Current::read('Frame.block_id') === null) { + Current::write('Frame.block_id', Current::read('Block.id')); + } $this->loadModels([ 'AnnouncementSetting' => 'Announcements.AnnouncementSetting', ]); From 532f8c3b4eb80b33b291e89914aaf3bce32dcdc9 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Thu, 19 Jan 2023 08:35:32 +0900 Subject: [PATCH 22/26] =?UTF-8?q?fix:=20test:=20tests.yml=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1477ea2..9501566 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,6 +48,9 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Fix up git URLs + run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - name: environment run: | echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" @@ -58,7 +61,7 @@ jobs: - name: docker-compose install run: | - curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose chmod +x ~/docker-compose sudo mv ~/docker-compose /usr/local/bin/docker-compose docker-compose --version From f8f142f9fd0d28ea3c0402e07c7ec2ecd0a88011 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 13:21:16 +0900 Subject: [PATCH 23/26] =?UTF-8?q?test:=20Github=20Action=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9501566..7cfa881 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,6 +44,7 @@ jobs: MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 From 8fee26bca1b8643d90360a2139f4df4a28800a66 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 25 Feb 2023 20:31:54 +0900 Subject: [PATCH 24/26] change: Version number to 3.3.6 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index fa7adc7..9c25013 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.5 +3.3.6 From 17cb1f39de6914956b4a5ad46e0001121a1d6da3 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 5 Oct 2023 16:04:22 +0900 Subject: [PATCH 25/26] =?UTF-8?q?test:=20github=20action=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7cfa881..eb2068b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,10 +15,11 @@ name: tests jobs: setup: name: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - name: Slack Notification on Start uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -28,7 +29,7 @@ jobs: tests: name: tests needs: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] @@ -92,46 +93,53 @@ jobs: docker-compose exec -T nc3app bash /opt/scripts/app-build.sh - name: phpcs (PHP CodeSniffer) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh - name: phpmd (PHP Mess Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh - name: phpcpd (PHP Copy/Paste Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh - name: gjslint (JavaScript Style Check) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh - name: phpdoc (PHP Documentor) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh - name: phpunit (PHP UnitTest) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build - - name: push coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: ${{ matrix.php }} - run: | - cd ${NC3_BUILD_DIR} - ls -la ${NC3_BUILD_DIR} - vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v +# - name: push coveralls +# env: +# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# COVERALLS_FLAG_NAME: ${{ matrix.php }} +# run: | +# cd ${NC3_BUILD_DIR} +# ls -la ${NC3_BUILD_DIR} +# vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v - name: docker-compose remove + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose rm -f @@ -139,7 +147,7 @@ jobs: # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 - if: failure() + if: env.SLACK_WEBHOOK != '' && failure() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -148,13 +156,13 @@ jobs: teardown: name: teardown - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest needs: tests steps: # テスト成功時はこちらのステップが実行される - name: Slack Notification on Success - if: success() uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' && success() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests From e2704334a7314be0f4ed37e04b0ea835dc3d4137 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Oct 2023 14:48:30 +0900 Subject: [PATCH 26/26] change: Version number to 3.3.7 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 9c25013..86fb650 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.6 +3.3.7