@@ -89,6 +89,23 @@ You can trigger Dependabot actions by commenting on this PR:
89
89
''' ;
90
90
}
91
91
92
+ String _generateFakeDependabotCommitMessage (String package) {
93
+ return '''
94
+ Bumps [$package ](https://github.com/foo/$package ) from 1.0.0 to 2.0.0.
95
+ - [Release notes](https://github.com/foo/$package /releases)
96
+ - [Commits](foo/$package @v4.3.1...v4.6.1)
97
+
98
+ ---
99
+ updated-dependencies:
100
+ - dependency-name: $package
101
+ dependency-type: direct:production
102
+ update-type: version-update:semver-minor
103
+ ...
104
+
105
+ Signed-off-by: dependabot[bot] <support@github.com>
106
+ ''' ;
107
+ }
108
+
92
109
class MockProcessResult extends Mock implements io.ProcessResult {}
93
110
94
111
void main () {
@@ -1290,6 +1307,47 @@ packages/plugin/android/build.gradle
1290
1307
]),
1291
1308
);
1292
1309
});
1310
+
1311
+ // Tests workaround for
1312
+ // https://github.com/cirruslabs/cirrus-ci-docs/issues/1029.
1313
+ test ('allow list works for commit messages' , () async {
1314
+ final RepositoryPackage plugin =
1315
+ createFakePlugin ('plugin' , packagesDir, version: '1.0.0' );
1316
+
1317
+ const String changelog = '''
1318
+ ## 1.0.0
1319
+ * Some changes.
1320
+ ''' ;
1321
+ plugin.changelogFile.writeAsStringSync (changelog);
1322
+ processRunner.mockProcessesForExecutable['git-show' ] = < io.Process > [
1323
+ MockProcess (stdout: 'version: 1.0.0' ),
1324
+ ];
1325
+ processRunner.mockProcessesForExecutable['git-diff' ] = < io.Process > [
1326
+ MockProcess (stdout: '''
1327
+ packages/plugin/android/build.gradle
1328
+ ''' ),
1329
+ ];
1330
+
1331
+ final File changeDescriptionFile =
1332
+ fileSystem.file ('change_description.txt' );
1333
+ changeDescriptionFile.writeAsStringSync (
1334
+ _generateFakeDependabotCommitMessage ('mockito-core' ));
1335
+
1336
+ final List <String > output =
1337
+ await _runWithMissingChangeDetection (< String > [
1338
+ '--change-description-file=${changeDescriptionFile .path }'
1339
+ ]);
1340
+
1341
+ expect (
1342
+ output,
1343
+ containsAllInOrder (< Matcher > [
1344
+ contains ('Ignoring lack of version change for Dependabot '
1345
+ 'change to a known internal dependency.' ),
1346
+ contains ('Ignoring lack of CHANGELOG update for Dependabot '
1347
+ 'change to a known internal dependency.' ),
1348
+ ]),
1349
+ );
1350
+ });
1293
1351
});
1294
1352
});
1295
1353
0 commit comments