forked from bkinnightskytw/code_work_spawner
refactor: clarify tracker client naming (#6)
Rename the provider-aware tracker client and scope since cutoffs per provider so review-driven cleanup improves readability and avoids extra tracker fetches.
This commit is contained in:
parent
cf1d8ec782
commit
a474ed243d
|
|
@ -1,7 +1,7 @@
|
|||
export 'src/comment_templates.dart';
|
||||
export 'src/config.dart';
|
||||
export 'src/database.dart';
|
||||
export 'src/github_client.dart';
|
||||
export 'src/issue_tracker_client.dart';
|
||||
export 'src/issue_assistant_app.dart';
|
||||
export 'src/notifier.dart';
|
||||
export 'src/workspace_manager.dart';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import 'dart:convert';
|
|||
import 'dart:io';
|
||||
|
||||
import 'config.dart';
|
||||
import 'github_client.dart';
|
||||
import 'issue_tracker_client.dart';
|
||||
|
||||
class CliResponderRunner {
|
||||
Future<ResponderResult> run({
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import 'package:logging/logging.dart';
|
|||
import 'cli_responder.dart';
|
||||
import 'config.dart';
|
||||
import 'database.dart';
|
||||
import 'github_client.dart';
|
||||
import 'issue_tracker_client.dart';
|
||||
import 'notifier.dart';
|
||||
import 'workspace_manager.dart';
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ class IssueAssistantApp {
|
|||
|
||||
final AppConfig config;
|
||||
final AppDatabase database;
|
||||
final GitHubClient issueTrackerClient;
|
||||
final IssueTrackerClient issueTrackerClient;
|
||||
final CliResponderRunner responderRunner;
|
||||
final WorkspaceManager workspaceManager;
|
||||
final NotifierRegistry Function(ProjectConfig project)
|
||||
|
|
@ -50,7 +50,7 @@ class IssueAssistantApp {
|
|||
return IssueAssistantApp._(
|
||||
config: config,
|
||||
database: database,
|
||||
issueTrackerClient: GitHubClient(
|
||||
issueTrackerClient: IssueTrackerClient(
|
||||
ghCommand: ghCommand,
|
||||
teaCommand: teaCommand,
|
||||
),
|
||||
|
|
@ -259,14 +259,6 @@ class IssueAssistantApp {
|
|||
}
|
||||
|
||||
try {
|
||||
final batchSince = sinceByProject.values
|
||||
.whereType<DateTime>()
|
||||
.fold<DateTime?>(null, (current, next) {
|
||||
if (current == null || next.isBefore(current)) {
|
||||
return next;
|
||||
}
|
||||
return current;
|
||||
});
|
||||
final issuesByProject = <String, List<GitHubIssueSummary>>{
|
||||
for (final project in projects) project.key: <GitHubIssueSummary>[],
|
||||
};
|
||||
|
|
@ -277,11 +269,20 @@ class IssueAssistantApp {
|
|||
if (providerProjects.isEmpty) {
|
||||
continue;
|
||||
}
|
||||
final providerSince = providerProjects
|
||||
.map((project) => sinceByProject[project.key])
|
||||
.whereType<DateTime>()
|
||||
.fold<DateTime?>(null, (current, next) {
|
||||
if (current == null || next.isBefore(current)) {
|
||||
return next;
|
||||
}
|
||||
return current;
|
||||
});
|
||||
|
||||
final issues = await issueTrackerClient.fetchUpdatedIssuesForRepos(
|
||||
provider: provider,
|
||||
repos: providerProjects.map((project) => project.repoSlug),
|
||||
since: batchSince,
|
||||
since: providerSince,
|
||||
);
|
||||
for (final issue in issues) {
|
||||
final project =
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import 'package:github/github.dart';
|
|||
|
||||
import 'config_schema.dart';
|
||||
|
||||
class GitHubClient {
|
||||
GitHubClient({this.ghCommand = 'gh', this.teaCommand = 'tea'});
|
||||
class IssueTrackerClient {
|
||||
IssueTrackerClient({this.ghCommand = 'gh', this.teaCommand = 'tea'});
|
||||
|
||||
final String ghCommand;
|
||||
final String teaCommand;
|
||||
Loading…
Reference in New Issue