Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable6] Backport of stable 6 for Nextcloud 26 #3431

Merged
merged 27 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
470b658
fix: Revert Attributes to annotations for stable26 compatibility
come-nc Apr 15, 2024
0e0aed7
fix: allow installation on 26
come-nc Apr 15, 2024
a5b24f7
chore: Test with stable26 in CI
come-nc Apr 15, 2024
22df4c7
chore: allow barmani/composer-bin-plugin
come-nc Apr 15, 2024
227a178
chore: composer run cs:fix
come-nc Apr 15, 2024
2086969
Revert "remove DBAL deprecations"
come-nc Apr 15, 2024
9f26d1f
chore: Downgrade OCP dependency
come-nc Apr 15, 2024
ea512e2
fix: Do not try to get participant from DB for null poll id
come-nc Apr 23, 2024
e4b6bd6
fix: Do not get polls from DB twice
come-nc Apr 23, 2024
8bf95e8
fix: Cache if no share is found for current poll in Acl
come-nc Apr 23, 2024
3097e50
Merge pull request #3445 from nextcloud/fix/stable-6-for-26-perf-impr…
ArtificialOwl Apr 24, 2024
65a23bc
fix: Cache if no share is found for current poll in Acl
come-nc Apr 23, 2024
05e208a
join votes for participation check
dartcafe Mar 16, 2024
1e4f6ed
adjust tests
dartcafe Mar 16, 2024
62f4d96
Run cs:fix
artonge Apr 24, 2024
1eba16a
join share for user role
dartcafe Mar 19, 2024
faa7ecf
Fix unit tests
artonge Apr 24, 2024
ec3d982
Fix cs:check
artonge Apr 24, 2024
78beb2c
fix: Add visual loading feedback for polls list
susnux Apr 23, 2024
8d347b7
Merge pull request #3446 from nextcloud/fix/stable-6-for-26-perf-back…
artonge Apr 24, 2024
62f054e
Merge pull request #3448 from nextcloud/fix/stable-6-backports-3444
artonge Apr 24, 2024
3f1a90b
reverse getToken()
ArtificialOwl Apr 24, 2024
cbf617a
Merge pull request #3449 from nextcloud/revert-1eba
ArtificialOwl Apr 24, 2024
ad78cc5
Default to "My polls" view
artonge Apr 24, 2024
2d4b613
Merge pull request #3451 from nextcloud/artonge/backport/stable6/3450
artonge Apr 24, 2024
e7e4865
Revert "[stable6] Default to "My polls" view"
come-nc Apr 30, 2024
c68cfd8
Merge pull request #3469 from nextcloud/revert-3451-artonge/backport/…
come-nc Apr 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
php-versions: ['8.0']
server-versions: ['master']
server-versions: ['stable26']

name: SQLite

Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
fail-fast: false
matrix:
php-versions: ['8.1']
server-versions: ['master']
server-versions: ['stable26']

name: MySQL

Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
fail-fast: false
matrix:
php-versions: ['8.2']
server-versions: ['master']
server-versions: ['stable26']

name: PostgreSQL

Expand Down
74 changes: 37 additions & 37 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: Static analysis
on:
pull_request:
push:
branches:
- master
- next
- stable*
jobs:
psalm-master:
runs-on: ubuntu-latest
strategy:
matrix:
ocp-version: ['master']
php-versions: ['8.0', '8.1', '8.2']
artonge marked this conversation as resolved.
Show resolved Hide resolved
name: Psalm
steps:
- uses: actions/checkout@v3
- name: Setup composer and PHP
uses: ./.github/actions/setup-composer
with:
php-version: ${{ matrix.php-versions }}
php-tools: composer, psalm
- name: Install Nextcloud API
run: composer require --dev nextcloud/ocp:dev-${{ matrix.ocp-version }}
- name: Install symfony/console
run: composer require symfony/console
- name: Run coding standards check
run: composer run psalm
name: Static analysis

on:
pull_request:
push:
branches:
- master
- next
- stable*

jobs:
psalm-master:
runs-on: ubuntu-latest
strategy:
matrix:
ocp-version: ['stable26']
php-versions: ['8.0', '8.1', '8.2']

name: Psalm

steps:
- uses: actions/checkout@v3

- name: Setup composer and PHP
uses: ./.github/actions/setup-composer
with:
php-version: ${{ matrix.php-versions }}
php-tools: composer, psalm

- name: Install Nextcloud API
run: composer require --dev nextcloud/ocp:dev-${{ matrix.ocp-version }}

- name: Install symfony/console
run: composer require symfony/console

- name: Run coding standards check
run: composer run psalm
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<screenshot>https://raw.githubusercontent.com/nextcloud/polls/master/screenshots/edit-poll.png</screenshot>
<dependencies>
<php min-version="8.0"/>
<nextcloud min-version="28" max-version="28"/>
<nextcloud min-version="26" max-version="28"/>
</dependencies>
<activity>
<providers>
Expand Down Expand Up @@ -79,4 +79,4 @@
<order>77</order>
</navigation>
</navigations>
</info>
</info>
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
"autoloader-suffix": "Polls",
"platform": {
"php": "8.0"
}
},
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
},
"autoload": {
"psr-4": {
Expand All @@ -32,11 +35,11 @@
}
},
"require-dev": {
"doctrine/dbal": "^3.6",
"league/factory-muffin": "^3.0",
"league/factory-muffin-faker": "^2.0",
"nextcloud/coding-standard": "^1.0",
"nextcloud/ocp": "dev-stable27",
"doctrine/dbal": "^3.6"
"nextcloud/ocp": "dev-stable26"
},
"scripts": {
"cs:check": "php-cs-fixer fix --dry-run --diff",
Expand Down
88 changes: 17 additions & 71 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions lib/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use OCA\Polls\AppConstants;
use OCA\Polls\Db\UserMapper;
use OCA\Polls\Service\PollService;
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent;
Expand All @@ -52,7 +51,9 @@ public function __construct(
parent::__construct($appName, $request);
}

#[NoCSRFRequired]
/**
* @NoCSRFRequired
*/
public function index(): TemplateResponse {
Util::addScript(AppConstants::APP_ID, 'polls-main');
$this->eventDispatcher->dispatchTyped(new LoadAdditionalScriptsEvent());
Expand Down
6 changes: 3 additions & 3 deletions lib/Controller/BaseApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function __construct(

/**
* response
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function response(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_OK);
Expand All @@ -62,8 +62,8 @@ protected function response(Closure $callback): JSONResponse {

/**
* response
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function responseLong(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_OK);
Expand All @@ -74,8 +74,8 @@ protected function responseLong(Closure $callback): JSONResponse {

/**
* responseCreate
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function responseCreate(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_CREATED);
Expand Down
8 changes: 4 additions & 4 deletions lib/Controller/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public function __construct(

/**
* response
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function response(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_OK);
Expand All @@ -60,8 +60,8 @@ protected function response(Closure $callback): JSONResponse {

/**
* response
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function responseLong(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_OK);
Expand All @@ -72,8 +72,8 @@ protected function responseLong(Closure $callback): JSONResponse {

/**
* responseCreate
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function responseCreate(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_CREATED);
Expand All @@ -84,8 +84,8 @@ protected function responseCreate(Closure $callback): JSONResponse {

/**
* responseDeleteTolerant
* @NoAdminRequired
*/
#[NoAdminRequired]
protected function responseDeleteTolerant(Closure $callback): JSONResponse {
try {
return new JSONResponse($callback(), Http::STATUS_OK);
Expand Down
Loading
Loading