Skip to content

Commit

Permalink
chore: add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan-Nelson committed Sep 6, 2024
1 parent c87d9d6 commit 2a65995
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/aft/lib/src/repo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class Repo {
AftConfig aftConfig, {
AWSLogger? logger,
}) async {
logger?.info('### root: ${aftConfig.rootDirectory.toFilePath()}');
logger?.info('### workingDirectory: ${aftConfig.workingDirectory}');
final gitDir = await GitDir.fromExisting(
aftConfig.rootDirectory.toFilePath(),
);
Expand Down Expand Up @@ -71,6 +73,7 @@ class Repo {
/// the base git reference for calculating changes relevant to this version
/// bump.
Future<String?> latestBumpRef(PackageInfo package) async {
logger.info('latestBumpRef');
final packageName = package.name;
final component = components[packageName]?.name ??
components.values
Expand All @@ -90,10 +93,12 @@ class Repo {
(commitMessage.updatedComponents.contains(component) ||
commitMessage.updatedComponents.contains(packageName) ||
commitMessage.updatedComponents.isEmpty)) {
logger.info('commitMessage.sha: ${commitMessage.sha}');
return commitMessage.sha;
}
(sha, commit) = await git.commitRef(commit.parents.first);
}
logger.info('commitMessage.sha: null');
return null;
}

Expand Down Expand Up @@ -151,6 +156,8 @@ class Repo {
/// Collect all the packages which have changed between [baseRef]..[headRef]
/// and the commits which changed them.
Future<GitChanges> changes(String baseRef, String headRef) async {
logger.info('baseRef: $baseRef');
logger.info('headRef: $headRef');
final baseTree = (await git.commitFromRevision(baseRef)).treeSha;
final headTree = (await git.commitFromRevision(headRef)).treeSha;
final diffMarker = (baseTree, headTree);
Expand Down

0 comments on commit 2a65995

Please sign in to comment.