Skip to content

Commit

Permalink
feat: Added tag validations and updated impact tag values
Browse files Browse the repository at this point in the history
the responderTeam tag values are derived from the current opsgenie team values. in the future we may automatically generate these values. for now it is a point in time list of values.
  • Loading branch information
bharathcp committed May 24, 2024
1 parent 826ab70 commit 1163e65
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
16 changes: 16 additions & 0 deletions src/responder-teams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export type ResponderTeam= 'LANDONLINE - Common Services' |

Check failure on line 1 in src/responder-teams.ts

View workflow job for this annotation

GitHub Actions / build

Replace `=·'LANDONLINE·-·Common·Services'·|` with `·=⏎··|·'LANDONLINE·-·Common·Services'`
'LANDONLINE - Datacom' |

Check failure on line 2 in src/responder-teams.ts

View workflow job for this annotation

GitHub Actions / build

Replace `··'LANDONLINE·-·Datacom'·|` with `|·'LANDONLINE·-·Datacom'`
'LANDONLINE - Dealings' |

Check failure on line 3 in src/responder-teams.ts

View workflow job for this annotation

GitHub Actions / build

Replace `··'LANDONLINE·-·Dealings'·|` with `|·'LANDONLINE·-·Dealings'`
'LANDONLINE - Enablement' |

Check failure on line 4 in src/responder-teams.ts

View workflow job for this annotation

GitHub Actions / build

Replace `··'LANDONLINE·-·Enablement'·|` with `|·'LANDONLINE·-·Enablement'`
'LANDONLINE - L2 Technical Support' |

Check failure on line 5 in src/responder-teams.ts

View workflow job for this annotation

GitHub Actions / build

Replace `··'LANDONLINE·-·L2·Technical·Support'·|` with `|·'LANDONLINE·-·L2·Technical·Support'`
'LANDONLINE - Legacy Landonline' |

Check failure on line 6 in src/responder-teams.ts

View workflow job for this annotation

GitHub Actions / build

Replace `··'LANDONLINE·-·Legacy·Landonline'·|` with `|·'LANDONLINE·-·Legacy·Landonline'`
'LANDONLINE - Notice of Change' |

Check failure on line 7 in src/responder-teams.ts

View workflow job for this annotation

GitHub Actions / build

Replace `··'LANDONLINE·-·Notice·of·Change'·|` with `|·'LANDONLINE·-·Notice·of·Change'`
'LANDONLINE - Search' |

Check failure on line 8 in src/responder-teams.ts

View workflow job for this annotation

GitHub Actions / build

Replace `··'LANDONLINE·-·Search'·|` with `|·'LANDONLINE·-·Search'`
'LANDONLINE - Survey External' |

Check failure on line 9 in src/responder-teams.ts

View workflow job for this annotation

GitHub Actions / build

Replace `··'LANDONLINE·-·Survey·External'·|` with `|·'LANDONLINE·-·Survey·External'`
'LANDONLINE - Survey Internal' |

Check failure on line 10 in src/responder-teams.ts

View workflow job for this annotation

GitHub Actions / build

Replace `··'LANDONLINE·-·Survey·Internal'·|` with `|·'LANDONLINE·-·Survey·Internal'`
'LANDONLINE - Titles Internal' |
'LINZ - Enterprise Platforms' |
'LINZ-BASEMAPS' |
'LINZ-BASEMAPS-dev' |
'TESTING L2 Escalation' |
'TESTING L2 Support' ;
8 changes: 6 additions & 2 deletions src/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IConstruct } from 'constructs';
import { getGitBuildInfo } from './build.js';
import { TagsData } from './data.js';
import { SecurityClassification } from './security.js';
import {ResponderTeam} from "./responder-teams";

export interface TagsBase {
/**
Expand Down Expand Up @@ -55,13 +56,13 @@ export interface TagsBase {
* Operational impact of the resources on runtime overall system
* @see https://toitutewhenua.atlassian.net/wiki/spaces/STEP/pages/524059414/OpsGenie+Incident+Priority+Matrix
*/
impact: 'high' | 'medium' | 'low';
impact: 'high' | 'moderate' | 'low';

/**
* THe responder team listed in OpsGenie.
* @see https://toitutewhenua.app.opsgenie.com/teams/list
*/
responderTeam?: string;
responderTeam?: ResponderTeam;
/**
* skip collection of git info, commit, version etc
* @default false
Expand All @@ -85,6 +86,9 @@ export function applyTags(construct: IConstruct, ctx: TagsBase): void {
if (ctx.data?.isPublic && ctx.classification !== SecurityClassification.Unclassified) {
throw new Error('Only unclassified constructs can be made public');
}
if (!ctx.application.match(RegExp(/^[a-zA-Z0-9 -]+$/))) {
throw new Error('linz.app.name has to match /^[a-zA-Z0-9 -]+$/');
}

const buildInfo = ctx.skipGitInfo ? undefined : getGitBuildInfo();

Expand Down

0 comments on commit 1163e65

Please sign in to comment.