Unverified Commit 67b7aa22 authored by Christopher Fujino's avatar Christopher Fujino Committed by GitHub

Change pub roller bot to push to flutter-pub-roller-bot/flutter.git (#129844)

Fixes https://github.com/flutter/flutter/issues/129744
Part of https://github.com/flutter/flutter/issues/129847

Migrate the packages_autoroller script to push to
flutter-pub-roller-bot/flutter.git, rather than
fluttergithubbot/flutter.git.
parent 1153371a
...@@ -243,8 +243,6 @@ targets: ...@@ -243,8 +243,6 @@ targets:
- name: Linux packages_autoroller - name: Linux packages_autoroller
presubmit: false presubmit: false
# TODO(fujino): https://github.com/flutter/flutter/issues/129744
bringup: true
recipe: pub_autoroller/pub_autoroller recipe: pub_autoroller/pub_autoroller
timeout: 30 timeout: 30
enabled_branches: enabled_branches:
......
...@@ -15,8 +15,8 @@ import 'package:process/process.dart'; ...@@ -15,8 +15,8 @@ import 'package:process/process.dart';
const String kTokenOption = 'token'; const String kTokenOption = 'token';
const String kGithubClient = 'github-client'; const String kGithubClient = 'github-client';
const String kMirrorRemote = 'mirror-remote';
const String kUpstreamRemote = 'upstream-remote'; const String kUpstreamRemote = 'upstream-remote';
const String kGithubAccountName = 'flutter-pub-roller-bot';
Future<void> main(List<String> args) { Future<void> main(List<String> args) {
return run(args); return run(args);
...@@ -39,11 +39,10 @@ Future<void> run( ...@@ -39,11 +39,10 @@ Future<void> run(
help: 'Path to GitHub CLI client. If not provided, it is assumed `gh` is ' help: 'Path to GitHub CLI client. If not provided, it is assumed `gh` is '
'present on the PATH.', 'present on the PATH.',
); );
// TODO(fujino): delete after recipe has been migrated to stop passing this
parser.addOption( parser.addOption(
kMirrorRemote, 'mirror-remote',
help: 'The mirror git remote that the feature branch will be pushed to. ' help: '(Deprecated) this is now a no-op. To change the account, edit this tool.',
'Required',
mandatory: true,
); );
parser.addOption( parser.addOption(
kUpstreamRemote, kUpstreamRemote,
...@@ -64,7 +63,7 @@ ${parser.usage} ...@@ -64,7 +63,7 @@ ${parser.usage}
rethrow; rethrow;
} }
final String mirrorUrl = results[kMirrorRemote]! as String; const String mirrorUrl = 'https://github.com/flutter-pub-roller-bot/flutter.git';
final String upstreamUrl = results[kUpstreamRemote]! as String; final String upstreamUrl = results[kUpstreamRemote]! as String;
final String tokenPath = results[kTokenOption]! as String; final String tokenPath = results[kTokenOption]! as String;
final File tokenFile = fs.file(tokenPath); final File tokenFile = fs.file(tokenPath);
...@@ -92,6 +91,7 @@ ${parser.usage} ...@@ -92,6 +91,7 @@ ${parser.usage}
orgName: _parseOrgName(mirrorUrl), orgName: _parseOrgName(mirrorUrl),
token: token, token: token,
processManager: processManager, processManager: processManager,
githubUsername: kGithubAccountName,
).roll(); ).roll();
} }
......
...@@ -20,7 +20,7 @@ class PackageAutoroller { ...@@ -20,7 +20,7 @@ class PackageAutoroller {
required this.framework, required this.framework,
required this.orgName, required this.orgName,
required this.processManager, required this.processManager,
this.githubUsername = 'fluttergithubbot', required this.githubUsername,
Stdio? stdio, Stdio? stdio,
}) { }) {
this.stdio = stdio ?? VerboseStdio.local(); this.stdio = stdio ?? VerboseStdio.local();
...@@ -111,7 +111,7 @@ This PR was generated by the automated ...@@ -111,7 +111,7 @@ This PR was generated by the automated
Future<bool> updatePackages({ Future<bool> updatePackages({
bool verbose = true, bool verbose = true,
}) async { }) async {
final String author = '$githubUsername <$githubUsername@gmail.com>'; final String author = '$githubUsername <$githubUsername@google.com>';
await framework.newBranch(await featureBranchName); await framework.newBranch(await featureBranchName);
final io.Process flutterProcess = await framework.streamFlutter(<String>[ final io.Process flutterProcess = await framework.streamFlutter(<String>[
......
...@@ -63,6 +63,7 @@ void main() { ...@@ -63,6 +63,7 @@ void main() {
orgName: orgName, orgName: orgName,
processManager: processManager, processManager: processManager,
stdio: stdio, stdio: stdio,
githubUsername: 'flutter-pub-roller-bot',
); );
}); });
...@@ -199,7 +200,7 @@ void main() { ...@@ -199,7 +200,7 @@ void main() {
'pr', 'pr',
'list', 'list',
'--author', '--author',
'fluttergithubbot', 'flutter-pub-roller-bot',
'--repo', '--repo',
'flutter/flutter', 'flutter/flutter',
'--state', '--state',
...@@ -216,7 +217,7 @@ void main() { ...@@ -216,7 +217,7 @@ void main() {
await controller.stream.drain(); await controller.stream.drain();
await rollFuture; await rollFuture;
expect(processManager, hasNoRemainingExpectations); expect(processManager, hasNoRemainingExpectations);
expect(stdio.stdout, contains('fluttergithubbot already has open tool PRs')); expect(stdio.stdout, contains('flutter-pub-roller-bot already has open tool PRs'));
expect(stdio.stdout, contains(r'[{number: 123}]')); expect(stdio.stdout, contains(r'[{number: 123}]'));
}); });
...@@ -239,7 +240,7 @@ void main() { ...@@ -239,7 +240,7 @@ void main() {
'pr', 'pr',
'list', 'list',
'--author', '--author',
'fluttergithubbot', 'flutter-pub-roller-bot',
'--repo', '--repo',
'flutter/flutter', 'flutter/flutter',
'--state', '--state',
...@@ -335,7 +336,7 @@ void main() { ...@@ -335,7 +336,7 @@ void main() {
'pr', 'pr',
'list', 'list',
'--author', '--author',
'fluttergithubbot', 'flutter-pub-roller-bot',
'--repo', '--repo',
'flutter/flutter', 'flutter/flutter',
'--state', '--state',
...@@ -427,7 +428,7 @@ void main() { ...@@ -427,7 +428,7 @@ void main() {
'commit', 'commit',
'--message', '--message',
'roll packages', 'roll packages',
'--author="fluttergithubbot <fluttergithubbot@gmail.com>"', '--author="flutter-pub-roller-bot <flutter-pub-roller-bot@google.com>"',
]), ]),
const FakeCommand(command: <String>[ const FakeCommand(command: <String>[
'git', 'git',
...@@ -475,12 +476,11 @@ void main() { ...@@ -475,12 +476,11 @@ void main() {
group('command argument validations', () { group('command argument validations', () {
const String tokenPath = '/path/to/token'; const String tokenPath = '/path/to/token';
const String mirrorRemote = 'https://githost.com/org/project';
test('validates that file exists at --token option', () async { test('validates that file exists at --token option', () async {
await expectLater( await expectLater(
() => run( () => run(
<String>['--token', tokenPath, '--mirror-remote', mirrorRemote], <String>['--token', tokenPath],
fs: fileSystem, fs: fileSystem,
processManager: processManager, processManager: processManager,
), ),
...@@ -499,7 +499,7 @@ void main() { ...@@ -499,7 +499,7 @@ void main() {
..writeAsStringSync(''); ..writeAsStringSync('');
await expectLater( await expectLater(
() => run( () => run(
<String>['--token', tokenPath, '--mirror-remote', mirrorRemote], <String>['--token', tokenPath],
fs: fileSystem, fs: fileSystem,
processManager: processManager, processManager: processManager,
), ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment