Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nextcloud/news
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 18.0.1-beta2
Choose a base ref
...
head repository: nextcloud/news
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 567 changed files with 55,745 additions and 19,403 deletions.
9 changes: 9 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# DevContainer

## Image Used in This Project

This project uses a Nextcloud Docker image for the development container. The image is defined in the `.devcontainer.json` configuration file. For more details about the image and its configuration, you can refer to the [GitHub repository](https://github.com/juliusknorr/nextcloud-dev).

## Visual Studio Code

For information on how to configure and use Dev Containers, please visit the [official documentation](https://code.visualstudio.com/docs/remote/containers).
30 changes: 30 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"image": "ghcr.io/juliusknorr/nextcloud-dev-php82:latest",
"forwardPorts": [80],
"containerEnv": {
"NEXTCLOUD_VERSION": "30",
"NEXTCLOUD_AUTOINSTALL_APPS": "news",
"XDEBUG_MODE": "debug"
},
"customizations": {
"vscode": {
"extensions": [
"felixfbecker.php-intellisense",
"octref.vetur"
],
"settings": {
"php.suggest.basic": false,
"git.alwaysSignOff": true
}
}
},
"workspaceMount": "source=${localWorkspaceFolder},target=/var/www/html/apps-extra/news,type=bind",
"workspaceFolder": "/var/www/html/apps-extra/news",
"overrideCommand": true,
"postAttachCommand": "bash ./.devcontainer/setup.sh",
"portsAttributes": {
"80": {
"label": "Webserver"
}
}
}
11 changes: 11 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: CC0-1.0

(
cd /tmp && /usr/local/bin/bootstrap.sh apache2ctl start
)

make composer
make npm
7 changes: 6 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -5,11 +5,16 @@ trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

[*.{js,php,html}]
[*.{php,html,css}]
indent_style = space
indent_size = 4
charset = utf-8

[*.{js,ts,vue}]
indent_style = tab
indent_size = 4
charset = utf-8

[*.bats]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.d.ts
l10n/*.js
38 changes: 38 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
extends: [
'@nextcloud',
'@nextcloud/eslint-config/typescript',
],
rules: {
'no-console': 'warn',
'@typescript-eslint/no-var-requires': 'off',

// disable deprecated func-call-spacing
'@typescript-eslint/func-call-spacing': 'off',

// TODO: Trouble importing .ts files into .vue files for some reason?
'import/extensions': 'off',
'n/no-missing-import': 'off',
},
settings: {
'import/resolver': {
node: {
extensions: ['.ts'],
},
},
},
overrides: [
{
files: ['*spec.ts', 'tests/javascript/unit/setup.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['src/store/*.ts'],
rules: {
'function-paren-newline': ['error', 'multiline'],
},
},
],
}
4 changes: 3 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -7,12 +7,13 @@ version: 2
updates:
# Maintain dependencies for npm
- package-ecosystem: "npm"
directory: "/js"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
- "Skip-Changelog"
versioning-strategy: increase

# Maintain dependencies for Composer
- package-ecosystem: "composer"
@@ -22,6 +23,7 @@ updates:
labels:
- "dependencies"
- "Skip-Changelog"
versioning-strategy: increase

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

* Resolves: # <!-- related github issue -->

## Summary

<!-- your text -->

## Checklist

- Code is [properly formatted](https://nextcloud.github.io/news/developer/#coding-style-guidelines)
- [Sign-off message](https://github.com/src-d/guide/blob/master/developer-community/fix-DCO.md) is added to all commits
- Changelog entry added for all important changes.
1 change: 1 addition & 0 deletions .github/styles/vocab.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# test
60 changes: 41 additions & 19 deletions .github/workflows/api-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ jobs:
name: "Integration: Nextcloud ${{ matrix.nextcloud }} - PHP ${{ matrix.php-versions }} - DB ${{ matrix.database }}"
services:
postgres:
image: postgres
image: postgres:14
env:
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
options: >-
@@ -28,37 +28,41 @@ jobs:
- 5432:5432 # Maps tcp port 5432 on service container to the host
strategy:
matrix:
php-versions: ['7.4', '8.0']
nextcloud: ['stable22', 'stable23']
php-versions: ['8.2', '8.3']
nextcloud: ['stable29']
database: ['sqlite', 'pgsql', 'mysql']
experimental: [false]
include:
- php-versions: 8.0
- php-versions: 8.3
nextcloud: pre-release
database: sqlite
experimental: true
- php-versions: 8.1
- php-versions: 8.3
nextcloud: pre-release
database: sqlite
experimental: true
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup BATS
uses: mig4/setup-bats@v1.2.0
- name: Setup BATS & httpie
run: sudo apt-get install -y httpie && sudo npm install -g bats@1.11.0

### MySQL specific setup
- name: Setup mysql
if: matrix.database == 'mysql'
uses: getong/mariadb-action@v1.1
uses: getong/mariadb-action@v1.11
with:
mariadb version: '10.5'
host port: ${{ env.MYSQL_PORT }}
@@ -95,17 +99,30 @@ jobs:
database-password: ${{ env.POSTGRES_PASSWORD }}

- name: Prime app build
run: make
run: make composer

- name: Configure server with app
uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main
with:
app: 'news'
check-code: true
check-code: false
force: ${{ matrix.experimental }}

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Run API tests
working-directory: ../server
run: |
php -S localhost:8080 &> /tmp/webserver.log &
cd apps/news/tests/test_helper/feeds && php -S localhost:8090 &> /tmp/feedserver.log &
sleep 2
cd ${{ github.workspace }}/../server
bats apps/news/tests/api
# Kill php server
kill %1
kill %2
- name: Functional tests maintenance
working-directory: ../server
@@ -114,12 +131,17 @@ jobs:
- name: Functional tests
working-directory: ../server
run: bats apps/news/tests/integration
run: |
cd apps/news/tests/test_helper/feeds && php -S localhost:8090 &> /tmp/feedserver.log &
- name: Prep PHP tests
working-directory: ../server/apps/news
run: make php-test-dependencies
sleep 2
cd ${{ github.workspace }}/../server
bats apps/news/tests/command
kill %1
- name: Feed tests
- name: Check feeds if feeds from explore page are reachable
working-directory: ../server/apps/news
run: make feed-test
run: make feed-test
27 changes: 19 additions & 8 deletions .github/workflows/api-php-static-code-check.yml
Original file line number Diff line number Diff line change
@@ -7,19 +7,30 @@ jobs:
continue-on-error: true
strategy:
matrix:
php-versions: [ '8.0' ]
nextcloud: [ 'stable23' ]
php-versions: ['8.2', '8.3' ]
nextcloud: [ 'stable29' ]
database: [ 'sqlite' ]
name: "phpstan: Nextcloud ${{ matrix.nextcloud }}"
include:
- php-versions: 8.3
nextcloud: pre-release
database: sqlite
experimental: true
- php-versions: 8.4
nextcloud: pre-release
database: sqlite
experimental: true
name: "phpstan: Nextcloud ${{ matrix.nextcloud }} with ${{ matrix.php-versions }}"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up php
uses: shivammathur/setup-php@master
with:
php-version: 7.4
php-version: ${{ matrix.php-versions }}
extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up server non MySQL
uses: SMillerDev/nextcloud-actions/setup-nextcloud@main
@@ -29,13 +40,13 @@ jobs:
database-type: ${{ matrix.database }}

- name: Build app
run: make
run: make composer

- name: Configure server with app
uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main
with:
app: 'news'
check-code: true
check-code: false
force: true

- name: Prep code scanning
@@ -44,7 +55,7 @@ jobs:

- name: PHPCS
working-directory: ../server/apps/news
run: pwd && make phpcs #debug pwd
run: make phpcs

- name: PHPStan
working-directory: ../server/apps/news
24 changes: 14 additions & 10 deletions .github/workflows/api-php-tests.yml
Original file line number Diff line number Diff line change
@@ -9,20 +9,29 @@ jobs:
name: "PHP: Nextcloud ${{ matrix.nextcloud }} - PHP ${{ matrix.php-versions }} - DB ${{ matrix.database }}"
strategy:
matrix:
php-versions: ['8.0']
nextcloud: ['stable23']
php-versions: ['8.3']
nextcloud: ['stable29']
database: ['sqlite']
experimental: [false]
include:
- php-versions: 8.3
nextcloud: stable29
database: sqlite
experimental: false
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2 # https://github.com/codecov/codecov-action/issues/190#issuecomment-790729633

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip
coverage: pcov
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

### Back to normal setup
- name: Set up server non MySQL
@@ -39,17 +48,12 @@ jobs:
uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main
with:
app: 'news'
check-code: true

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
check-code: false

- name: Prep PHP tests
working-directory: ../server/apps/news
run: make php-test-dependencies

- name: Unittests
working-directory: ../server/apps/news
run: make unit-test
- name: Upload codecoverage
working-directory: ../server/apps/news
run: bash <(curl -s https://codecov.io/bash) -f build/php-unit.clover -N ${{ github.sha }}
Loading