diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index ebab12145..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "root": true, - "ignorePatterns": [ - "projects/**/*", - "*.css" - ], - "overrides": [ - { - "files": [ - "*.ts" - ], - "parserOptions": { - "project": [ - "tsconfig.json" - ], - "createDefaultProgram": true - }, - "extends": [ - "plugin:@angular-eslint/recommended", - "plugin:@angular-eslint/template/process-inline-templates", - "plugin:prettier/recommended" - ], - "rules": { - "@angular-eslint/directive-selector": [ - "error", - { - "type": "attribute", - "prefix": "app", - "style": "camelCase" - } - ], - "@angular-eslint/component-selector": [ - "error", - { - "type": "element", - "prefix": "app", - "style": "kebab-case" - } - ] - } - }, - { - "files": [ - "*.html" - ], - "extends": [ - "plugin:@angular-eslint/template/recommended" - ], - "rules": {} - }, - { - "files": ["*.html"], - "excludedFiles": ["*inline-template-*.component.html"], - "extends": ["plugin:prettier/recommended"], - "rules": { - // NOTE: WE ARE OVERRIDING THE DEFAULT CONFIG TO ALWAYS SET THE PARSER TO ANGULAR (SEE BELOW) - "prettier/prettier": ["error", { "parser": "angular" }] - } - } - - ] -} diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f47cb703a..9060b7d91 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,13 +3,13 @@ # Please see the documentation for all configuration options: # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file -# version: 2 -# updates: -# - package-ecosystem: "npm" -# directory: "/" -# schedule: -# interval: "weekly" -# - package-ecosystem: "docker" -# directory: "/" -# schedule: -# interval: "weekly" +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9d09dd6f9..ac58d0365 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,12 +7,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Use Node.js 16.16.0 - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - name: Use Node.js 24 + uses: actions/setup-node@v4 with: - node-version: 16.0 + node-version: 24.19.0 - name: Install dependencies run: npm install --legacy-peer-deps - name: Test - run: npm test -- --watch=false --browsers=ChromeHeadless + run: npm test -- --watch=false diff --git a/.gitignore b/.gitignore index 4bb6141ac..a2f7023c2 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,6 @@ Thumbs.db /src/assets/YAML/generated/generated.yaml /src/assets/YAML/model.md /src/assets/YAML/dependency-tree.md + +#lock files for other package managers +pnpm-lock.yaml diff --git a/Dockerfile b/Dockerfile index 55726000a..6fc004fb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN mkdir -p /usr/src/app/dist/dsomm/assets && \ echo "branch: \"${GIT_BRANCH:-unknown}\"" >> /usr/src/app/dist/dsomm/assets/build-info.yaml -FROM wurstbrot/dsomm-yaml-generation:4.3.1 AS yaml +FROM wurstbrot/dsomm-yaml-generation:5.0.0 AS yaml FROM caddy:2.10.2 ENV PORT=8080 diff --git a/README.md b/README.md index 8e8a235b9..0e309d1f3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -# CODE FREEZE -Due to a version update of Angular from 13 to the newest version, no features/PRs are getting merged until *August 2026*. - # Introduction From a startup to a multinational corporation the software development industry is currently dominated by agile frameworks and product teams and as part of it DevOps strategies. It has been observed that during the implementation, security aspects are usually neglected or are at least not sufficient taken account of. It is often the case that standard safety requirements of the production environment are not utilized or applied to the build pipeline in the continuous integration environment with containerization or concrete docker. Therefore, the docker registry is often not secured which might result in the theft of the entire company’s source code. diff --git a/angular.json b/angular.json index 2b3baa67e..6c1d6ec12 100644 --- a/angular.json +++ b/angular.json @@ -15,22 +15,19 @@ "prefix": "app", "architect": { "build": { - "builder": "@angular-devkit/build-angular:browser", + "builder": "@angular/build:application", "options": { - "outputPath": "dist/dsomm", + "outputPath": { + "base": "dist/dsomm", + "browser": "" + }, "index": "src/index.html", - "main": "src/main.ts", - "polyfills": "src/polyfills.ts", + "browser": "src/main.ts", + "polyfills": ["@angular/localize/init"], "tsConfig": "tsconfig.app.json", "allowedCommonJsDependencies": ["yamljs"], - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/custom-theme.scss", - "src/styles.css" - ], + "assets": ["src/favicon.ico", "src/assets"], + "styles": ["src/custom-theme.scss", "src/styles.css"], "scripts": [] }, "configurations": { @@ -56,67 +53,94 @@ "outputHashing": "all" }, "development": { - "buildOptimizer": false, "optimization": false, - "vendorChunk": true, "extractLicenses": false, "sourceMap": true, "namedChunks": true + }, + "testing": { + "aot": false, + "optimization": false, + "extractLicenses": false, + "styles": [ + "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", + "src/styles.css" + ] } }, "defaultConfiguration": "production" }, "serve": { - "builder": "@angular-devkit/build-angular:dev-server", + "builder": "@angular/build:dev-server", "configurations": { "production": { - "browserTarget": "DSOMM:build:production" + "buildTarget": "DSOMM:build:production" }, "development": { - "browserTarget": "DSOMM:build:development" + "buildTarget": "DSOMM:build:development" } }, "defaultConfiguration": "development" }, "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", + "builder": "@angular/build:extract-i18n", "options": { - "browserTarget": "DSOMM:build" + "buildTarget": "DSOMM:build" } }, "test": { - "builder": "@angular-devkit/build-angular:karma", + "builder": "@angular/build:unit-test", "options": { - "main": "src/test.ts", - "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.spec.json", - "karmaConfig": "karma.conf.js", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", - "src/styles.css" - ], - "scripts": [] + "reporters": ["default"], + "coverageReporters": ["html", "text-summary"], + "buildTarget": ":build:testing", + "runner": "vitest" } }, "lint": { "builder": "@angular-eslint/builder:lint", "options": { - "lintFilePatterns": [ - "src/**/*.ts", - "src/**/*.html" - ] + "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"] } } } } }, - "defaultProject": "DSOMM", "cli": { - "defaultCollection": "@angular-eslint/schematics", - "analytics": false + "analytics": false, + "schematicCollections": ["@angular-eslint/schematics"] + }, + "schematics": { + "@angular-eslint/schematics:application": { + "setParserOptionsProject": true + }, + "@angular-eslint/schematics:library": { + "setParserOptionsProject": true + }, + "@schematics/angular:component": { + "type": "component" + }, + "@schematics/angular:directive": { + "type": "directive" + }, + "@schematics/angular:service": { + "type": "service" + }, + "@schematics/angular:guard": { + "typeSeparator": "." + }, + "@schematics/angular:interceptor": { + "typeSeparator": "." + }, + "@schematics/angular:module": { + "typeSeparator": "." + }, + "@schematics/angular:pipe": { + "typeSeparator": "." + }, + "@schematics/angular:resolver": { + "typeSeparator": "." + } } } diff --git a/docs/migration-doc.md b/docs/migration-doc.md new file mode 100644 index 000000000..b9d928371 --- /dev/null +++ b/docs/migration-doc.md @@ -0,0 +1,918 @@ + +# Migration Log: DSOMM Modernization + + + +This log tracks the progress of the Angular modernization project from version 13 towards version 21. + + + +
+ +Angular 13 → 14 + + + +### Summary + +The initial upgrade from Angular 13 to 14 was performed using `ng update`. This phase focused on establishing a stable v14 base, resolving immediate template warnings, and adopting the new Typed Forms feature. + + + +### Commit History + + + +#### 1. Chore: Upgrade Angular 13 to 14 ([c68f708b](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/commit/c68f708b)) + +- Executed `npx ng update @angular/core@14 @angular/cli@14 @angular-eslint/schematics@14`. + +- This was followed by a `npx ng update @angular/cdk@14 @angular/material@14`. + + + + +#### 2. Fix: Remove Unnecessary Optional Chaining ([387be213](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/commit/387be213)) + +- **Action:** Cleaned up template code to resolve `NG8107` warnings. + +- **Reason:** Angular 14's improved template type checking flagged optional chaining (`?.`) on properties that are guaranteed to be defined (or where the parent is not null/undefined). This "chore" was necessary to clear the console of noise and ensure clean build outputs. + + + + +#### 3. Refactor: Migrate to Typed Reactive Forms ([3d36885e](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/commit/3d36885e)) + +- **Action:** Converted `UntypedFormControl`, `UntypedFormGroup`, etc., to their typed counterparts. + +- **Reason:** One of the major benefits of Angular 14. This improves type safety across the application and catches potential form-related errors at compile time. + + + +#### 4. Fix: Update SettingsComponent Spec to Resolve Test Failures ([31aef4ab](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/commit/31aef4ab)) + +- **Action:** Fixed 3 failing tests in `settings.component.spec.ts` by providing missing mock data. + +- **Reason:** Removing `?.` in commit `031ef6a1` exposed that the test environment never provided a `meta` object to the component. Since `MockLoaderService` returns no `meta`, `this.meta` stayed `undefined` at render time, causing Angular's template engine to crash with `Cannot read properties of undefined (reading 'activityMeta')`. Added a `meta` stub on the component instance before `detectChanges()`, and provided a `GithubService` spy which was also missing from the test providers. + + +--- + + + + +
+ + + +
+ +Angular 14 → 15 + + + +### Summary + +The upgrade from Angular 14 to 15 involved multiple phases: a TypeScript prerequisite upgrade, the Angular core/CLI `ng update`, the Angular Material/CDK `ng update` (which auto-aliases all components to `mat-legacy-*`), a typography configuration fix, the full MDC migration using Angular's CLI schematics, manual resolution of all `TODO(mdc-migration)` comments, several rounds of CSS/template/component fixes for chips, sliders, form-fields, buttons, and dark-mode styling, test suite updates, and finally a full migration to standalone components (removing `AppModule` and `MaterialModule` entirely). + + + +### Commit History + + + +#### 1. Chore: Upgrade TypeScript to 4.8 ([24645b16](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/commit/24645b16)) + +- **Action:** Bumped `typescript` from `^4.6.4` to `^4.8.0` in `package.json`. + + + +#### 2. Chore: Upgrade Angular Core & CLI to v15 ([6a433bbb](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/commit/6a433bbb)) + +- **Action:** Executed `npx ng update @angular/core@15 @angular/cli@15 @angular-eslint/schematics@15`. + +- **Key Changes:** + +- All `@angular/*` core packages bumped from `^14.3.0` to `^15.2.10`. + +- `@angular-devkit/build-angular` bumped from `^14.2.13` to `^15.2.11`. + +- `@angular-eslint/*` packages bumped from `^14.4.0` to `^15.2.1`. + +- `@typescript-eslint/*` bumped from `^5.36.2` to `^5.43.0`. + +- `tsconfig.json`: `target` changed from `es2020` to `ES2022`, added `"useDefineForClassFields": false` (required by Angular 15's class field semantics). + +- `src/test.ts`: Removed deprecated `require.context()` bootstrapping; Angular 15's test builder auto-discovers spec files. + +- `angular.json`: Added `schematics` configuration for `@angular-eslint`. + +- **Files:** `angular.json`, `package.json`, `package-lock.json`, `src/test.ts`, `tsconfig.json` + + + +#### 3. Chore: Upgrade Angular Material & CDK to v15 ([a9999c51](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/commit/a9999c51)) + +- **Action:** Executed `npx ng update @angular/cdk@15 @angular/material@15`. + +- **Key Changes:** + +- `@angular/cdk` bumped from `^14.2.7` to `^15.2.9`. + +- `@angular/material` bumped from `^14.2.7` to `^15.2.9`. + +- **Auto-aliasing to `mat-legacy-*`:** The `ng update` schematic automatically rewrote all Material imports across the entire codebase to use legacy aliases (e.g., `MatButtonModule` → `MatLegacyButtonModule as MatButtonModule`). This is Angular Material 15's strategy for maintaining backward compatibility while introducing new MDC-based components. + +- **`material.module.ts`:** All 14 Material module imports were aliased (Button, List, Table, Chips, ProgressSpinner, Autocomplete, Input, Select, FormField, Card, Checkbox, Slider, etc.). + +- **Component files:** Dialog, Tooltip, Menu imports were aliased across `app.module.ts`, all modal components, all page components, all spec files, and the notification service. + +- **`custom-theme.scss`:** + +- `mat.core()` → `mat.legacy-core()` + +- `mat.all-component-themes()` → `mat.all-legacy-component-themes()` + +- Added auto-generated `TODO(v15)` comment about typography migration + +- Added `mat.all-legacy-component-typographies($custom-typography)` + +- **Files:** 24 files changed across `package.json`, `app.module.ts`, all component `.ts`/`.spec.ts` files, `material.module.ts`, `notification.service.ts`, `custom-theme.scss` + + + +#### 4. Fix: Correct Typography Configuration & Theme Structure ([d354b9f5](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/commit/d354b9f5)) + +- **Action:** + +- Replaced `mat.define-typography-level()` with `mat.define-legacy-typography-config($font-family: 'Roboto, Helvetica Neue, sans-serif')`. + +- Reordered SCSS `@include` statements: `mat.legacy-core()` before `mat.all-legacy-component-typographies()`. + +- Changed `mat.all-legacy-component-themes()` → `mat.all-legacy-component-colors()` (avoids re-emitting typography/density styles). + + +- **Reason:** The original code used `mat.define-typography-level()` which produces a single level, not a full config map. Material silently ignored it and fell back to defaults. `Montserrat` was never rendered in production. Using `mat.define-legacy-typography-config()` fixes the signature, and Roboto preserves visual parity with the live site. The `all-legacy-component-colors()` mixin avoids duplicate typography emission when theme colors differ between light/dark modes. + +- **Files:** `custom-theme.scss`, `docs/migration-doc.md`, `teams.component.html`, `teams.component.ts` + + + +#### 5. Refactor: Run MDC Migration Schematics ([66c409cd](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/commit/66c409cd)) + +- **Action:** Executed `ng generate @angular/material:mdc-migration` to migrate all legacy components to MDC. + +- **Key Changes (38 files):** + +- **CSS:** Auto-generated `TODO(mdc-migration)` comments on rules targeting legacy internal classes (`.mat-slider-horizontal`, `.mat-chip-list`, `.mat-form-field-wrapper`, `.mat-card-header`, etc.) + +- **`custom-theme.scss`:** + +- `mat.legacy-core()` → `mat.core()` + +- `mat.all-legacy-component-typographies()` → `mat.all-component-typographies()` + +- `mat.all-legacy-component-colors()` → `mat.all-component-colors()` + +- CSS selectors updated: `.mat-table` → `.mat-mdc-table`, `.mat-header-row` → `.mat-mdc-header-row`, `.mat-row` → `.mat-mdc-row`, etc. + +- **`styles.css`:** Slider rules updated with `TODO(mdc-migration)` comments. + +- **Note:** The CLI migration produced some duplicate `@include` calls and leftover `TODO` comments that were cleaned up in the next commit. + +- **Files:** 38 files across all components, specs, modules, theme, and global styles + + + +#### 6. Fix: Resolve All MDC Migration TODOs ([d414cb90](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/commit/d414cb90)) + +- **Action:** Manually resolved every `TODO(mdc-migration)` comment generated by the CLI schematics, replacing legacy CSS selectors with their MDC-compliant equivalents. + +- **Files:** 15 files across `progress-slider`, `report-config-modal`, `circular-heatmap`, `mapping`, `matrix`, `settings` components + `custom-theme.scss` + `styles.css` + + + +#### 7. Fix: Migrate Sidenav List Directives to MDC ([b8b39d4c](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/commit/b8b39d4c)) + +- **Action:** Updated `sidenav-buttons.component.html` to use MDC list directives. + +- **Key Changes:** + +- `mat-list-icon` → `matListItemIcon`, `mat-line` → `matListItemTitle` + +- Added component CSS for `[matListItemIcon]` with spacing overrides (`margin-right: 18px`, `margin-left: 22px`) to restore icon alignment matching the legacy layout. + +- **Reason:** The MDC `mat-list` uses structural directives (`matListItemIcon`, `matListItemTitle`, `matListItemLine`) instead of legacy attribute selectors (`mat-list-icon`, `mat-line`). The CLI migration schematic did not catch these in the sidenav component. + +- **Files:** `sidenav-buttons.component.html`, `sidenav-buttons.component.css` + + + +#### 8. Fix: Resolve Heatmap Chip Selection and Styling Issues ([769b63af](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/commit/769b63af)) + +- **Action:** Rewrote the circular heatmap's team filter chip logic and template to work correctly with MDC chips. + +- **Key Changes:** + +- **Template:** Removed wrapping `` from chip listboxes (MDC chips should not be inside form fields for selection-only use). Replaced with plain `