Skip to content

Commit 75abf06

Browse files
authored
Merge pull request #1443 from nextcloud/fix/maintenance
chore: Maintenance
2 parents 973ef18 + fc606c7 commit 75abf06

38 files changed

Lines changed: 1101 additions & 684 deletions

.github/workflows/cluster-faces-test.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ on:
88
push:
99
branches:
1010
- main
11-
- stable8
12-
- stable9
11+
- stable*
1312
paths:
1413
- 'lib/**'
1514
- 'src/**'
@@ -131,9 +130,15 @@ jobs:
131130
./occ app:enable -vvv -f ${{ env.APP_NAME }}
132131
php -S localhost:8080 &
133132
134-
- name: Install
133+
- name: Checkout app
134+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
135+
with:
136+
repository: nextcloud/viewer
137+
path: apps/viewer
138+
139+
- name: Install viewer
135140
run: |
136-
./occ app:enable -vvv ${{ env.APP_NAME }}
141+
./occ app:enable -vvv viewer
137142
138143
- name: Remove unnecessary models to make space
139144
run: |
@@ -161,8 +166,10 @@ jobs:
161166

162167
- name: Set config
163168
run: |
164-
./occ config:app:set --value ${{ matrix.pure-js-mode }} recognize tensorflow.purejs
169+
./occ config:app:set --lazy --value ${{ matrix.pure-js-mode }} recognize tensorflow.purejs
165170
./occ config:app:set --value true recognize faces.enabled
171+
# Don't force API key usage to allow tests to run
172+
./occ config:app:set --value false recognize require_api_key
166173
# only use one core. GH actions has 2
167174
./occ config:app:set --value 1 recognize tensorflow.cores
168175
@@ -221,7 +228,7 @@ jobs:
221228
- name: Install xq
222229
if: steps.clustering-cache.outputs.cache-hit != 'true'
223230
run: |
224-
pip install xq --break-system-packages
231+
pip install yq --break-system-packages
225232
226233
- name: Download face assignments
227234
if: steps.clustering-cache.outputs.cache-hit != 'true'

.github/workflows/files-scan-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
- name: Set imagenet.enabled and concurrency.enabled
134134
run: |
135135
./occ config:app:set --value true recognize imagenet.enabled
136-
./occ config:app:set --value true recognize concurrency.enabled
136+
./occ config:app:set --lazy --value true recognize concurrency.enabled
137137
138138
- name: Run scan
139139
env:

.github/workflows/full-run-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
156156
- name: Set pure-js mode
157157
run: |
158-
./occ config:app:set --value ${{ matrix.pure-js-mode }} recognize tensorflow.purejs
158+
./occ config:app:set --lazy --value ${{ matrix.pure-js-mode }} recognize tensorflow.purejs
159159
160160
- name: Set imagenet.enabled
161161
run: |

.github/workflows/psalm-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Set up php${{ steps.versions.outputs.php-available }}
4242
uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # v2.33.0
4343
with:
44-
php-version: ${{ steps.versions.outputs.php-available }}
44+
php-version: ${{ steps.versions.outputs.php-min }}
4545
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
4646
coverage: none
4747
ini-file: development

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
declare(strict_types=1);
33

4-
require_once './vendor/scoper-autoload.php';
4+
require_once './vendor/autoload.php';
55

66
use Nextcloud\CodingStandard\Config;
77

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ npm-update:
2424

2525
composer-install:
2626
composer install
27-
composer install
2827

2928
install-binaries:
3029
mkdir -p bin

appinfo/info.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Requirements:
7575
The app does not send any sensitive data to cloud providers or similar services. All processing is done on your Nextcloud machine, using Tensorflow.js running in Node.js.
7676
7777
]]></description>
78-
<version>11.1.0-dev.0</version>
78+
<version>12.0.0-dev.0</version>
7979
<licence>agpl</licence>
8080
<author mail="mklehr@gmx.net">Marcel Klehr</author>
8181
<types>
@@ -92,7 +92,7 @@ The app does not send any sensitive data to cloud providers or similar services.
9292
<screenshot>https://raw.githubusercontent.com/nextcloud/recognize/main/screenshots/Logo.png</screenshot>
9393
<screenshot>https://raw.githubusercontent.com/nextcloud/recognize/main/screenshots/imagenet_examples.jpg</screenshot>
9494
<dependencies>
95-
<nextcloud min-version="33" max-version="34" />
95+
<nextcloud min-version="34" max-version="34" />
9696
</dependencies>
9797
<background-jobs>
9898
<job>OCA\Recognize\BackgroundJobs\MaintenanceJob</job>

composer.json

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,51 @@
11
{
2-
"require": {
3-
"php": ">=8.2",
4-
"ext-json": "*",
5-
"ext-pdo": "*",
6-
"rubix/ml": "2.x",
7-
"amphp\/parallel": "1.4.x",
8-
"wamania/php-stemmer": "4.0 as 3.0",
9-
"bamarni/composer-bin-plugin": "^1.8"
10-
},
11-
"autoload": {
12-
"psr-4": {
13-
"OCA\\Recognize\\": "lib/"
14-
}
2+
"require": {
3+
"php": ">=8.2",
4+
"ext-json": "*",
5+
"ext-pdo": "*",
6+
"rubix/ml": "2.x",
7+
"amphp/parallel": "1.4.x",
8+
"wamania/php-stemmer": "4.0 as 3.0"
9+
},
10+
"autoload": {
11+
"psr-4": {
12+
"OCA\\Recognize\\": "lib/"
13+
}
14+
},
15+
"scripts": {
16+
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
17+
"cs:check": "vendor-bin/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff",
18+
"cs:fix": "vendor-bin/php-cs-fixer/vendor/bin/php-cs-fixer fix",
19+
"psalm": "vendor-bin/psalm/vendor/bin/psalm",
20+
"psalm:update-baseline": "vendor-bin/psalm/vendor/bin/psalm --threads=1 --update-baseline",
21+
"psalm:update-baseline:force": "vendor-bin/psalm/vendor/bin/psalm --threads=1 --update-baseline --set-baseline=psalm-baseline.xml",
22+
"test:unit": "vendor-bin/phpunit/vendor/bin/phpunit --config tests/phpunit.xml",
23+
"post-install-cmd": [
24+
"composer install --working-dir=vendor-bin/php-cs-fixer --ansi --no-interaction",
25+
"composer install --working-dir=vendor-bin/php-scoper --ansi --no-interaction",
26+
"composer install --working-dir=vendor-bin/phpunit --ansi --no-interaction",
27+
"composer install --working-dir=vendor-bin/psalm --ansi --no-interaction",
28+
"grep -r 'OCA\\\\Recognize\\\\Vendor\\\\Rubix' ./vendor/rubix/ml/ || (vendor-bin/php-scoper/vendor/bin/php-scoper add-prefix --prefix='OCA\\Recognize\\Vendor' --output-dir=\"/tmp/scoped-vendor\" --working-dir=\"./vendor/\" -f --config=\"../scoper.inc.php\" && cp -rf /tmp/scoped-vendor/* ./vendor/ && rm -rf /tmp/scoped-vendor)",
29+
"composer dump-autoload"
30+
],
31+
"post-update-cmd": [
32+
"composer install --working-dir=vendor-bin/php-cs-fixer --ansi --no-interaction",
33+
"composer install --working-dir=vendor-bin/php-scoper --ansi --no-interaction",
34+
"composer install --working-dir=vendor-bin/phpunit --ansi --no-interaction",
35+
"composer install --working-dir=vendor-bin/psalm --ansi --no-interaction",
36+
"grep -r 'OCA\\\\Recognize\\\\Vendor\\\\Rubix' ./vendor/rubix/ml/ || (vendor-bin/php-scoper/vendor/bin/php-scoper add-prefix --prefix='OCA\\Recognize\\Vendor' --output-dir=\"/tmp/scoped-vendor\" --working-dir=\"./vendor/\" -f --config=\"../scoper.inc.php\" && cp -rf /tmp/scoped-vendor/* ./vendor/ && rm -rf /tmp/scoped-vendor)",
37+
"composer dump-autoload"
38+
]
39+
},
40+
"config": {
41+
"platform": {
42+
"php": "8.2.0"
1543
},
16-
"scripts": {
17-
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
18-
"cs:check": "php-cs-fixer fix --dry-run --diff",
19-
"cs:fix": "php-cs-fixer fix",
20-
"psalm": "psalm",
21-
"psalm:update-baseline": "psalm --threads=1 --update-baseline",
22-
"psalm:update-baseline:force": "psalm --threads=1 --update-baseline --set-baseline=psalm-baseline.xml",
23-
"test:unit": "phpunit --config tests/phpunit.xml",
24-
"post-install-cmd": [
25-
"@composer bin all install --ansi",
26-
"grep -r 'OCA\\\\Recognize\\\\Vendor\\\\Rubix' ./vendor/rubix/ml/ || vendor/bin/php-scoper add-prefix --prefix='OCA\\Recognize\\Vendor' --output-dir=\".\" --working-dir=\"./vendor/\" -f --config=\"../scoper.inc.php\"",
27-
"composer dump-autoload"
28-
],
29-
"post-update-cmd": [
30-
"@composer bin all update --ansi",
31-
"grep -r 'OCA\\\\Recognize\\\\Vendor\\\\Rubix' ./vendor/rubix/ml/ || vendor/bin/php-scoper add-prefix --prefix='OCA\\Recognize\\Vendor' --output-dir=\".\" --working-dir=\"./vendor/\" -f --config=\"../scoper.inc.php\"",
32-
"composer dump-autoload"
33-
]
44+
"allow-plugins": {
45+
"composer/package-versions-deprecated": true
3446
},
35-
"config": {
36-
"platform": {
37-
"php": "8.2.0"
38-
},
39-
"allow-plugins": {
40-
"bamarni/composer-bin-plugin": true,
41-
"composer/package-versions-deprecated": true
42-
},
43-
"autoloader-suffix": "Recognize",
44-
"optimize-autoloader": true,
45-
"sort-packages": true
46-
}
47+
"autoloader-suffix": "Recognize",
48+
"optimize-autoloader": true,
49+
"sort-packages": true
50+
}
4751
}

lib/AppInfo/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct() {
4747
}
4848

4949
public function register(IRegistrationContext $context): void {
50-
@include_once __DIR__ . '/../../vendor/scoper-autoload.php';
50+
@include_once __DIR__ . '/../../vendor/autoload.php';
5151
@include_once __DIR__ . '/../../vendor/rubix/ml/src/functions.php';
5252
@include_once __DIR__ . '/../../vendor/rubix/ml/src/constants.php';
5353

lib/BackgroundJobs/StorageCrawlJob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected function run($argument): void {
7878
$this->queue->insertIntoQueue(ImagenetClassifier::MODEL_NAME, $queueFile);
7979
}
8080
if (!in_array(ImagenetClassifier::MODEL_NAME, $models) && in_array(LandmarksClassifier::MODEL_NAME, $models)) {
81-
$tags = $this->tagManager->getTagsForFiles([$queueFile->getFileId()]);
81+
$tags = $this->tagManager->getTagsForFiles([(string)$queueFile->getFileId()]);
8282
$fileTags = $tags[$queueFile->getFileId()];
8383
$landmarkTags = array_filter($fileTags, function ($tag) {
8484
return in_array($tag->getName(), LandmarksClassifier::PRECONDITION_TAGS);

0 commit comments

Comments
 (0)