mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
feat: show dangerous changes as separate list (#6701)
This commit is contained in:
parent
e98c4fa01d
commit
f2fe6c83a2
2 changed files with 16 additions and 1 deletions
5
.changeset/plenty-apes-hug.md
Normal file
5
.changeset/plenty-apes-hug.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'hive': minor
|
||||
---
|
||||
|
||||
Print dangerous schema changes as own section in github changes.
|
||||
|
|
@ -2473,7 +2473,12 @@ export class SchemaPublisher {
|
|||
const breakingChanges = changes.filter(
|
||||
change => change.criticality === CriticalityLevel.Breaking,
|
||||
);
|
||||
const safeChanges = changes.filter(change => change.criticality !== CriticalityLevel.Breaking);
|
||||
const dangerousChanges = changes.filter(
|
||||
change => change.criticality === CriticalityLevel.Dangerous,
|
||||
);
|
||||
const safeChanges = changes.filter(
|
||||
change => change.criticality === CriticalityLevel.NonBreaking,
|
||||
);
|
||||
|
||||
const lines: string[] = [
|
||||
`## Found ${changes.length} change${changes.length > 1 ? 's' : ''}`,
|
||||
|
|
@ -2484,12 +2489,17 @@ export class SchemaPublisher {
|
|||
lines.push(`Breaking: ${breakingChanges.length}`);
|
||||
}
|
||||
|
||||
if (dangerousChanges.length) {
|
||||
lines.push(`Dangerous: ${dangerousChanges.length}`);
|
||||
}
|
||||
|
||||
if (safeChanges.length) {
|
||||
lines.push(`Safe: ${safeChanges.length}`);
|
||||
}
|
||||
|
||||
if (printListOfChanges) {
|
||||
writeChanges('Breaking', breakingChanges, lines);
|
||||
writeChanges('Dangrous', dangerousChanges, lines);
|
||||
writeChanges('Safe', safeChanges, lines);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue