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

Master to Dev #280

Merged
merged 24 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
60a3fe7
add defult email to docker compose file
h2Entwicklung Aug 16, 2024
7f27e76
add restart policy to restart services
h2Entwicklung Aug 16, 2024
ef7cb52
Merge pull request #265 from H2-invent/hotfix/addd-default-email-to-d…
holema Aug 16, 2024
2a4134f
add migration to match the existing modell
h2Entwicklung Oct 8, 2024
cd505ae
Try to fix invalid schemas during migration
melegiul Oct 8, 2024
20bb1ba
Merge pull request #276 from H2-invent/hotfix/fix-migrations-to-match…
holema Oct 8, 2024
ae5e349
fixing not downloading files which are uploaded
h2Entwicklung Oct 15, 2024
58a3636
Merge pull request #279 from H2-invent/hotfix/download-files
holzi1005 Oct 15, 2024
5532424
Create pipeline-development.yml
holzi1005 Oct 15, 2024
3836442
Create pipeline-release.yml
holzi1005 Oct 15, 2024
bc2b9ff
Create task-artifact.yml
holzi1005 Oct 15, 2024
22821a1
Update pipeline-release.yml
holzi1005 Oct 15, 2024
b587257
Update pipeline-release.yml
holzi1005 Oct 15, 2024
81f8f3f
Update pipeline-development.yml
holzi1005 Oct 15, 2024
678c16b
Merge pull request #281 from H2-invent/hotfix/workflows
holema Oct 15, 2024
9cbc5e6
Update pipeline-release.yml
holzi1005 Oct 15, 2024
7f600a2
Update pipeline-development.yml
holzi1005 Oct 15, 2024
10f0e5c
Merge pull request #282 from H2-invent/hotfix/workflows2
holema Oct 15, 2024
461288c
Update pipeline-development.yml
holzi1005 Oct 15, 2024
390c1ca
Create RELEASE_NOTE.md
holzi1005 Oct 15, 2024
a63064d
Merge pull request #283 from H2-invent/hotfix/workflow3
holema Oct 15, 2024
92c8e05
Update pipeline-release.yml
holzi1005 Oct 15, 2024
974e3b6
Update pipeline-release.yml
holzi1005 Oct 15, 2024
6bd7d71
Merge pull request #284 from H2-invent/hotfix/workflow4
holema Oct 15, 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
9 changes: 9 additions & 0 deletions .github/workflows/pipeline-development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Run Development Build and Tests
env:
GITHUB_TOKEN: ${{ secrets.token }}

on: push

jobs:
artifact:
uses: h2-invent/open-datenschutzcenter/.github/workflows/task-artifact.yml@master
67 changes: 67 additions & 0 deletions .github/workflows/pipeline-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.token }}

on:
push:
branches:
- main
- master

jobs:
artifact:
uses: h2-invent/open-datenschutzcenter/.github/workflows/task-artifact.yml@master

create_release:
needs:
- artifact
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: paulhatch/[email protected]
id: version
with:
tag_prefix: ""
major_pattern: "(MAJOR)"
minor_pattern: "(MINOR)"
change_path: .
version_format: "${major}.${minor}.${patch}"

- uses: actions/download-artifact@v3
with:
name: artifact_${{github.run_number}}

- run: unzip -qq artifact_${{github.run_number}}.zip -d artifact

- name: Write semantic Version in .env.local
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "laF_version=2.0.0-dev"
replace: "laF_version=${{ steps.version.outputs.version }}"
regex: false
include: "artifact/.env"

- name: Archive Release for application
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'application.zip'
exclusions: '*.git* *.github* /*node_modules/* /*nodejs/* /*var/* .editorconfig'
directory: artifact

- name: Create new Release with semantic-version tag
uses: ncipollo/release-action@v1
id: create_release
with:
draft: true
prerelease: false
name: Release ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.version }}
artifacts: artifact/application.zip
artifactContentType: application/zip
bodyFile: RELEASE_NOTE.md
33 changes: 33 additions & 0 deletions .github/workflows/task-artifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build Artifacts

on: workflow_call

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install PHP Dependencies
uses: php-actions/composer@v6
with:
php_version: ${{ vars.PHP_VERSION }}
php_extensions: ldap xsl zip

- name: Install NPM Packages
uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODE_VERSION }}
- run: npm install
- run: npm run build
- run: rm -r node_modules

- uses: montudor/action-zip@v1
with:
args: zip -qq -r artifact_${{github.run_number}}.zip .

- name: Upload articats
uses: actions/upload-artifact@v3
with:
name: artifact_${{github.run_number}}
path: artifact_${{github.run_number}}.zip
3 changes: 3 additions & 0 deletions RELEASE_NOTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# RELEASE NOTE

* Fix Downlaod of Documents
7 changes: 5 additions & 2 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ x-app-common: &odc_app
services:
traefik-odc:
image: "traefik:v2.5"

restart: unless-stopped
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
Expand Down Expand Up @@ -59,7 +59,7 @@ services:
timeout: 10s
start_period: 30s
retries: 10

restart: unless-stopped
environment:
APP_ENV: "dev"
APACHE_DOCUMENT_ROOT: "public/"
Expand All @@ -81,6 +81,7 @@ services:
MAILER_ENCRYPTION: ${MAILER_ENC}
laF_version: ${GIT_VERSION}
registerEmailAdress: ${registerEmailAdress}
DEFAULT_EMAIL: ${registerEmailAdress}
laF_baseUrl: ${HTTP_METHOD}://${PUBLIC_URL}
VICH_BASE: ${HTTP_METHOD}://${PUBLIC_URL}
CRON_USER_1: root
Expand All @@ -106,6 +107,7 @@ services:
db-odc:
image: mariadb:latest
hostname: ${RANDOMTAG}db-odc
restart: unless-stopped
healthcheck:
test: [ "CMD", "mariadb-admin" ,"ping", "-h", "localhost","-ptest" ]
timeout: 20s
Expand All @@ -120,6 +122,7 @@ services:

keycloak-odc:
image: quay.io/keycloak/keycloak:22.0.3
restart: unless-stopped
depends_on:
app-odc:
condition: service_healthy
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ services:
timeout: 10s
start_period: 30s
retries: 10
restart: unless-stopped

environment:
APACHE_DOCUMENT_ROOT: "public/"
Expand All @@ -91,6 +92,7 @@ services:
MAILER_ENCRYPTION: ${MAILER_ENC}
laF_version: ${GIT_VERSION}
registerEmailAdress: ${registerEmailAdress}
DEFAULT_EMAIL: ${registerEmailAdress}
laF_baseUrl: ${HTTP_METHOD}://${PUBLIC_URL}
VICH_BASE: ${HTTP_METHOD}://${PUBLIC_URL}
CRON_USER_1: docker
Expand Down Expand Up @@ -121,6 +123,7 @@ services:
test: [ "CMD", "mariadb-admin" ,"ping", "-h", "localhost","-ptest" ]
timeout: 20s
retries: 10
restart: unless-stopped
environment:
MARIADB_ROOT_PASSWORD: test
volumes:
Expand Down
2 changes: 1 addition & 1 deletion installDockerDebian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ echo \
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin -y

sudo wget https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-linux-x86_64 -O /usr/local/bin/docker-compose
sudo wget https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64 -O /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose -v

Expand Down
2 changes: 1 addition & 1 deletion installDockerUbuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ echo \
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin

sudo wget https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-linux-x86_64 -O /usr/local/bin/docker-compose
sudo wget https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64 -O /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose -v

Expand Down
10 changes: 9 additions & 1 deletion src/Controller/DatenweitergabeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Symfony\Component\HttpFoundation\HeaderUtils;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
Expand Down Expand Up @@ -216,7 +217,14 @@ public function downloadArticleReference(
return $this->redirectToRoute('dashboard');
}

$type = $datenFilesystem->getMimetype($datenweitergabe->getUpload());
$type = null;
try {
$type = $datenFilesystem->mimeType($datenweitergabe->getUpload());
}catch (\Exception $exception){
throw new NotFoundHttpException('File not found');
}


$response = new Response($stream);
$response->headers->set('Content-Type', $type);
$disposition = HeaderUtils::makeDisposition(
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/FormsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function downloadArticleReference(
return $this->redirectToRoute('dashboard');
}

$type = $formsFilesystem->getMimetype($forms->getUpload());
$type = $formsFilesystem->mimeType($forms->getUpload());
$response = new Response($stream);
$response->headers->set('Content-Type', $type);
$disposition = HeaderUtils::makeDisposition(
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/PoliciesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function downloadArticleReference(
return $this->redirectToRoute('dashboard');
}

$type = $policiesFilesystem->getMimetype($policies->getUpload());
$type = $policiesFilesystem->mimeType($policies->getUpload());
$response = new Response($stream);
$response->headers->set('Content-Type', $type);
$disposition = HeaderUtils::makeDisposition(
Expand Down
75 changes: 75 additions & 0 deletions src/Migrations/Version20241008090501.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241008090501 extends AbstractMigration
{
public function getDescription(): string
{
return 'Cleanup migration to match existing model';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE answer CHANGE question_id question_id INT NOT NULL');
$this->addSql('ALTER TABLE participation CHANGE akademie_buchungen_id akademie_buchungen_id INT DEFAULT NULL, CHANGE passed passed TINYINT(1) NOT NULL, CHANGE state state VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE participation_answer CHANGE participation_id participation_id INT NOT NULL, CHANGE questionnaire_id questionnaire_id INT NOT NULL, CHANGE question_id question_id INT NOT NULL, CHANGE answer_id answer_id INT NOT NULL');
$this->addSql('ALTER TABLE question CHANGE eval_value eval_value DOUBLE PRECISION NOT NULL');
$this->addSql('ALTER TABLE questionnaire CHANGE description description TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE team RENAME INDEX unq_team_name TO UNIQ_C4E0A61F5E237E06');
$this->addSql('ALTER TABLE team_admin MODIFY id INT NOT NULL');
foreach ($schema->getTable('team_admin')->getForeignKeys() as $foreignKey) {
$this->addSql('ALTER TABLE team_admin DROP FOREIGN KEY ' . $foreignKey->getName());
}
$this->addSql('DROP INDEX team_admin_IdX ON team_admin');
$this->addSql('DROP INDEX `primary` ON team_admin');
$this->addSql('ALTER TABLE team_admin DROP id');
$this->addSql('ALTER TABLE team_admin ADD CONSTRAINT FK_4F084436296CD8AE FOREIGN KEY (team_id) REFERENCES team (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE team_admin ADD CONSTRAINT FK_4F084436A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE team_admin ADD PRIMARY KEY (team_id, user_id)');
$this->addSql('ALTER TABLE user RENAME INDEX idx_957a64799e73ac3e TO IDX_8D93D6499E73AC3E');
$this->addSql('ALTER TABLE user_team MODIFY id INT NOT NULL');
foreach ($schema->getTable('user_team')->getForeignKeys() as $foreignKey) {
$this->addSql('ALTER TABLE user_team DROP FOREIGN KEY ' . $foreignKey->getName());
}
$this->addSql('DROP INDEX user_team_IdX ON user_team');
$this->addSql('DROP INDEX `primary` ON user_team');
$this->addSql('ALTER TABLE user_team DROP id');
$this->addSql('ALTER TABLE user_team ADD CONSTRAINT FK_BE61EAD6A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_team ADD CONSTRAINT FK_BE61EAD6296CD8AE FOREIGN KEY (team_id) REFERENCES team (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_team ADD PRIMARY KEY (user_id, team_id)');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE answer CHANGE question_id question_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE participation CHANGE akademie_buchungen_id akademie_buchungen_id INT NOT NULL, CHANGE state state VARCHAR(255) DEFAULT \'assigned\' NOT NULL, CHANGE passed passed TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE participation_answer CHANGE participation_id participation_id INT DEFAULT NULL, CHANGE questionnaire_id questionnaire_id INT DEFAULT NULL, CHANGE question_id question_id INT DEFAULT NULL, CHANGE answer_id answer_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE question CHANGE eval_value eval_value DOUBLE PRECISION DEFAULT \'1\' NOT NULL');
$this->addSql('ALTER TABLE questionnaire CHANGE description description VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE team RENAME INDEX uniq_c4e0a61f5e237e06 TO UNQ_team_name');
$this->addSql('ALTER TABLE team_admin DROP FOREIGN KEY FK_4F084436296CD8AE');
$this->addSql('ALTER TABLE team_admin DROP FOREIGN KEY FK_4F084436A76ED395');
$this->addSql('ALTER TABLE team_admin ADD id INT AUTO_INCREMENT NOT NULL, DROP PRIMARY KEY, ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE team_admin ADD CONSTRAINT RFX_team_id_team_admin_6704f59cda29d FOREIGN KEY (team_id) REFERENCES team (id)');
$this->addSql('ALTER TABLE team_admin ADD CONSTRAINT RFX_user_id_team_admin_6704f59cda242 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE UNIQUE INDEX team_admin_IdX ON team_admin (id)');
$this->addSql('ALTER TABLE user RENAME INDEX idx_8d93d6499e73ac3e TO IDX_957A64799E73AC3E');
$this->addSql('ALTER TABLE user_team DROP FOREIGN KEY FK_BE61EAD6A76ED395');
$this->addSql('ALTER TABLE user_team DROP FOREIGN KEY FK_BE61EAD6296CD8AE');
$this->addSql('ALTER TABLE user_team ADD id INT AUTO_INCREMENT NOT NULL, DROP PRIMARY KEY, ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE user_team ADD CONSTRAINT RFX_team_id_user_team_6704f59cda128 FOREIGN KEY (team_id) REFERENCES team (id)');
$this->addSql('ALTER TABLE user_team ADD CONSTRAINT RFX_user_id_user_team_6704f59cd9f23 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE UNIQUE INDEX user_team_IdX ON user_team (id)');
}
}
Loading