Skip to content

Commit f06eafc

Browse files
authored
Full rework on solution v1.1 (#453)
* Rework phase 1 * Rename mapping profiles * Delete .DotSettings.user file * Fix integration tests * Update README * Move angular-bootstrap to angular * Validate Angular local run * Prepare angular mig * Migration to Angular 17 (from 16) * Migrate to Angular 18 (from 17) * Migrate to Angular 19 (from 18) * Upgrade to Angular 20 (from 19) * Rename Dal.MongoDb in Infrastructure.MongoDb * Fix string null * Migrate to Angular v21 * Use inject instead of constructors * Update npm packages * Delete BlazorWebAssemblyApp * Add BlazorApp with Firebase auth * Add calls to api from blazor * Update web design of blazor app * Improve movie list * Manage paged list and app restart for api token * Make a generic client * Create all Api clients * Rename to Common.System * Add generics for books * Small code changes * Move angular folder to samples folder * Merge gitignore * Move dotnet README to CONTRIBUTING * Move dotnet folder content to root folder * Rename KeepTrack in Keeptrack * Add GitHub Actions files * Add TV Shows and Video Games * Improve urls * Update pipelines * Fix yaml errors on azure pipeline definitions * Fix Dockerfile * Add test env * Add MongoDB install script * Make script executable * Improve pipelines * Improve code from Sonar warnings * Use a fixed version of the reusable workflow * Update pipelines * Pass bool as bools in var ci * Remove double quotes in ci additional/extra vars * Improve pipelines * Fix azure pipeline
1 parent e6d8f6e commit f06eafc

370 files changed

Lines changed: 17860 additions & 27386 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.azure/pipelines/cd.json

Lines changed: 0 additions & 549 deletions
This file was deleted.

.azure/pipelines/ci.yml

Lines changed: 31 additions & 201 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,29 @@
1-
# Azure pipeline definition for the integration of the solution (continuous integration)
2-
31
trigger:
4-
batch: false
2+
batch: true
53
branches:
64
include:
75
- main
86
paths:
97
exclude:
108
- README.md
119

12-
pr: none
13-
# pr:
14-
# autoCancel: true
15-
# branches:
16-
# include:
17-
# - master
18-
# paths:
19-
# exclude:
20-
# - README.md
21-
# - .azure/pipelines/nightly.yml
22-
# - .azure/pipelines/pkg.yml
23-
# - .azure/pipelines/cd.json
24-
25-
schedules:
26-
- cron: "0 0 * * *"
27-
displayName: "Daily midnight build"
28-
branches:
29-
include:
30-
- main
31-
always: true
10+
pr: none
3211

3312
variables:
34-
# library variable groups
35-
- group: "build-tools"
36-
- group: "devproapp-testing"
37-
# common task variables
3813
- name: "dotnet.sdk.version"
39-
value: "9.0.x"
14+
value: "10.0.x"
15+
- name: "dotnet.cache.disable"
16+
value: "false"
4017
- name: "BuildConfiguration"
4118
value: "Debug"
4219
- name: "SolutionFile"
43-
value: "KeepTrack.sln"
20+
value: "Keeptrack.slnx"
4421
- name: "TestProjects"
4522
value: "test/*Tests/*.csproj"
4623
- name: "UnitTestProjects"
4724
value: "test/*UnitTests/*.csproj"
48-
- name: "IntegrationTestProjects"
49-
value: "test/*IntegrationTests/*.csproj"
50-
# tool variables (Sonar)
51-
- name: "sonar.project.name"
52-
value: "KeepTrack"
53-
- name: "sonar.project.key"
54-
value: "devpro.keep-track"
55-
# specific variables
56-
- name: "angular.cli.version"
57-
value: "16.2.6"
58-
- name: "angular.path"
59-
value: "angular-bootstrap"
60-
- name: "blazorwasm.path"
61-
value: "dotnet/src/BlazorWebAssemblyApp"
62-
- name: "dotnet.path"
63-
value: "dotnet"
64-
- name: "nodejs.version.spec"
65-
value: "22.x"
6625

6726
stages:
68-
# Unit testing
6927
- stage: "unit_testing"
7028
displayName: "Unit testing"
7129
jobs:
@@ -74,85 +32,38 @@ stages:
7432
pool:
7533
vmImage: "ubuntu-latest"
7634
steps:
77-
- task: NodeTool@0
78-
displayName: "Install Node.js"
79-
inputs:
80-
versionSpec: $(nodejs.version.spec)
81-
- task: Npm@1
82-
displayName: "Install Angular CLI"
83-
inputs:
84-
command: "custom"
85-
customCommand: "install -g @angular/cli@$(angular.cli.version)"
8635
- task: UseDotNet@2
8736
displayName: "Use .NET Core SDK"
8837
inputs:
8938
packageType: "sdk"
9039
version: $(dotnet.sdk.version)
91-
- task: Npm@1
92-
displayName: "Install NPM packages for Blazor WASM"
93-
inputs:
94-
command: "install"
95-
workingDir: $(blazorwasm.path)
96-
- task: Bash@3
97-
displayName: "Write Blazor WASM configuration files"
98-
inputs:
99-
targetType: "inline"
100-
script: |
101-
bash ./scripts/write_blazorconfig.sh $(blazorwasm.path)/wwwroot $(firebase.apikey) $(firebase.projectid) $(firebase.messagingsenderid) $(firebase.appid) $(firebase.measurementid) https://localhost:5011
102-
- task: Npm@1
103-
displayName: "Run WebPack"
104-
inputs:
105-
command: "custom"
106-
customCommand: "run webpack:dev"
107-
workingDir: $(blazorwasm.path)
10840
- task: DotNetCoreCLI@2
10941
displayName: "Build .NET solution"
11042
inputs:
11143
command: "build"
112-
projects: "$(dotnet.path)/$(SolutionFile)"
44+
projects: "$(SolutionFile)"
11345
arguments: "-c $(BuildConfiguration)"
11446
env:
11547
DOTNET_CLI_TELEMETRY_OPTOUT: 1
116-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
117-
COREHOST_TRACE: 0
48+
DOTNET_NOLOGO: 1
11849
- task: DotNetCoreCLI@2
11950
displayName: "Run .NET unit tests"
12051
inputs:
12152
command: "test"
122-
projects: "$(dotnet.path)/$(UnitTestProjects)"
53+
projects: "$(UnitTestProjects)"
12354
arguments: "--configuration $(BuildConfiguration)"
12455
env:
12556
DOTNET_CLI_TELEMETRY_OPTOUT: 1
126-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
127-
COREHOST_TRACE: 0
128-
- task: Npm@1
129-
displayName: "Install NPM packages at $(angular.path)"
130-
inputs:
131-
command: "install"
132-
workingDir: $(angular.path)
133-
- task: Bash@3
134-
displayName: "Write environment.dev.ts file"
135-
inputs:
136-
targetType: "inline"
137-
script: |
138-
bash ./scripts/write_angularconfig.sh $(angular.path)/src/environments/environment.dev.ts $(firebase.apikey) $(firebase.projectid) $(firebase.messagingsenderid) $(firebase.appid) $(firebase.measurementid) https://localhost:5011
139-
- task: Npm@1
140-
displayName: "Run Angular unit tests"
141-
inputs:
142-
command: "custom"
143-
customCommand: "run test:ci"
144-
workingDir: $(angular.path)
57+
DOTNET_NOLOGO: 1
14558

146-
# Integration testing
14759
- stage: "integration_testing"
14860
displayName: "Integration testing"
149-
dependsOn: [] # no dependencies: run at the same time as the unit testing stage
61+
dependsOn: []
15062
condition: eq(variables['RunIntegrationTestingStage'], true)
15163
jobs:
15264
- job: "windows_integrationtests"
15365
displayName: "Windows CI"
15466
pool:
155-
# code coverage generation only works on Windows for the moment
15667
vmImage: "windows-latest"
15768
steps:
15869
- task: UseDotNet@2
@@ -169,128 +80,47 @@ stages:
16980
md log
17081
md data
17182
Start-Process -FilePath "mongod" -ArgumentList "--logpath log/mongod.log", "--dbpath data", "--port 27017" -WindowStyle Hidden
172-
- task: NodeTool@0
173-
displayName: "Install Node.js"
174-
inputs:
175-
versionSpec: $(nodejs.version.spec)
176-
- task: Npm@1
177-
displayName: "Install Angular CLI"
178-
inputs:
179-
command: "custom"
180-
customCommand: "install -g @angular/cli@$(angular.cli.version)"
181-
- task: Npm@1
182-
displayName: "Install NPM packages at $(blazorwasm.path)"
183-
inputs:
184-
command: "install"
185-
workingDir: $(blazorwasm.path)
186-
- task: Bash@3
187-
displayName: "Write firebase.configfile"
188-
inputs:
189-
targetType: "inline"
190-
script: |
191-
chmod +x ./scripts/*.sh
192-
bash ./scripts/write_blazorconfig.sh $(blazorwasm.path)/wwwroot $(firebase.apikey) $(firebase.projectid) $(firebase.messagingsenderid) $(firebase.appid) $(firebase.measurementid) https://localhost:5011
193-
- task: Npm@1
194-
displayName: "Run WebPack at $(blazorwasm.path)"
195-
inputs:
196-
command: "custom"
197-
customCommand: "run webpack:dev"
198-
workingDir: $(blazorwasm.path)
19983
- task: DotNetCoreCLI@2
20084
displayName: "Restore .NET packages"
20185
inputs:
20286
command: "restore"
203-
projects: "$(dotnet.path)/$(SolutionFile)"
87+
projects: "$(SolutionFile)"
20488
feedsToUse: "select"
20589
noCache: $(dotnet.cache.disable)
20690
env:
20791
DOTNET_CLI_TELEMETRY_OPTOUT: 1
208-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
209-
COREHOST_TRACE: 0
210-
- task: SonarCloudPrepare@1
211-
displayName: "Prepare code analysis"
212-
inputs:
213-
SonarCloud: "$(sonar.instance)"
214-
organization: "$(sonar.organization)"
215-
scannerMode: "MSBuild"
216-
projectKey: "$(sonar.project.key)"
217-
projectName: "$(sonar.project.name)"
218-
extraProperties: |
219-
sonar.cpd.exclusions=**/*.Domain/*Model.cs,**/*.Dto/*Dto.cs
220-
sonar.exclusions=**/node_modules/**,**/*.spec.ts,**/e2e/**,**/coverage/**
221-
sonar.typescript.tsconfigPath=$(angular.path)/tslint.json
222-
sonar.typescript.lcov.reportPaths=$(angular.path)/coverage/lcov.info
92+
DOTNET_NOLOGO: 1
22393
- task: DotNetCoreCLI@2
22494
displayName: "Build .NET solution"
22595
inputs:
22696
command: "build"
227-
projects: "$(dotnet.path)/$(SolutionFile)"
97+
projects: "$(SolutionFile)"
22898
arguments: "-c $(BuildConfiguration)"
22999
env:
230100
DOTNET_CLI_TELEMETRY_OPTOUT: 1
231-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
232-
COREHOST_TRACE: 0
101+
DOTNET_NOLOGO: 1
233102
- task: DotNetCoreCLI@2
234103
displayName: "Run .NET test projects"
235104
inputs:
236105
command: "test"
237-
projects: "$(dotnet.path)/$(TestProjects)"
238-
arguments: '--configuration $(BuildConfiguration) --filter "Environment=Localhost|Category=UnitTests" --collect "Code coverage"'
106+
projects: "$(TestProjects)"
107+
arguments: '--configuration $(BuildConfiguration) --report-xunit-trx --coverage --coverage-output-format cobertura -- --filter-query "/[(Category=UnitTests)|(Mode=Readonly)]"'
239108
env:
240109
DOTNET_CLI_TELEMETRY_OPTOUT: 1
241-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
242-
COREHOST_TRACE: 0
243-
AllowedOrigins__0: http://localhost:4200
244-
Infrastructure__MongoDB__ConnectionString: mongodb://localhost:27017
245-
Infrastructure__MongoDB__DatabaseName: keeptrack_integrationtests
246-
Authentication__JtBearer__TokenValidation__Issuer: $(keeptrack.jwtbearer.tokenvalidation.issuer)
247-
Authentication__JwtBearer__Authority: $(keeptrack.jwtbearer.authority)
248-
Authentication__JwtBearer__TokenValidation__Audience: $(keeptrack.jwtbearer.tokenvalidation.audience)
249-
Firebase__Application__Key: $(firebase.apikey)
250-
Firebase__Username: $(firebase.testing.user0.username)
251-
Firebase__Password: $(firebase.testing.user0.password)
252-
- task: Npm@1
253-
displayName: "Install NPM packages at $(angular.path)"
254-
inputs:
255-
command: "install"
256-
workingDir: $(angular.path)
257-
- task: Npm@1
258-
displayName: "Run Angular lint"
259-
inputs:
260-
command: "custom"
261-
customCommand: "run lint"
262-
workingDir: $(angular.path)
263-
- task: Bash@3
264-
displayName: "Write Angular environment file"
265-
inputs:
266-
targetType: "inline"
267-
script: |
268-
bash ./scripts/write_angularconfig.sh $(angular.path)/src/environments/environment.dev.ts $(firebase.apikey) $(firebase.projectid) $(firebase.messagingsenderid) $(firebase.appid) $(firebase.measurementid) https://localhost:5011
269-
- task: Npm@1
270-
displayName: "Run Angular unit tests"
271-
inputs:
272-
command: "custom"
273-
customCommand: "run test:ci"
274-
workingDir: $(angular.path)
275-
- task: PublishTestResults@2
276-
displayName: "Publish Angular test results"
277-
inputs:
278-
testResultsFormat: "JUnit"
279-
testResultsFiles: "**/TESTS-*.xml"
280-
searchFolder: "$(angular.path)"
281-
- task: SonarCloudAnalyze@1
282-
displayName: "Analyze the code with Sonar"
283-
- task: SonarCloudPublish@1
284-
displayName: "Publish the code analysis results"
285-
inputs:
286-
pollingTimeoutSec: "300"
287-
- task: CopyFiles@2
288-
displayName: "Copy screenshots"
289-
condition: failed()
290-
inputs:
291-
Contents: "**/screenshot*.png"
292-
TargetFolder: "$(Build.ArtifactStagingDirectory)"
293-
flattenFolders: true
110+
DOTNET_NOLOGO: 1
111+
# - task: CmdLine@2
112+
# displayName: "Run .NET test projects"
113+
# inputs:
114+
# script: >
115+
# dotnet test
116+
# --configuration $(BuildConfiguration)
117+
# --report-xunit-trx
118+
# --coverage
119+
# --coverage-output-format cobertura
120+
# -- --filter-query "/[(Category=UnitTests)|(Mode=Readonly)]"
121+
# env:
122+
# DOTNET_CLI_TELEMETRY_OPTOUT: 1
123+
# DOTNET_NOLOGO: 1
294124
- task: PublishBuildArtifacts@1
295125
displayName: "Publish artifacts"
296126
condition: failed()

0 commit comments

Comments
 (0)