Skip to content

Commit

Permalink
Improvement of the folder structure (#749)
Browse files Browse the repository at this point in the history
* chore: reorganize folder structure (appsettings.override.json not found)

* refactor: adapt dockerfiles to new directories

* wip

* fix: add correct path to dockerfile

* chore: move Files.Jobs.SanityCheck to Executables folder

* chore: add adminUi and helm to project

* fix: remove old folder

* fix: adpot to new file path

* fix: update build container images

* fix: ConsumerApi dockerfile

* fix: correct pathing for ConsumerApi

* fix: more dockerfiles

* fix: pathing

* fix: DatabaseMigrator files

* fix: update github workflows test.yml

* fix: more dockerfile fixes

* fix: dockerfiles

* chore: remove lest over pasted line

* fix: unit tests

* fix: update unit tests

* fix: container and unit tests

* fix: multiple unit test fixes

* fix: copy path

* fix: correct dotnet restore path

* fix: holpefully paths are correct now

* fix: container image

* fix: helm

* fix: add holder path

* Revert "fix: add holder path"

This reverts commit a7c8b98.

* Revert "fix: helm"

This reverts commit 3ac7ed5.

* fix: edit path in pubspec.lock to fix flutter check

* Revert "fix: edit path in pubspec.lock to fix flutter check"

This reverts commit f0c0941.

* fix: path

* Revert "fix: path"

This reverts commit 259e626.

* fix: potential fix for helm chart

* Revert "fix: potential fix for helm chart"

This reverts commit 4aeb05c.

* fix: potential fix for helm chart

* fix: FilesSanityCheck paths

* fix: correct the path

* fix: path for Job.IdentityDeletion

* fix: typo

* fix: DatabaseMigrator dockerfile

* fix: github workflow path

* fix: invisible character

* ci: downgrade node-version

* fix: adapt moved csproj files

* fix: update appsettings.override path

* fix: path for integration tests

* fix: remove unused dependency

* update version

* fix: git ignore pathing for packages

* fix:  EntityFrameworkCore version for AdminApi & formatting issues

* fix: change password for database-migrator

* Revert "fix: change password for database-migrator"

This reverts commit d51068f.

* fix: change password

* Revert "fix: change password"

This reverts commit 635b2b5.

* chore: move AdminCli to Executable folder & fix pathing

* fix: AdminCli pathing

* fix: pathing in copy

* fix: pathing again

* fix: pathing fro copy app

* fix: revert to original state

* fix: update path

* fix: AdminCli pathing

* chore: fix namespaces in FilesSanityCheck

* chore: improve integration tests

* fix: pathing to appsettings.override.json

* fix: correct the appsettings.override.json path for ConsumerApi

* chore: remove unused usings

* chore: appsettings.override.json

* chore: edit gitignore hardlinks

* fix: csproj file and add GET.feature

* fix: replace backslash with slash

* chore: remove leftover appsettings.override.json

* fix: AdminCli namespaces

* fix: add reference to AdminApi.Infrastructure.Database.Postgres to AdminApi.csproj

* chore: add missing slash

* chore: move newly added files from main into correct folders

* chore: add missing slash for other buildDockerImage files

* chore: rename Executables folder to Applications

* fix: remove unused usings in order to fix identity-deletion-job integration tests

* chore: remove appsettings.override.json and add it to .gitignore

* chore: remove redundant newline

* fix: rollback change to the references

* fix: ArchUnit.csproj rollback change to the refereces

* fix: revert original reference in EventHandlerService.Tests.csproj

* refactor: add recursive match for any directory level

* ci: only restore and build the test project and its dependencies, instead of the whole solution

* ci: add debug ls commands

* ci: add debug cat commands

* test: include appsettings.override.json in Job.IdentityDeletion.Tests.Integration.csproj

* test: fix appsettings path

* ci: remove debug output

* fix: use AdminUi location

* fix: use correct path in runChecks.sh

* fix: use correct Program file

* chore: remove unused favicon.ico from AdminApi

* chore: move AdminApi.Sdk & ComsumerApi.Sdk to Sdks folder

* chore: move sql scripts to scripts folder

* chore: remove openapi.yml

* chore: use correct script name in compose file of pipelines

* ci: fix script paths

* ci: remove volume from compose.test.yml

* chore: nest AdminApi.Sdk & ComsumerApi.Sdk to src folder

* fix: add new AdminUi files missing from merge conflict

* fix: more missing files from failed merge conflict

* chore: move helm folder to repo root

* chore: remove helm from solution

---------

Co-authored-by: Timo Notheisen <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 30, 2024
1 parent 5a22ae5 commit 05eb9c5
Show file tree
Hide file tree
Showing 695 changed files with 1,136 additions and 1,752 deletions.
2 changes: 1 addition & 1 deletion .ci/acli/buildContainerImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const tag = getRequiredEnvVar("TAG");
const platforms = process.env.PLATFORMS ?? "linux/amd64,linux/arm64";
const push = process.env.PUSH === "1" ? ["--push", "--provenance=true", "--sbom=true"] : "";

await $`docker buildx build --file ./Modules/Devices/src/Devices.AdminCli/Dockerfile --tag ghcr.io/nmshd/backbone-admin-cli:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
await $`docker buildx build --file ./Applications/AdminCli/src/AdminCli/Dockerfile --tag ghcr.io/nmshd/backbone-admin-cli:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
2 changes: 1 addition & 1 deletion .ci/aui/buildContainerImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const tag = getRequiredEnvVar("TAG");
const platforms = process.env.PLATFORMS ?? "linux/amd64,linux/arm64";
const push = process.env.PUSH === "1" ? ["--push", "--provenance=true", "--sbom=true"] : "";

await $`docker buildx build --file ./AdminApi/src/AdminApi/Dockerfile --tag ghcr.io/nmshd/backbone-admin-ui:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
await $`docker buildx build --file ./Applications/AdminApi/src/AdminApi/Dockerfile --tag ghcr.io/nmshd/backbone-admin-ui:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
3 changes: 2 additions & 1 deletion .ci/aui/runChecks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
set -e
set -x

cd AdminUi
INITIAL_DIR=$(pwd)
cd Applications/AdminUi
dart pub global activate melos
melos bootstrap
melos analyze
Expand Down
2 changes: 1 addition & 1 deletion .ci/capi/buildContainerImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const tag = getRequiredEnvVar("TAG");
const platforms = process.env.PLATFORMS ?? "linux/amd64,linux/arm64";
const push = process.env.PUSH === "1" ? ["--push", "--provenance=true", "--sbom=true"] : "";

await $`docker buildx build --file ./ConsumerApi/Dockerfile --tag ghcr.io/nmshd/backbone-consumer-api:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
await $`docker buildx build --file ./Applications/ConsumerApi/src/Dockerfile --tag ghcr.io/nmshd/backbone-consumer-api:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
4 changes: 3 additions & 1 deletion .ci/compose.test.postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ services:
### seeds ###

seed-database:
volumes:
- ../scripts/sql/postgres:/app/sql-scripts
image: postgres
environment:
- PGPASSWORD=Passw0rd
command: psql -h postgres -U postgres -d enmeshed -f /app/setup-db/setup-postgres.sql
command: psql -h postgres -U postgres -d enmeshed -f /app/sql-scripts/setup.sql

admin-cli:
environment:
Expand Down
4 changes: 3 additions & 1 deletion .ci/compose.test.sqlserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ services:
### seeds ###

seed-database:
volumes:
- ../scripts/sql/sqlserver:/app/sql-scripts
image: mcr.microsoft.com/mssql-tools
command: bash -c " sleep 20 && /opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P Passw0rd -i /app/setup-db/setup-sqlserver.sql "
command: bash -c " sleep 20 && /opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P Passw0rd -i /app/sql-scripts/setup.sql"

admin-cli:
environment:
Expand Down
2 changes: 0 additions & 2 deletions .ci/compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ services:
### seeds ###

seed-database:
volumes:
- ../setup-db:/app/setup-db
depends_on:
database:
condition: service_healthy
Expand Down
2 changes: 1 addition & 1 deletion .ci/dbm/buildContainerImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const tag = getRequiredEnvVar("TAG");
const platforms = process.env.PLATFORMS ?? "linux/amd64,linux/arm64";
const push = process.env.PUSH === "1" ? ["--push", "--provenance=true", "--sbom=true"] : "";

await $`docker buildx build --file ./DatabaseMigrator/Dockerfile --tag ghcr.io/nmshd/backbone-database-migrator:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
await $`docker buildx build --file ./Applications/DatabaseMigrator/src/DatabaseMigrator/Dockerfile --tag ghcr.io/nmshd/backbone-database-migrator:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
2 changes: 1 addition & 1 deletion .ci/eh/buildContainerImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const tag = getRequiredEnvVar("TAG");
const platforms = process.env.PLATFORMS ?? "linux/amd64,linux/arm64";
const push = process.env.PUSH === "1" ? ["--push", "--provenance=true", "--sbom=true"] : "";

await $`docker buildx build --file ./EventHandlerService/src/EventHandlerService/Dockerfile --tag ghcr.io/nmshd/backbone-event-handler:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
await $`docker buildx build --file ./Applications/EventHandlerService/src/EventHandlerService/Dockerfile --tag ghcr.io/nmshd/backbone-event-handler:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
2 changes: 1 addition & 1 deletion .ci/fsc/buildContainerImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const tag = getRequiredEnvVar("TAG");
const platforms = process.env.PLATFORMS ?? "linux/amd64,linux/arm64";
const push = process.env.PUSH === "1" ? ["--push", "--provenance=true", "--sbom=true"] : "";

await $`docker buildx build --file ./Modules/Files/src/Files.Jobs.SanityCheck/Dockerfile --tag ghcr.io/nmshd/backbone-files-sanity-check:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
await $`docker buildx build --file ./Applications/FilesSanityCheck/src/FilesSanityCheck/Dockerfile --tag ghcr.io/nmshd/backbone-files-sanity-check:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
2 changes: 1 addition & 1 deletion .ci/idj/buildContainerImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const tag = getRequiredEnvVar("TAG");
const platforms = process.env.PLATFORMS ?? "linux/amd64,linux/arm64";
const push = process.env.PUSH === "1" ? ["--push", "--provenance=true", "--sbom=true"] : "";

await $`docker buildx build --file ./Jobs/src/Job.IdentityDeletion/Dockerfile --tag ghcr.io/nmshd/backbone-identity-deletion-jobs:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
await $`docker buildx build --file ./Applications/IdentityDeletionJobs/src/Job.IdentityDeletion/Dockerfile --tag ghcr.io/nmshd/backbone-identity-deletion-jobs:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
2 changes: 1 addition & 1 deletion .ci/sses/buildContainerImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const tag = getRequiredEnvVar("TAG");
const platforms = process.env.PLATFORMS ?? "linux/amd64,linux/arm64";
const push = process.env.PUSH === "1" ? ["--push", "--provenance=true", "--sbom=true"] : "";

await $`docker buildx build --file ./SseServer/src/SseServer/Dockerfile --tag ghcr.io/nmshd/backbone-sse-server:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
await $`docker buildx build --file ./Applications/SseServer/src/SseServer/Dockerfile --tag ghcr.io/nmshd/backbone-sse-server:${tag} --platform ${platforms} --build-arg VERSION=${tag} ${push} .`;
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
* @tnotheis
/AdminUi/ @jkoenig134
/Applications/AdminUi/ @jkoenig134
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ updates:
##### Admin UI Flutter App#####
- package-ecosystem: "pub"
directories:
- "/AdminUi/apps/admin_ui"
- "/AdminUi/packages/admin_api_sdk"
- "/AdminUi/packages/admin_api_types"
- "/Applications/AdminUi/apps/admin_ui"
- "/Applications/AdminUi/packages/admin_api_sdk"
- "/Applications/AdminUi/packages/admin_api_types"
schedule:
interval: "weekly"
groups:
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,28 +92,28 @@ jobs:
fail-fast: false
matrix:
include:
- dockerfile: ConsumerApi/Dockerfile
- dockerfile: Applications/ConsumerApi/src/Dockerfile
image: consumer-api

- dockerfile: AdminApi/src/AdminApi/Dockerfile
- dockerfile: Applications/AdminApi/src/AdminApi/Dockerfile
image: admin-ui

- dockerfile: Modules/Devices/src/Devices.AdminCli/Dockerfile
- dockerfile: Applications/AdminCli/src/AdminCli/Dockerfile
image: admin-cli

- dockerfile: DatabaseMigrator/Dockerfile
- dockerfile: Applications/DatabaseMigrator/src/DatabaseMigrator/Dockerfile
image: database-migrator

- dockerfile: EventHandlerService/src/EventHandlerService/Dockerfile
- dockerfile: Applications/EventHandlerService/src/EventHandlerService/Dockerfile
image: event-handler-service

- dockerfile: Modules/Files/src/Files.Jobs.SanityCheck/Dockerfile
- dockerfile: Applications/FilesSanityCheck/src/FilesSanityCheck/Dockerfile
image: files-sanity-check

- dockerfile: Jobs/src/Job.IdentityDeletion/Dockerfile
- dockerfile: Applications/IdentityDeletionJobs/src/Job.IdentityDeletion/Dockerfile
image: identity-deletion-jobs

- dockerfile: SseServer/src/SseServer/Dockerfile
- dockerfile: Applications/SseServer/src/SseServer/Dockerfile
image: sse-server

steps:
Expand Down Expand Up @@ -179,11 +179,11 @@ jobs:
database: [sqlserver, postgres]
test-project:
- display-name: admin-api
path: AdminApi/test/AdminApi.Tests.Integration
path: Applications/AdminApi/test/AdminApi.Tests.Integration
- display-name: consumer-api
path: ConsumerApi.Tests.Integration
path: Applications/ConsumerApi/test/ConsumerApi.Tests.Integration
- display-name: identity-deletion-job
path: Jobs/test/Job.IdentityDeletion.Tests.Integration
path: Applications/IdentityDeletionJobs/test/Job.IdentityDeletion.Tests.Integration
needs: image-test-builds
steps:
- name: Checkout
Expand Down Expand Up @@ -224,9 +224,8 @@ jobs:
mv appsettings.override.json appsettings.override.json.bak
cp .ci/appsettings.override.${{matrix.database}}.local.json appsettings.override.json
dotnet restore Backbone.sln
dotnet build --no-restore Backbone.sln
dotnet restore ${{matrix.test-project.path}}
dotnet build --no-restore ${{matrix.test-project.path}}
}
wait
Expand Down
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,7 @@ dist
**/SpecFlow/

# flutter
!AdminUi/packages/*
!Applications/AdminUi/packages/*

# Hardlinks for appsettings.override.json
AdminApi/src/AdminApi/appsettings.override.json
ConsumerApi/appsettings.override.json
DatabaseMigrator/appsettings.override.json
EventHandlerService/src/EventHandlerService/appsettings.override.json
Jobs/src/Job.IdentityDeletion/appsettings.override.json
Applications/**/appsettings.override.json
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Launch current dart file",
"request": "launch",
"type": "dart",
"toolArgs": ["--dart-define-from-file=${workspaceFolder}/AdminUi/config.local.json"],
"toolArgs": ["--dart-define-from-file=${workspaceFolder}/Applications/AdminUi/config.local.json"],
"templateFor": ""
}
]
Expand Down
7 changes: 0 additions & 7 deletions AdminApi.Sdk/AdminApi.Sdk.csproj

This file was deleted.

This file was deleted.

This file was deleted.

Binary file removed AdminApi/src/AdminApi/wwwroot/favicon.ico
Binary file not shown.

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\AdminApi.Infrastructure\AdminApi.Infrastructure.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\..\..\..\BuildingBlocks\src\BuildingBlocks.Infrastructure\BuildingBlocks.Infrastructure.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="8.0.2"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\BuildingBlocks\src\BuildingBlocks.API\BuildingBlocks.API.csproj"/>
<ProjectReference Include="..\..\..\Modules\Challenges\src\Challenges.Application\Challenges.Application.csproj"/>
<ProjectReference Include="..\..\..\Modules\Challenges\src\Challenges.Infrastructure\Challenges.Infrastructure.csproj"/>
<ProjectReference Include="..\..\..\Modules\Devices\src\Devices.Application\Devices.Application.csproj"/>
<ProjectReference Include="..\..\..\Modules\Devices\src\Devices.Infrastructure\Devices.Infrastructure.csproj"/>
<ProjectReference Include="..\..\..\Infrastructure\Infrastructure.csproj"/>
<ProjectReference Include="..\..\..\Modules\Quotas\src\Quotas.Application\Quotas.Application.csproj"/>
<ProjectReference Include="..\..\..\Modules\Quotas\src\Quotas.Infrastructure\Quotas.Infrastructure.csproj"/>
<ProjectReference Include="..\..\..\..\BuildingBlocks\src\BuildingBlocks.API\BuildingBlocks.API.csproj"/>
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Application\Challenges.Application.csproj"/>
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Infrastructure\Challenges.Infrastructure.csproj"/>
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Application\Devices.Application.csproj"/>
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Infrastructure\Devices.Infrastructure.csproj"/>
<ProjectReference Include="..\..\..\..\Infrastructure\Infrastructure.csproj"/>
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Application\Quotas.Application.csproj"/>
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Infrastructure\Quotas.Infrastructure.csproj"/>
<ProjectReference Include="..\AdminApi.Infrastructure.Database.Postgres\AdminApi.Infrastructure.Database.Postgres.csproj"/>
<ProjectReference Include="..\AdminApi.Infrastructure.Database.SqlServer\AdminApi.Infrastructure.Database.SqlServer.csproj"/>
<ProjectReference Include="..\AdminApi.Infrastructure\AdminApi.Infrastructure.csproj"/>
</ItemGroup>

<Target Name="PreBuild" BeforeTargets="Build" Condition="$(Configuration) == Debug">
<Delete Files="$(ProjectDir)appsettings.override.json"/>
<Copy SourceFiles="..\..\..\appsettings.override.json" DestinationFolder="$(ProjectDir)" UseHardlinksIfPossible="true"/>
<Copy SourceFiles="..\..\..\..\appsettings.override.json" DestinationFolder="$(ProjectDir)" UseHardlinksIfPossible="true"/>
</Target>
</Project>
</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.action-buttons {
margin-top: 25px;
display: flex;
justify-content: flex-end;
}

.action-buttons button {
margin: 5px;
}

.disabled-container {
pointer-events: none;
opacity: 0.4;
}

.loading {
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
position: absolute;
margin-top: -60px;
width: 90%;
height: 90%;
}

.client-secret-warning-container {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
background-color: #f39e5f;
}

.client-secret-warning {
color: #ffffff;
font-weight: 500;
padding: 10px;
}

.form-details {
display: flex;
flex-direction: column;
align-items: flex-start;
min-width: 150px;
width: 100%;
}

.form-field {
width: 100%;
margin-bottom: 20px;
}

.form-card {
margin-top: 60px;
min-height: 250px;
}
Loading

0 comments on commit 05eb9c5

Please sign in to comment.