blob: 54175da973cb508d35be0d6ddfbe0e6e8db0168c [file] [log] [blame] [edit]
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';
import 'package:collection/collection.dart';
import 'package:github/github.dart';
import 'package:glob/glob.dart';
import '../firehose.dart';
class LocalGithubApi implements GithubApi {
final Iterable<GitFile> files;
LocalGithubApi({
required this.prLabels,
required this.files,
});
@override
String? get actor => throw UnimplementedError();
@override
void appendStepSummary(String markdownSummary) {}
@override
String? get baseRef => throw UnimplementedError();
@override
void close() {}
@override
Future<int?> findCommentId({required String user, String? searchTerm}) {
throw UnimplementedError();
}
@override
String? get githubAuthToken => throw UnimplementedError();
@override
bool get inGithubContext => throw UnimplementedError();
@override
int? get issueNumber => 1;
@override
Future<List<GitFile>> listFilesForPR(Directory directory,
[List<Glob> ignoredFiles = const []]) async =>
files
.where((element) =>
ignoredFiles.none((p0) => p0.matches(element.filename)))
.toList();
@override
void notice({required String message}) {}
@override
final List<String> prLabels;
@override
Future<String> pullrequestBody() async => 'Test body';
@override
String? get refName => throw UnimplementedError();
@override
RepositorySlug? get repoSlug => RepositorySlug('test_owner', 'test_repo');
@override
String? get sha => 'test_sha';
}