Skip to content

Commit ab6d40f

Browse files
committed
sync relevant changes from template at https://github.com/api-platform/api-platform
1 parent 16d335e commit ab6d40f

32 files changed

+238
-582
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
.cache/
66
.git/
7+
.github/
78
/frontend/data
89
/frontend/dist
910
/frontend/.env.*

.github/workflows/continuous-integration.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ jobs:
425425
docker-compose-
426426
427427
# start necessary containers
428-
- run: docker-compose up -d php caddy frontend database docker-host
428+
- run: docker compose up -d php caddy frontend database docker-host
429429

430430
# pull cypress while container are starting up
431431
- run: docker pull cypress/included:12.5.1
@@ -438,7 +438,7 @@ jobs:
438438
working-directory: frontend
439439

440440
# print docker container logs (good for debugging; can be disabled again lateron)
441-
- run: docker-compose logs --tail="all"
441+
- run: docker compose logs --tail="all"
442442

443443
coveralls-finished:
444444
name: 'Finish coveralls report'

.helm/ecamp3/templates/api_deployment.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ spec:
204204
exec:
205205
command:
206206
- docker-healthcheck
207-
initialDelaySeconds: 3
208207
periodSeconds: 10
209208
timeoutSeconds: 5
210209
livenessProbe:

CONTRIBUTING.md

+60-53
Original file line numberDiff line numberDiff line change
@@ -9,128 +9,135 @@
99
### [Code of conduct](https://www.ecamp3.ch/en/code-of-conduct)
1010

1111
### Git setup
12+
1213
We use a triangular git workflow. This means that all changes are first pushed to a contributor's fork of the repository, and then the changes are merged into the main fork via a pull request. In practice, setting up this workflow looks as follows:
1314

1415
1. Fork the main repository onto your GitHub account. Let's say your GitHub account is called `your-username`.
1516

1617
2. Clone the main repository to your local computer:
1718

18-
```bash
19-
git clone https://github.com/ecamp/ecamp3.git
20-
cd ecamp3
21-
```
19+
```bash
20+
git clone https://github.com/ecamp/ecamp3.git
21+
cd ecamp3
22+
```
2223

2324
3. Add your fork as a remote:
2425

25-
```bash
26-
git remote add your-username https://github.com/your-username/ecamp3.git
27-
```
26+
```bash
27+
git remote add your-username https://github.com/your-username/ecamp3.git
28+
```
2829

2930
4. Configure the central repo for pulling the current state and your own repo for pushing new changes:
3031

31-
```bash
32-
git config remote.pushdefault your-username
33-
git config push.default current
34-
```
32+
```bash
33+
git config remote.pushdefault your-username
34+
git config push.default current
35+
```
3536

3637
Once this is set up, you can start coding, and all `git pull` commands should pull from the central repository by default, while all `git push` commands will push to your fork of the project.
3738

3839
### Starting a new feature
3940

4041
Before starting a new feature, you should do the following steps to start with a clean state that is easily mergeable later:
42+
4143
```bash
4244
git fetch --all
4345
git checkout origin/devel
4446
git checkout -b my-new-feature-branch
4547
```
4648

4749
### Code formatting
50+
4851
We use cs-fixer for PHP and ESLint for Javascript to ensure a common code style. Make sure your code is auto-formatted before comitting and pushing to the repository.
4952

5053
We recommend to [configure your IDE](https://github.com/ecamp/ecamp3/wiki/installation-development-windows#code-auto-formatting) such that your code is auto-formatted on save.
5154

5255
Alternatively you can
53-
* run php-cs-fixer and ESLint manually before each commit:
54-
```bash
55-
docker-compose run api composer cs-fix
56-
docker-compose run frontend npm run lint
57-
docker-compose run print npm run lint
58-
```
59-
* set-up a git pre-commit hook to run php-cs-fixer and ESLint automatically before each commit
56+
57+
- run php-cs-fixer and ESLint manually before each commit:
58+
```bash
59+
docker compose run api composer cs-fix
60+
docker compose run frontend npm run lint
61+
docker compose run print npm run lint
62+
```
63+
- set-up a git pre-commit hook to run php-cs-fixer and ESLint automatically before each commit
6064

6165
### Before submitting pull requests
6266

63-
* [x] Did cs-fixer run on all changed or new PHP files?
64-
* [x] Did ESLint run on all changed or new JS / Vue files?
65-
* [x] Are all variables, classes, functions, comments etc. named or written in English?
66-
* [x] Did you write tests for any new functionality or adapt the existing tests for changed functionality?
67-
* [x] Are all passwords, credentials and local configuration removed from the code changes?
68-
* [x] Do all changed files contain some important changes (as opposed to e.g. only whitespace changes)?
69-
* [x] Is the fork up-to-date with the central repository and can your changes be merged automatically?
70-
* [x] Did the GitHub Actions CI build run through without test failures?
67+
- [x] Did cs-fixer run on all changed or new PHP files?
68+
- [x] Did ESLint run on all changed or new JS / Vue files?
69+
- [x] Are all variables, classes, functions, comments etc. named or written in English?
70+
- [x] Did you write tests for any new functionality or adapt the existing tests for changed functionality?
71+
- [x] Are all passwords, credentials and local configuration removed from the code changes?
72+
- [x] Do all changed files contain some important changes (as opposed to e.g. only whitespace changes)?
73+
- [x] Is the fork up-to-date with the central repository and can your changes be merged automatically?
74+
- [x] Did the GitHub Actions CI build run through without test failures?
7175

7276
## Deutsch
7377

7478
### [Verhaltenskodex](https://www.ecamp3.ch/de/verhaltenskodex)
7579

7680
### Git einrichten
81+
7782
Wir wenden einen triangulären Git-Workflow an. Das bedeutet, dass alle Code-Änderungen zuerst auf dem Fork des Entwicklers veröffentlicht werden, und erst dann werden die Änderungen via Pull Request in das offizielle eCamp3-Repository eingefügt. Um dies einzurichten, befolgen wir folgende Schritte:
7883

7984
1. Erstelle einen persönlichen Fork des zentralen Repositories auf GitHub. Nehmen wir an dein GitHub-Account heisst `your-username`.
8085

8186
2. Klone das originale Repository auf deinen lokalen Computer:
8287

83-
```bash
84-
git clone https://github.com/ecamp/ecamp3.git
85-
cd ecamp3
86-
```
88+
```bash
89+
git clone https://github.com/ecamp/ecamp3.git
90+
cd ecamp3
91+
```
8792

8893
3. Füge deinen Fork als Remote hinzu:
8994

90-
```bash
91-
git remote add your-username https://github.com/your-username/ecamp3.git
92-
```
95+
```bash
96+
git remote add your-username https://github.com/your-username/ecamp3.git
97+
```
9398

9499
4. Konfiguriere Git, sodass es als aktuellen, offiziellen Code-Stand das zentrale Repository und fürs Veröffentlichen neuer Änderungen den Fork verwendet:
95100

96-
```bash
97-
git config remote.pushdefault your-username
98-
git config push.default current
99-
```
101+
```bash
102+
git config remote.pushdefault your-username
103+
git config push.default current
104+
```
100105

101106
Wenn dies eingerichtet ist kannst du loslegen, und alle `git pull`-Befehle sollten standardmässig den Code vom zentralen Repository holen und `git push`-Befehle sollten auf deinen eigenen Fork des Projekts senden.
102107

103108
### Ein neues Feature beginnen
104109

105110
Bevor du etwas am Code änderst, solltest du jeweils die folgenden Schritte durchführen, um mit einem sauberen Stand zu starten der später einfach gemerged werden kann:
111+
106112
```bash
107113
git fetch --all
108114
git checkout origin/devel
109115
git checkout -b my-new-feature-branch
110116
```
111117

112118
### Quellcode Formatierung
119+
113120
Wir verwenden php-cs-fixer für PHP und ESLint für JS um einen gemeinsamen Code Style zu etablieren. Bitte stelle sicher, dass dein Code automatisch richtig formatiert wird, bevor du diesen ins Git repo committest.
114121

115122
Wir empfehlen deine [IDE so zu konfigurieren](https://github.com/ecamp/ecamp3/wiki/installation-development-windows#code-auto-formatting), dass dein Code beim Speichern automatisch richtig formatiert wird.
116123

117-
Alternativ kannst du
118-
* php-cs-fixer und ESLint vor jedem commit manuell laufen lassen:
119-
```bash
120-
docker-compose run api composer cs-fix
121-
docker-compose run frontend npm run lint
122-
docker-compose run print npm run lint
123-
```
124-
* einen git pre-commit hook einrichten, der php-cs-fixer und ESLint vor jedem commit triggert
124+
Alternativ kannst du
125125

126+
- php-cs-fixer und ESLint vor jedem commit manuell laufen lassen:
127+
```bash
128+
docker compose run api composer cs-fix
129+
docker compose run frontend npm run lint
130+
docker compose run print npm run lint
131+
```
132+
- einen git pre-commit hook einrichten, der php-cs-fixer und ESLint vor jedem commit triggert
126133

127134
### Vor dem Einreichen eines Pull Requests
128135

129-
* [x] Wurden alle geänderten oder neuen PHP-Dateien von cs-fixer verarbeitet?
130-
* [x] Wurden alle geänderten oder neuen JS/Vue-Dateien von ESLint bereinigt?
131-
* [x] Sind alle Variabeln, Klassen, Funktionen, Kommentare, etc. auf englisch benannt?
132-
* [x] Hast du für neue Funktionalität Tests geschrieben und für geänderte Funktionalität die Tests angepasst?
133-
* [x] Wurden alle Passwörter, Zugangsdaten und lokale Konfiguration aus den Code-Änderungen entfernt?
134-
* [x] Enthalten alle geänderten Dateien auch wirklich eine sinnvolle Änderung (im Gegensatz zu z.B. nur Whitespace-Änderungen)?
135-
* [x] Ist der Fork auf dem aktuellen Stand des zentralen Repositories und können die Änderungen automatisch gemerged werden?
136-
* [x] Ist der GitHub Actions CI-Build erfolgreich und ohne Test Failures durchgelaufen?
136+
- [x] Wurden alle geänderten oder neuen PHP-Dateien von cs-fixer verarbeitet?
137+
- [x] Wurden alle geänderten oder neuen JS/Vue-Dateien von ESLint bereinigt?
138+
- [x] Sind alle Variabeln, Klassen, Funktionen, Kommentare, etc. auf englisch benannt?
139+
- [x] Hast du für neue Funktionalität Tests geschrieben und für geänderte Funktionalität die Tests angepasst?
140+
- [x] Wurden alle Passwörter, Zugangsdaten und lokale Konfiguration aus den Code-Änderungen entfernt?
141+
- [x] Enthalten alle geänderten Dateien auch wirklich eine sinnvolle Änderung (im Gegensatz zu z.B. nur Whitespace-Änderungen)?
142+
- [x] Ist der Fork auf dem aktuellen Stand des zentralen Repositories und können die Änderungen automatisch gemerged werden?
143+
- [x] Ist der GitHub Actions CI-Build erfolgreich und ohne Test Failures durchgelaufen?

api/.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
**/*.log
22
**/*.md
33
**/*.php~
4+
**/*.dist.php
5+
**/*.dist
6+
**/*.cache
47
**/._*
58
**/.dockerignore
69
**/.DS_Store
@@ -18,12 +21,14 @@
1821
.env.*.local
1922
.env.local
2023
.env.local.php
24+
.env.test
2125
.php_cs.cache
2226
bin/*
2327
!bin/console
2428
build/
2529
docker/db/data/
2630
helm/
2731
public/bundles/
32+
tests/
2833
var/
2934
vendor/

api/.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/build
22
.cache
33
/docker/db/data
4-
/helm/api/charts
5-
/helm/api/Chart.lock
64

75
###> symfony/framework-bundle ###
86
/.env.local

0 commit comments

Comments
 (0)