File tree Expand file tree Collapse file tree 4 files changed +52
-7
lines changed Expand file tree Collapse file tree 4 files changed +52
-7
lines changed Original file line number Diff line number Diff line change @@ -425,13 +425,6 @@ export function migrateConfig(
425
425
if ( subMigrate . isMigrated ) {
426
426
migratedConfig [ key ] = subMigrate . migratedConfig ;
427
427
}
428
- } else if ( key === 'raiseDeprecationWarnings' ) {
429
- delete migratedConfig . raiseDeprecationWarnings ;
430
- if ( val === false ) {
431
- migratedConfig . suppressNotifications =
432
- migratedConfig . suppressNotifications || [ ] ;
433
- migratedConfig . suppressNotifications . push ( 'deprecationWarningIssues' ) ;
434
- }
435
428
} else if ( key === 'azureAutoComplete' || key === 'gitLabAutomerge' ) {
436
429
if ( migratedConfig [ key ] !== undefined ) {
437
430
migratedConfig . platformAutomerge = migratedConfig [ key ] ;
Original file line number Diff line number Diff line change
1
+ import { RaiseDeprecationWarningsMigration } from './raise-deprecation-warnings-migration' ;
2
+
3
+ describe ( 'config/migrations/custom/raise-deprecation-warnings-migration' , ( ) => {
4
+ it ( 'should migrate false' , ( ) => {
5
+ expect ( RaiseDeprecationWarningsMigration ) . toMigrate (
6
+ { raiseDeprecationWarnings : false } ,
7
+ {
8
+ suppressNotifications : [ 'deprecationWarningIssues' ] ,
9
+ }
10
+ ) ;
11
+ } ) ;
12
+
13
+ it ( 'should migrate false and concat with existing value' , ( ) => {
14
+ expect ( RaiseDeprecationWarningsMigration ) . toMigrate (
15
+ {
16
+ raiseDeprecationWarnings : false ,
17
+ suppressNotifications : [ 'test' ] ,
18
+ } ,
19
+ { suppressNotifications : [ 'test' , 'deprecationWarningIssues' ] }
20
+ ) ;
21
+ } ) ;
22
+
23
+ it ( 'should just remove property when raiseDeprecationWarnings not equals to true' , ( ) => {
24
+ expect ( RaiseDeprecationWarningsMigration ) . toMigrate (
25
+ {
26
+ raiseDeprecationWarnings : true ,
27
+ } ,
28
+ { }
29
+ ) ;
30
+ } ) ;
31
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { AbstractMigration } from '../base/abstract-migration' ;
2
+
3
+ export class RaiseDeprecationWarningsMigration extends AbstractMigration {
4
+ override readonly deprecated = true ;
5
+ override readonly propertyName = 'raiseDeprecationWarnings' ;
6
+
7
+ override run ( value : unknown ) : void {
8
+ const suppressNotifications = this . get ( 'suppressNotifications' ) ;
9
+
10
+ if ( value === false ) {
11
+ this . setHard (
12
+ 'suppressNotifications' ,
13
+ Array . isArray ( suppressNotifications )
14
+ ? suppressNotifications . concat ( [ 'deprecationWarningIssues' ] )
15
+ : [ 'deprecationWarningIssues' ]
16
+ ) ;
17
+ }
18
+ }
19
+ }
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { EnabledManagersMigration } from './custom/enabled-managers-migration';
8
8
import { GoModTidyMigration } from './custom/go-mod-tidy-migration' ;
9
9
import { IgnoreNodeModulesMigration } from './custom/ignore-node-modules-migration' ;
10
10
import { PinVersionsMigration } from './custom/pin-versions-migration' ;
11
+ import { RaiseDeprecationWarningsMigration } from './custom/raise-deprecation-warnings-migration' ;
11
12
import { RebaseConflictedPrs } from './custom/rebase-conflicted-prs-migration' ;
12
13
import { RebaseStalePrsMigration } from './custom/rebase-stale-prs-migration' ;
13
14
import { RequiredStatusChecksMigration } from './custom/required-status-checks-migration' ;
@@ -51,6 +52,7 @@ export class MigrationsService {
51
52
GoModTidyMigration ,
52
53
IgnoreNodeModulesMigration ,
53
54
PinVersionsMigration ,
55
+ RaiseDeprecationWarningsMigration ,
54
56
RebaseConflictedPrs ,
55
57
RebaseStalePrsMigration ,
56
58
RequiredStatusChecksMigration ,
You can’t perform that action at this time.
0 commit comments