From 22db9af416a471904e913f8a7c424830180874b4 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 17:33:14 +0900 Subject: [PATCH 1/7] =?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 bf48db5af97541d2f19b4c3a90a36c732e8f7e55 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 26 Feb 2023 07:58:46 +0900 Subject: [PATCH 2/7] 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 90949f4338572b17e4b91a3a592667e5f8da6614 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 2 Jun 2023 10:27:32 +0900 Subject: [PATCH 3/7] =?UTF-8?q?fix:=20WYSIWYG=E3=81=AE=E3=83=80=E3=82=A6?= =?UTF-8?q?=E3=83=B3=E3=83=AD=E3=83=BC=E3=83=89=E5=87=A6=E7=90=86=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/UsersAvatarController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/UsersAvatarController.php b/Controller/UsersAvatarController.php index 10fb3e3..2cd8efd 100644 --- a/Controller/UsersAvatarController.php +++ b/Controller/UsersAvatarController.php @@ -76,7 +76,7 @@ public function download() { ]; if ($user['User']['id'] === AuthComponent::user('id')) { - return $this->Download->doDownloadByUploadFileId($user['UploadFile']['id'], $options); + return $this->Download->doDownloadByUploadFileId($user['UploadFile']['id'], $options, 'users'); } $UserAttributeSetting = $this->_getSimpleModel('UserAttributeSetting'); @@ -104,7 +104,7 @@ public function download() { return $this->_downloadNoImage($User, $user); } - return $this->Download->doDownloadByUploadFileId($user['UploadFile']['id'], $options); + return $this->Download->doDownloadByUploadFileId($user['UploadFile']['id'], $options, 'users'); } /** From 74357823435072450f15c73b7b3990981603f4a8 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 2 Jun 2023 10:28:05 +0900 Subject: [PATCH 4/7] =?UTF-8?q?test:=20GithubAction=E3=81=AE=E3=82=A8?= =?UTF-8?q?=E3=83=A9=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 | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7cfa881..bfe7e70 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ 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 @@ -28,7 +28,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 +92,54 @@ 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 +# if: success() +# 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 @@ -148,7 +156,7 @@ jobs: teardown: name: teardown - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest needs: tests steps: # テスト成功時はこちらのステップが実行される From 94e9eec3608fb936830eff2aab4e1510a5ea0bf8 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 20 Jun 2023 09:36:19 +0900 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20avatar=E8=A1=A8=E7=A4=BA=E3=81=AE?= =?UTF-8?q?=E4=B8=8D=E5=85=B7=E5=90=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config/routes.php | 20 ++++++++++---------- Controller/UsersController.php | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Config/routes.php b/Config/routes.php index 79b7c06..d77a9fa 100644 --- a/Config/routes.php +++ b/Config/routes.php @@ -19,16 +19,16 @@ ['user_id' => '[0-9]+', 'field_name' => 'avatar', 'size' => 'medium'] ); -Router::connect( - '/users/users/download/:user_id/:field_name/:size', - ['plugin' => 'users', 'controller' => 'users', 'action' => 'download'], - ['user_id' => '[0-9]+', 'size' => 'big|medium|small|thumb'] -); -Router::connect( - '/users/users/download/:user_id/:field_name', - ['plugin' => 'users', 'controller' => 'users', 'action' => 'download', 'size' => 'medium'], - ['user_id' => '[0-9]+', 'size' => 'medium'] -); +//Router::connect( +// '/users/users/download/:user_id/:field_name/:size', +// ['plugin' => 'users', 'controller' => 'users', 'action' => 'download'], +// ['user_id' => '[0-9]+', 'size' => 'big|medium|small|thumb'] +//); +//Router::connect( +// '/users/users/download/:user_id/:field_name', +// ['plugin' => 'users', 'controller' => 'users', 'action' => 'download', 'size' => 'medium'], +// ['user_id' => '[0-9]+', 'size' => 'medium'] +//); Router::connect( '/users/users/download/*', array( diff --git a/Controller/UsersController.php b/Controller/UsersController.php index 08cf082..e8e326d 100644 --- a/Controller/UsersController.php +++ b/Controller/UsersController.php @@ -361,7 +361,7 @@ public function delete_confirm() { */ public function download() { if (! $this->__prepare()) { - return $this->downloadNoImage(); + return $this->__downloadNoImage(); } $user = $this->viewVars['user']; @@ -374,14 +374,14 @@ public function download() { ); if (! $fileSetting) { - return $this->downloadNoImage(); + return $this->__downloadNoImage(); } $userAttribute = Hash::get($this->viewVars['userAttributes'], $fileSetting[0]['row'] . '.' . $fileSetting[0]['col'] . '.' . $fileSetting[0]['weight'] ); if (! Hash::get($user, 'UploadFile.' . $fieldName . '.field_name')) { - return $this->downloadNoImage(); + return $this->__downloadNoImage(); } //以下の場合、アバター表示 @@ -400,7 +400,7 @@ public function download() { ! Hash::get($user, 'User.' . sprintf(UserAttribute::PUBLIC_FIELD_FORMAT, $fieldName)) || ! $userAttribute['UserAttributesRole']['other_readable'] || ! $userAttribute['UserAttributeSetting']['display']) { - return $this->downloadNoImage(); + return $this->__downloadNoImage(); } else { return $this->Download->doDownload($user['User']['id'], array('field' => $fieldName, 'size' => $fieldSize) @@ -413,7 +413,7 @@ public function download() { * * @return void */ - public function downloadNoImage() { + private function __downloadNoImage() { $user = $this->viewVars['user']; $fieldName = $this->params['field_name']; $fieldSize = $this->params['size']; From ae48c74bdf3013ffc391ac79b05df35a73e41aa7 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 6 Oct 2023 11:53:08 +0900 Subject: [PATCH 6/7] =?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 | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bfe7e70..6da4321 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,12 +3,10 @@ on: branches: - main - master - - availability pull_request: branches: - main - master - - availability name: tests @@ -19,6 +17,7 @@ jobs: 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 @@ -128,15 +127,14 @@ jobs: docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build -# - name: push coveralls -# if: success() -# 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() @@ -147,7 +145,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 @@ -161,8 +159,8 @@ jobs: 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 ab2fb1f75ff253d277c39c1cbb2d1b459910cedf Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 10 Oct 2023 00:55:57 +0900 Subject: [PATCH 7/7] 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