Skip to content

Commit 914cb8b

Browse files
authored
Dev changes (#26)
* Dev changes * Workflow configurations * Added ignore path * Workflow fix * Workflow fix * Workflow fix * Workflow fix * Dev fixes * Psalm fixes
1 parent 2a1349d commit 914cb8b

29 files changed

+39295
-434
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Help us to maximize the effort we can spend fixing issues and adding new feature
1919

2020
## Contributing to Source Code
2121

22-
Thanks for wanting to contribute source code to the Cloud_Py_API app. That's great!
22+
Thanks for wanting to contribute source code to the `cloud_py_api` app. That's great!
2323

2424
## Translations
2525

.github/FUNDING.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# These are supported funding model platforms
22

33
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4-
patreon: mediadc
4+
patreon:
55
open_collective: # Replace with a single Open Collective username
66
ko_fi: # Replace with a single Ko-fi username
77
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
88
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: # Replace with a single Liberapay username
9+
liberapay: cloud_py_api
1010
issuehunt: # Replace with a single IssueHunt username
1111
otechie: # Replace with a single Otechie username
12-
custom:
12+
custom: ['https://www.paypal.com/donate?hosted_button_id=H5PLJJMWLDNJQ']

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ A clear and concise description of what the bug is.
99
**To Reproduce**
1010
Steps to reproduce the behavior:
1111
1. Go to '...'
12-
2. Click on '....'
13-
3. Scroll down to '....'
14-
4. See error
12+
2. Perform some actions '...'
13+
3. See error
1514

1615
**Expected behavior**
1716
A clear and concise description of what you expected to happen.
@@ -22,12 +21,11 @@ If applicable, add screenshots to help explain your problem.
2221
**Desktop (please complete the following information):**
2322
- OS [e.g. Ubuntu]
2423
- CPU [architecture x86, ARM]
25-
- Browser [e.g. chrome, firefox, safari]
26-
- Nextcloud version [e.g. 23]
24+
- Nextcloud version [e.g. 25.x.x]
2725
- Database configuration [e.g. mysql 8.0.27, without sensitive information]
28-
- Python version [e.g. 3.9.1]
29-
- Cloud_Py_API version [e.g. 0.1.0]
30-
- Cloud_Py_API config and admin settings
26+
- app version, that using `cloud_py_api`
27+
- `cloud_py_api` version [e.g. 0.1.0]
28+
- `cloud_py_api` config and admin settings (can be obtained in bug report admin settings section)
3129

3230
**Additional context**
3331
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/documentation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Documentation Issue
33
about: Typo fix or additions to our Wiki
44
---
55

6-
The MediaDC Wiki is open to anyone to edit. If you find something inaccurate,
6+
The `cloud_py_api` Wiki is open to anyone to edit. If you find something inaccurate,
77
missing or that can be improved, please feel free to contribute to it.
88

9-
https://github.com/andrey18106/mediadc/wiki
9+
https://github.com/cloud-py-api/cloud_py_api/wiki
1010

1111
Thank you!

.github/ISSUE_TEMPLATE/question.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ name: Support Question
33
about: Do NOT ask here - Use the forum or Telegram chat
44
---
55

6-
Thanks for reporting issues back to MediaDC!
6+
Thanks for reporting issues back to `cloud_py_api`!
77

88
# DO NOT ASK QUESTIONS, USE THE FORUMS
99

10-
We use GitHub issues only to discuss about MediaDC bugs and new features.
10+
We use GitHub issues only to discuss about `cloud_py_api` bugs and new features.
1111

12-
MediaDC and its extras are explained in the [wiki](https://github.com/andrey18106/mediadc/wiki).
12+
`cloud_py_api` and its extras are explained in the [wiki](https://github.com/cloud-py-api/cloud_py_api/wiki).
1313

14-
For any other question or comment, please use the official Telegram support [chat](https://t.me/mediadc_support).
15-
16-
Note that quite probably your question has an answer in the [FAQ](https://github.com/andrey18106/mediadc/wiki/FAQ).
14+
Note that quite probably your question has an answer in the [FAQ](https://github.com/cloud-py-api/cloud_py_api/wiki/FAQ).
1715

1816
Thank you!

.github/ISSUE_TEMPLATE/security.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ about: Important security issue or bug
55

66
⚠ PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY, SEE BELOW.
77

8-
If you have found a security issue in MediaDC, please type to one of administrators
9-
in our official Telegram support [chat](https://t.me/mediadc_support)
10-
and don't disclose it publicly until we can provide a fix for it.
8+
If you have found a security issue in `cloud_py_api`, please type to one of administrators
9+
email, that are listed below and don't disclose it publicly until we can provide a fix for it.
10+
11+
- Alexander Piskun <[email protected]>
12+
- Andrey Borysenko <[email protected]>
1113

1214
Thank you!

.github/workflows/create-release-draft.yml

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,50 @@ jobs:
4949
- name: Package app
5050
run: krankerl package
5151

52-
- uses: actions/upload-artifact@v3
52+
- name: Get nextcloud-min-version from appinfo
53+
id: appinfo
54+
uses: skjnldsv/xpath-action@master
5355
with:
54-
name: tarball
55-
path: build/artifacts/${{ env.APP_NAME }}.tar.gz
56-
if-no-files-found: error
56+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
57+
expression: "//info//dependencies//nextcloud/@min-version"
58+
59+
- name: Cache nextcloud server
60+
id: nextcloud_setup
61+
uses: actions/cache@v3
62+
with:
63+
path: nextcloud-${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}.zip
64+
key: ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
65+
66+
- name: Download nextcloud${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
67+
if: steps.nextcloud_setup.outputs.cache-hit != 'true'
68+
continue-on-error: true
69+
id: server-checkout
70+
run: |
71+
NCVERSION=${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
72+
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
73+
unzip latest-$NCVERSION.zip
74+
75+
- name: Checkout server master fallback
76+
uses: actions/checkout@v3
77+
if: ${{ steps.server-checkout.outcome != 'success' }}
78+
with:
79+
repository: nextcloud/server
80+
path: nextcloud
81+
82+
- name: Sign app
83+
run: |
84+
# Extracting release
85+
cd ${{ env.APP_NAME }}/build/artifacts
86+
tar -xvf ${{ env.APP_NAME }}.tar.gz
87+
cd ../../../
88+
# Setting up keys
89+
echo "${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.APP_NAME }}.key
90+
echo "${{ secrets.APP_PUBLIC_CRT }}" > ${{ env.APP_NAME.key }}
91+
# Signing
92+
php nextcloud/occ integrity:sign-app --privateKey=../${{ env.APP_NAME }}.key --certificate=../${{ env.APP_NAME }}.crt --path=../${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}
93+
# Rebuilding archive
94+
cd ${{ env.APP_NAME }}/build/artifacts
95+
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
5796
5897
- name: Create release draft
5998
uses: ncipollo/[email protected]

.github/workflows/lint.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
name: Lint
22

33
on:
4-
# pull_request:
5-
# branches: [main, dev]
6-
# types: [opened, reopened, edited, synchronize]
7-
# push:
8-
# branches: [dev, main]
4+
pull_request:
5+
branches: [main]
6+
types: [opened, reopened, edited, synchronize]
7+
paths:
8+
- 'appinfo/*.*'
9+
- 'lib/**'
10+
- 'src/**'
11+
- 'templates/*.*'
12+
- 'tests/Unit/**'
13+
- 'tests/Integration/**'
14+
- 'tests/javascript/**'
15+
push:
16+
branches: [main]
17+
paths:
18+
- 'appinfo/*.*'
19+
- 'lib/*.*'
20+
- 'src/*.*'
21+
- 'templates/*.*'
22+
- 'tests/Unit/**'
23+
- 'tests/Integration/**'
24+
- 'tests/javascript/**'
925
workflow_dispatch:
1026

1127
jobs:

.github/workflows/test.yml

Lines changed: 27 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
name: Test
22

33
on:
4-
# pull_request:
5-
# branches: [main, dev]
6-
# types: [opened, reopened, edited, synchronize]
7-
# push:
8-
# branches: [dev, main]
4+
pull_request:
5+
branches: [main]
6+
types: [opened, reopened, edited, synchronize]
7+
paths:
8+
- 'lib/*.*'
9+
- 'src/*.*'
10+
- 'templates/*.*'
11+
- 'tests/Unit/**'
12+
- 'tests/Integration/**'
13+
- 'tests/javascript/**'
14+
push:
15+
branches: [main]
16+
paths:
17+
- 'lib/*.*'
18+
- 'src/*.*'
19+
- 'templates/*.*'
20+
- 'tests/Unit/**'
21+
- 'tests/Integration/**'
22+
- 'tests/javascript/**'
923
workflow_dispatch:
1024

1125
env:
1226
# Location of the phpunit.xml and phpunit.integration.xml files
1327
PHPUNIT_CONFIG: ./tests/phpunit.xml
1428
PHPUNIT_INTEGRATION_CONFIG: ./tests/phpunit.integration.xml
15-
APP_NAME: mediadc
29+
APP_NAME: cloud_py_api
1630

1731
jobs:
1832
phpunit-mysql:
@@ -33,16 +47,6 @@ jobs:
3347
options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5
3448

3549
steps:
36-
- name: Set app env
37-
run: |
38-
# Split and keep last
39-
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
40-
41-
- name: Enable ONLY_FULL_GROUP_BY MySQL option
42-
run: |
43-
echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
44-
echo "SELECT @@sql_mode;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
45-
4650
- name: Checkout server
4751
uses: actions/checkout@v3
4852
with:
@@ -122,11 +126,6 @@ jobs:
122126
options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5
123127

124128
steps:
125-
- name: Set app env
126-
run: |
127-
# Split and keep last
128-
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
129-
130129
- name: Checkout server
131130
uses: actions/checkout@v3
132131
with:
@@ -188,87 +187,6 @@ jobs:
188187
working-directory: apps/${{ env.APP_NAME }}
189188
run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }}
190189

191-
# phpunit-oci:
192-
# runs-on: ubuntu-20.04
193-
194-
# strategy:
195-
# matrix:
196-
# php-versions: ["8.0"]
197-
# server-versions: ["master"]
198-
199-
# services:
200-
# oracle:
201-
# image: deepdiver/docker-oracle-xe-11g # 'wnameless/oracle-xe-11g-r2'
202-
# ports:
203-
# - 1521:1521/tcp
204-
205-
# steps:
206-
# - name: Set app env
207-
# run: |
208-
# # Split and keep last
209-
# echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
210-
211-
# - name: Checkout server
212-
# uses: actions/checkout@v3
213-
# with:
214-
# submodules: true
215-
# repository: nextcloud/server
216-
# ref: ${{ matrix.server-versions }}
217-
218-
# - name: Checkout app
219-
# uses: actions/checkout@v3
220-
# with:
221-
# path: apps/${{ env.APP_NAME }}
222-
223-
# - name: Set up php ${{ matrix.php-versions }}
224-
# uses: shivammathur/setup-php@v2
225-
# with:
226-
# php-version: ${{ matrix.php-versions }}
227-
# extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, oci8
228-
# tools: phpunit
229-
# coverage: none
230-
231-
# - name: Set up PHPUnit
232-
# working-directory: apps/${{ env.APP_NAME }}
233-
# run: composer i
234-
235-
# - name: Set up Nextcloud
236-
# env:
237-
# DB_PORT: 1521
238-
# run: |
239-
# mkdir data
240-
# ./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin
241-
# ./occ app:enable ${{ env.APP_NAME }}
242-
243-
# - name: Check PHPUnit config file existence
244-
# id: check_phpunit
245-
# uses: andstor/file-existence-action@v2
246-
# with:
247-
# files: apps/${{ env.APP_NAME }}/${{ env.PHPUNIT_CONFIG }}
248-
249-
# - name: PHPUnit
250-
# # Only run if phpunit config file exists
251-
# if: steps.check_phpunit.outputs.files_exists == 'true'
252-
# working-directory: apps/${{ env.APP_NAME }}
253-
# run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_CONFIG }}
254-
255-
# - name: Check PHPUnit integration config file existence
256-
# id: check_integration
257-
# uses: andstor/file-existence-action@v2
258-
# with:
259-
# files: apps/${{ env.APP_NAME }}/${{ env.PHPUNIT_INTEGRATION_CONFIG }}
260-
261-
# - name: Run Nextcloud
262-
# # Only run if phpunit integration config file exists
263-
# if: steps.check_integration.outputs.files_exists == 'true'
264-
# run: php -S localhost:8080 &
265-
266-
# - name: PHPUnit integration
267-
# # Only run if phpunit integration config file exists
268-
# if: steps.check_integration.outputs.files_exists == 'true'
269-
# working-directory: apps/${{ env.APP_NAME }}
270-
# run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }}
271-
272190
phpunit-summary:
273191
runs-on: ubuntu-latest
274192
needs: [phpunit-mysql, phpunit-pgsql]
@@ -285,13 +203,20 @@ jobs:
285203
runs-on: ubuntu-latest
286204

287205
steps:
206+
- name: Checkout app
207+
uses: actions/checkout@v3
208+
with:
209+
path: apps/${{ env.APP_NAME }}
210+
288211
- name: Setup Node
289212
uses: actions/setup-node@v3
290213
with:
291214
node-version: 16.x
292215

293216
- name: Install dependencies
217+
working-directory: apps/${{ env.APP_NAME }}
294218
run: npm ci
295219

296220
- name: Run unit tests
221+
working-directory: apps/${{ env.APP_NAME }}
297222
run: npm run test

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_# Changelog
1+
# Changelog
22

33
All notable changes to this project will be documented in this file.
44

@@ -30,4 +30,4 @@ All notable changes to this project will be documented in this file.
3030

3131
### Changed
3232

33-
### Fixed_
33+
### Fixed

0 commit comments

Comments
 (0)