Skip to content

Commit 33bd5a7

Browse files
committed
Remove legacy generated.yaml references and unused message template
1 parent 1706bae commit 33bd5a7

File tree

4 files changed

+94
-24
lines changed

4 files changed

+94
-24
lines changed

GITHUB_ISSUE_STATEMENT.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Clean Up Legacy `generated.yaml` References
2+
3+
## Issue Description
4+
The codebase contains references to the deprecated `generated.yaml` file format that has been replaced by the newer `model.yaml` structure. While the code handles legacy format gracefully, these outdated references should be removed for code cleanliness and to avoid confusion for new contributors.
5+
6+
## Current State
7+
The application transitioned from a monolithic `generated.yaml` to a split architecture:
8+
- `generated.yaml` (deprecated) → `model.yaml` (activities) + `team-progress.yaml` (progress)
9+
10+
However, legacy references remain in the codebase.
11+
12+
## References to Clean Up
13+
14+
### 1. **File: `src/assets/YAML/meta.yaml` (Line 29)**
15+
**Current:**
16+
```yaml
17+
activityFiles:
18+
# - generated/generated.yaml # Old structure - No longer used
19+
- default/model.yaml
20+
```
21+
22+
**Action:** Remove the commented-out reference to `generated/generated.yaml`
23+
24+
**Proposed Fix:**
25+
```yaml
26+
activityFiles:
27+
- default/model.yaml
28+
```
29+
30+
---
31+
32+
### 2. **File: `src/app/component/modal-message/modal-message.component.ts` (Lines 24-31)**
33+
34+
**Current:** The component has a hardcoded error template specifically for the legacy `generated.yaml` file:
35+
```typescript
36+
if (this.dialogInfo?.title === 'generated_yaml') {
37+
this.template = { ...this.generatedYamlTemplate };
38+
// ... template for downloading generated.yaml
39+
}
40+
```
41+
42+
**Issue:** This template references the deprecated file format and is no longer relevant.
43+
44+
**Action:** Consider whether this template should be:
45+
1. Removed entirely (preferred, since it's legacy)
46+
2. Kept for backward compatibility with existing error handling
47+
48+
**Recommended Fix:** Remove this conditional block and the associated `generatedYamlTemplate` definition.
49+
50+
---
51+
52+
### 3. **File: `src/app/service/loader/data-loader.service.ts` (Lines 158, 177-178)**
53+
54+
**Current:** Special handling for legacy validation errors:
55+
```typescript
56+
usingLegacyYamlFile ||= filename.endsWith('generated/generated.yaml');
57+
58+
// Legacy generated.yaml has several data validation problems. Do not report these
59+
if (!usingLegacyYamlFile) {
60+
throw new DataValidationError(...);
61+
}
62+
```
63+
64+
**Action:** This code can be removed once:
65+
1. All users have migrated from `generated.yaml` to `model.yaml`
66+
2. The legacy error template is removed
67+
3. Only `model.yaml` is actively supported
68+
69+
**Recommended Fix:** Remove the `usingLegacyYamlFile` flag and the conditional error suppression once legacy format is no longer needed.
70+
71+
---
72+
73+
## Impact
74+
- **Scope:** Minor cleanup, no functional impact
75+
- **Risk:** Very low — only affects code clarity and maintainability
76+
- **Breaking Changes:** None
77+
- **Dependencies:** None
78+
79+
## Testing
80+
1. Verify the application loads correctly with `model.yaml` (the current standard)
81+
2. Ensure no error messages reference the deprecated `generated.yaml` format
82+
3. Confirm all existing functionality remains intact
83+
84+
## Related Documentation
85+
- Migration notes should clarify that `generated.yaml` is deprecated in favor of `model.yaml` + `team-progress.yaml`
86+
- INSTALL.md can be updated to remove any references to manual `generated.yaml` download if not needed

src/app/component/modal-message/modal-message.component.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,7 @@ export class ModalMessageComponent implements OnInit {
2020

2121
DSOMM_host: string = 'https://github.com/devsecopsmaturitymodel';
2222
DSOMM_url: string = `${this.DSOMM_host}/DevSecOps-MaturityModel-data`;
23-
meassageTemplates: Record<string, DialogInfo> = {
24-
generated_yaml: new DialogInfo(
25-
`{message}\n\n` +
26-
`Please download the activity template \`generated.yaml\` ` +
27-
`from [DSOMM-data](${this.DSOMM_url}) on GitHub.\n\n` +
28-
'The DSOMM activities are maintained and distributed ' +
29-
'separately from the software.',
30-
'DSOMM startup problems'
31-
),
32-
};
23+
meassageTemplates: Record<string, DialogInfo> = {};
3324

3425
constructor(
3526
public dialog: MatDialog,

src/app/service/loader/data-loader.service.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,12 @@ export class LoaderService {
148148
private async loadActivities(meta: MetaStore): Promise<ActivityStore> {
149149
const activityStore = new ActivityStore();
150150
const errors: string[] = [];
151-
let usingLegacyYamlFile = false;
152151

153152
if (meta.activityFiles.length == 0) {
154153
throw new MissingModelError('No `activityFiles` are specified in `meta.yaml`.');
155154
}
156155
for (let filename of meta.activityFiles) {
157156
if (this.debug) console.log(`${perfNow()}s: Loading activity file: ${filename}`);
158-
usingLegacyYamlFile ||= filename.endsWith('generated/generated.yaml');
159157

160158
const response: ActivityFile = await this.loadActivityFile(filename);
161159

@@ -173,16 +171,12 @@ export class LoaderService {
173171
// Handle validation errors
174172
if (errors.length > 0) {
175173
errors.forEach(error => console.error(error));
176-
177-
// Legacy generated.yaml has several data validation problems. Do not report these
178-
if (!usingLegacyYamlFile) {
179-
throw new DataValidationError(
180-
'Data validation error after loading: ' +
181-
filename +
182-
'\n\n----\n\n' +
183-
errors.join('\n\n')
184-
);
185-
}
174+
throw new DataValidationError(
175+
'Data validation error after loading: ' +
176+
filename +
177+
'\n\n----\n\n' +
178+
errors.join('\n\n')
179+
);
186180
}
187181
}
188182
return activityStore;

src/assets/YAML/meta.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ teamGroups:
2626
$ref: 'default/teams.yaml#/teamGroups'
2727

2828
activityFiles:
29-
# - generated/generated.yaml # Old structure - No longer used
30-
- default/model.yaml
29+
- default/model.yaml
3130
# - custom/custom-activities.yaml # For customizing your own activities
3231

3332

0 commit comments

Comments
 (0)