@@ -89,6 +89,23 @@ You can trigger Dependabot actions by commenting on this PR:
8989''' ;
9090}
9191
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] <[email protected] > 106+ ''' ;
107+ }
108+
92109class MockProcessResult extends Mock implements io.ProcessResult {}
93110
94111void main () {
@@ -1290,6 +1307,47 @@ packages/plugin/android/build.gradle
12901307 ]),
12911308 );
12921309 });
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+ });
12931351 });
12941352 });
12951353
0 commit comments