Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix saving of comment ids to disk #221

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkgs/firehose/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.1

- Fix comment ID serialization to disk.

## 0.5.0

- Split health checks in individual workflows.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/firehose/lib/src/github.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class GithubApi {
/// Find a comment on the PR matching the given criteria ([user],
/// [searchTerm]). Return the issue ID if a matching comment is found or null
/// if there's no match.
Future<IssueComment?> findCommentId({
Future<int?> findCommentId({
required String user,
String? searchTerm,
}) async {
Expand All @@ -107,7 +107,7 @@ class GithubApi {
},
orElse: () => null,
);
return matchingComment;
return matchingComment?.id;
}

Future<List<GitFile>> listFilesForPR() async => await github.pullRequests
Expand Down
2 changes: 1 addition & 1 deletion pkgs/firehose/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: firehose
description: A tool to automate publishing of Pub packages from GitHub actions.
version: 0.5.0
version: 0.5.1
repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose

environment:
Expand Down
4 changes: 2 additions & 2 deletions pkgs/firehose/test/github_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ Future<void> main() async {
});
test('Find comment', () async {
var commentId = await github.findCommentId(user: 'auto-submit[bot]');
expect(commentId?.id, 1660891263);
expect(commentId, 1660891263);
});
test('Find comment with searchterm', () async {
var commentId = await github.findCommentId(
user: 'auto-submit[bot]',
searchTerm: 'before re-applying this label.',
);
expect(commentId?.id, 1660891263);
expect(commentId, 1660891263);
});
test('Find comment with searchterm', () async {
var commentId = await github.findCommentId(
Expand Down