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

Upgrade sf7 #142

Merged
merged 52 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
2bf7afc
build: update to php 8.3
joelbeckmann Jan 17, 2025
56400cc
build: upgrade to symfony 6.4
joelbeckmann Jan 17, 2025
9822086
build: update recipe doctrine/doctrine-bundle
joelbeckmann Jan 17, 2025
56ecc2b
build: update recipe phpstan/phpstan
joelbeckmann Jan 17, 2025
0fbf029
build: update recipe symfony/console
joelbeckmann Jan 17, 2025
8e6ba1d
build: update recipe symfony/flex
joelbeckmann Jan 17, 2025
3a459fc
build: update recipe symfony/framework-bundle
joelbeckmann Jan 17, 2025
b9de766
build: update recipe symfony/monolog-bundle
joelbeckmann Jan 17, 2025
1f59c37
build: update recipe symfony/security-bundle
joelbeckmann Jan 17, 2025
188c497
build: update recipe symfony/translation
joelbeckmann Jan 17, 2025
758f5a3
build: update recipe symfony/twig-bundle
joelbeckmann Jan 17, 2025
2bde5f1
build: update recipe symfony/phpunit-bridge
joelbeckmann Jan 17, 2025
19afbd3
ci: update php-cs-fixer
joelbeckmann Jan 17, 2025
654ec80
refactor: install php-cs-fixer as a normal package
joelbeckmann Jan 17, 2025
b8d173a
build: update node packages
joelbeckmann Jan 17, 2025
9d86e6f
ci(actions): update node and php version
joelbeckmann Jan 17, 2025
0202fb2
ci: update php-cs-fixer config
joelbeckmann Jan 17, 2025
2819cdd
ci(actions): update lint workflow
joelbeckmann Jan 17, 2025
1da4e92
style: fix phpstan errors
joelbeckmann Jan 17, 2025
a0c19a2
build: update node packages
joelbeckmann Jan 17, 2025
7c419b8
build: update webpack encore
joelbeckmann Jan 17, 2025
b10fc58
build: install symfony/stimulus-bundle
joelbeckmann Jan 17, 2025
bce8aaa
build: update recipe symfony/webpack-encore-bundle
joelbeckmann Jan 17, 2025
f483c6a
chore: remove unused php-cs-fixer executable
joelbeckmann Jan 21, 2025
52fb993
build: remove deprecations in config
joelbeckmann Jan 21, 2025
6d1855b
build: upgrade oneup uploader bundle
joelbeckmann Jan 21, 2025
1741998
build: update composer packages
joelbeckmann Jan 21, 2025
21a1816
fix: replace deprecated Route Annotation with Route Attribute
joelbeckmann Jan 21, 2025
48f562f
fix: change broken link from study description to export
joelbeckmann Jan 21, 2025
507e55e
style: fix phpstan errors
joelbeckmann Jan 21, 2025
2ae6b35
ci(hooks): add phpstan
joelbeckmann Jan 21, 2025
9ab9ab5
refactor: use Attributes instead of Annotations
joelbeckmann Jan 21, 2025
109ddb1
style: remove Action from controller function names
joelbeckmann Jan 21, 2025
a6eb7be
test: update bootstrap.php
joelbeckmann Jan 21, 2025
5d34721
ci(actions): disable e2e tests
joelbeckmann Jan 21, 2025
f4b8869
build: upgrade to symfony 7.0
joelbeckmann Jan 21, 2025
c56d7a6
build: update symfony/framework-bundle
joelbeckmann Jan 21, 2025
4566975
build: update symfony/routing recipe
joelbeckmann Jan 21, 2025
9a88cfe
build: upgrade to symfony 7.2
joelbeckmann Jan 21, 2025
12c6d3d
refactor: remove axios in stimulus controllers
joelbeckmann Jan 21, 2025
732a9a3
refactor: automatically resolve entities from controller routes
joelbeckmann Jan 22, 2025
337fceb
refactor: use MapQueryParameter Attribute where possible
joelbeckmann Jan 22, 2025
81554bc
refactor: use voter system to determine access permissions
joelbeckmann Jan 22, 2025
a635fb4
refactor: map query payloads using MapRequestPayload
joelbeckmann Jan 27, 2025
bf69fda
build: remove webpack encore
joelbeckmann Jan 27, 2025
76318a0
build: use importmap
joelbeckmann Jan 27, 2025
4640ad7
fix: return right type from DataWizUser getUserIdentifier
joelbeckmann Jan 28, 2025
9da12af
build: remove encore from docker and use assetmapper
joelbeckmann Jan 28, 2025
9fe584c
ci(actions): add automatic kustomization workflow
joelbeckmann Jan 28, 2025
8570930
ci(actions): update release workflow
joelbeckmann Feb 4, 2025
81bc01a
style: remove stylelint
joelbeckmann Feb 4, 2025
8330d52
ci: remove audit from release workflow
joelbeckmann Feb 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 5 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ TRUSTED_PROXIES=127.0.0.1,REMOTE_ADDR
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8&charset=utf8mb4"
# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=15&charset=utf8"
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8"
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=10.11.8-MariaDB&charset=utf8mb4

###< doctrine/doctrine-bundle ###

###< Keycloak OAUTH >###
Expand Down
Empty file added .env.dev
Empty file.
36 changes: 9 additions & 27 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -57,33 +57,15 @@ yarn markdownlint-cli2 '**/*.md' '#node_modules' '#vendor' '#tools' '#CHANGELOG.
echo ""
echo "Lint PHP Files..."

PHP_CS_FIXER="tools/php-cs-fixer/vendor/bin/php-cs-fixer"
HAS_PHP_CS_FIXER=false

if [ -x $PHP_CS_FIXER ]; then
HAS_PHP_CS_FIXER=true
fi

if $HAS_PHP_CS_FIXER; then
FILES=` git status --porcelain | grep -e '^[AM]\(.*\).php$' | cut -c 3- | tr '\n' ' '`
if [ -z "$FILES" ]
then
echo "No php files found in commit."
else
echo ${FILES}
$PHP_CS_FIXER fix --config .php-cs-fixer.php --verbose ${FILES} --diff
git add ${FILES}
fi
else
echo ""
echo "Please install php-cs-fixer with"
echo ""
echo " composer install"
echo "or"
echo " mkdir -p tools/php-cs-fixer"
echo " composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer"
echo ""
exit 1
FILES=` git status --porcelain | grep -e '^[AM]\(.*\).php$' | cut -c 3- | sed 's/config\/bundles.php//' | xargs`
if [ -z "$FILES" ]
then
echo "No php files found in commit."
else
echo ${FILES}
vendor/bin/phpstan analyse --configuration=phpstan.dist.neon ${FILES}
vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php --verbose ${FILES} --diff
git add ${FILES}
fi

echo ""
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php-versions: [ '8.2' ]
php-versions: [ '8.3' ]
steps:
- name: Install Symfony CLI
run: wget https://get.symfony.com/cli/installer -O - | bash
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/kustomize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Kustomize

on:
workflow_call:
inputs:
k8s-path:
type: string
description: 'Type: dev/stg/prod'
required: true

jobs:
kustomize:
name: kustomize
runs-on: ubuntu-latest
permissions:
contents: read
env:
APP: datawiz2
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
repository: leibniz-psychology/k8s-argocd-datawiz2-config
ref: main
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
persist-credentials: true
# path: config

- name: Setup Kustomize
uses: imranismail/setup-kustomize@v1
with:
kustomize-version: "3.6.1"

- name: Switch out image tag
run: |
cd ${{ inputs.k8s-path }}
kustomize edit set image crzpiddev.azurecr.io/${{ env.APP }}_php_fpm:${{ github.sha }}
kustomize edit set image crzpiddev.azurecr.io/${{ env.APP }}_spss:${{ github.sha }}
kustomize edit set image crzpiddev.azurecr.io/${{ env.APP }}_nginx:${{ github.sha }}
cat kustomization.yaml

- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -am "tag(${{ inputs.k8s-path }}): update "${{ github.sha }}""
- name: Git push
uses: ad-m/github-push-action@master
with:
repository: leibniz-psychology/k8s-argocd-datawiz2-config
ssh: true
branch: main
32 changes: 7 additions & 25 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Print versions
run: |
git --version
node --version
yarn --version
npx commitlint --version

- name: Install commitlint
run: |
yarn add conventional-changelog-conventionalcommits
yarn add commitlint@latest

- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
- uses: wagoid/commitlint-github-action@v6


lint-files:
name: lint and style
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '8.2' ]
php-version: [ '8.3' ]

steps:
- name: Check out code
Expand All @@ -63,7 +42,7 @@ jobs:
- name: PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php-cs-fixer.php --dry-run --diff --verbose
args: --config=.php-cs-fixer.dist.php --dry-run --diff --verbose

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
Expand All @@ -76,7 +55,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: "Cache composer"
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}
Expand All @@ -85,6 +64,9 @@ jobs:
- name: "Composer install"
run: composer install --no-interaction --no-progress

- name: PHPStan
run: vendor/bin/phpstan analyse --configuration=phpstan.dist.neon src tests

- name: Install PHPUnit
id: install
run: vendor/bin/simple-phpunit install
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/manifests/php/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM composer:lts AS composer


FROM node:18-alpine AS builder
FROM node:23-alpine AS builder
COPY . /build
RUN apk add --no-cache \
python3 \
Expand All @@ -11,11 +11,9 @@ RUN apk add --no-cache \
&& yarn global add node-gyp

WORKDIR /build
RUN yarn install \
&& yarn dev


FROM php:8.2-fpm-alpine
FROM php:8.3-fpm-alpine

ENV APP_ENV=dev

Expand Down Expand Up @@ -44,6 +42,9 @@ RUN mkdir -p var/cache \
&& composer install\
&& chown -R www-data:www-data /build

RUN php bin/console tailwind:build --minify \
&& php bin/console asset-map:compile

CMD ["sh", "-c", "cd /build \
&& php bin/console doctrine:database:create --if-not-exists --no-interaction \
&& php bin/console doctrine:migrations:migrate --no-interaction \
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/manifests/php/prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM composer:lts AS composer


FROM node:18-alpine AS builder
FROM node:23-alpine AS builder
COPY . /build
RUN apk add --no-cache \
python3 \
Expand All @@ -11,11 +11,9 @@ RUN apk add --no-cache \
&& yarn global add node-gyp

WORKDIR /build
RUN yarn install \
&& yarn build


FROM php:8.2-fpm-alpine
FROM php:8.3-fpm-alpine

ENV APP_ENV=prod

Expand Down Expand Up @@ -44,7 +42,11 @@ RUN mkdir -p var/cache \
&& composer install\
&& chown -R www-data:www-data /build

RUN php bin/console tailwind:build --minify \
&& php bin/console asset-map:compile

CMD ["sh", "-c", "cd /build \
&& php bin/console asset-map:compile \
&& php bin/console doctrine:database:create --if-not-exists --no-interaction \
&& php bin/console doctrine:migrations:migrate --no-interaction \
&& php-fpm"]
28 changes: 16 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,28 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
app_version: ${{ steps.step1.outputs.app_version }}
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Nodejs
uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v4
with:
node-version: 18

fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install dependencies
run: npm install @semantic-release/changelog @semantic-release/git @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/exec @semantic-release/git semantic-release/release-notes-generator

run: yarn install
- name: Install semantic-release and plugins
run: yarn add @semantic-release/changelog @semantic-release/exec @semantic-release/git @semantic-release/github @semantic-release/commit-analyzer @semantic-release/release-notes-generator
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

- name: Get the last tag via git and store in var
id: step1
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/wf-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
call-lint-workflow:
uses: ./.github/workflows/lint.yml

call-e2e-workflow:
needs:
- call-lint-workflow
uses: ./.github/workflows/e2e.yml
secrets: inherit
#call-e2e-workflow:
# needs:
# - call-lint-workflow
# uses: ./.github/workflows/e2e.yml
# secrets: inherit

call-container-build-workflow:
needs:
Expand All @@ -23,4 +23,12 @@ jobs:
with:
container-tag: latest-dev
build-stage: dev
secrets: inherit
secrets: inherit

call-kustomize-workflow:
needs:
- call-container-build-workflow
uses: ./.github/workflows/kustomize.yml
with:
k8s-path: dev
secrets: inherit
12 changes: 6 additions & 6 deletions .github/workflows/wf-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ jobs:
call-lint-workflow:
uses: ./.github/workflows/lint.yml

call-e2e-workflow:
needs:
- call-lint-workflow
uses: ./.github/workflows/e2e.yml
secrets: inherit
#call-e2e-workflow:
# needs:
# - call-lint-workflow
# uses: ./.github/workflows/e2e.yml
# secrets: inherit

call-container-build-workflow:
needs:
- call-lint-workflow
- call-e2e-workflow
# - call-e2e-workflow
uses: ./.github/workflows/container-build.yml
with:
container-tag: latest
Expand Down
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -280,22 +280,22 @@ phpunit.xml.dist
/var/
/vendor/
###< symfony/framework-bundle ###

###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###

###> symfony/phpunit-bridge ###
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

/cypress.env.json
/cypress/videos/
/k8s-secrets.sh

###> friendsofphp/php-cs-fixer ###
.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###

###> symfony/asset-mapper ###
/public/assets/
/assets/vendor/
###< symfony/asset-mapper ###
10 changes: 8 additions & 2 deletions .php-cs-fixer.php → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<?php

$finder = PhpCsFixer\Finder::create()
use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$finder = Finder::create()
->exclude(['var', 'vendor', 'node_modules'])
->notPath('config/bundles.php')
->notName('bundles.php')
->in(__DIR__)
;

$config = new PhpCsFixer\Config();
$config = new Config();
return $config->setRules([
'@PhpCsFixer' => true,
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
Expand Down
Loading
Loading