chore: inline find-comment/create-or-update-comment#413
Conversation
Some Google repos don't like actions from "outside the enterprise"
There was a problem hiding this comment.
Code Review
This pull request introduces a new comment CLI tool in pkgs/firehose/bin/comment.dart for finding, creating, and updating GitHub comments. It also extends the GithubApi and LocalGithubApi classes with createComment and updateComment methods. The review feedback identifies improvement opportunities regarding resource management, specifically closing the GithubApi instance to prevent leaks, and enhancing input validation for the issue number in the create-or-update command.
PR HealthLicense Headers ✔️
All source files should start with a license header. This check can be disabled by tagging the PR with Unused Dependencies ✔️
For details on how to fix these, see dependency_validator. This check can be disabled by tagging the PR with Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with
Coverage
|
| File | Coverage |
|---|---|
| pkgs/firehose/lib/src/github.dart | 💔 55 % ⬇️ 7 % |
| pkgs/firehose/lib/src/local_github_api.dart | 💔 42 % ⬇️ 13 % |
This check for test coverage is informational (issues shown here will not fail the PR).
This check can be disabled by tagging the PR with skip-coverage-check.
Breaking changes ✔️
| Package | Change | Current Version | New Version | Needed Version | Looking good? |
|---|---|---|---|---|---|
| firehose | Non-Breaking | 0.13.0 | 0.13.2-wip | 0.13.2-wip | ✔️ |
This check can be disabled by tagging the PR with skip-breaking-check.
API leaks ✔️
The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
| Package | Leaked API symbol | Leaking sources |
|---|
This check can be disabled by tagging the PR with skip-leaking-check.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new comment executable to the firehose package, enabling the management of GitHub comments as a first-class command. The changes include a new CLI tool in bin/comment.dart, updates to the GithubApi to support creating and updating comments, and registration of the new executable in pubspec.yaml. The review feedback suggests enhancing the tool's robustness by implementing better error handling for API failures, validating that comment bodies are not empty, and avoiding potential null pointer exceptions when accessing repository information.
| // 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'; |
There was a problem hiding this comment.
~150 lines for bits we don't need to depend on seems worth it.
|
|
||
| String? get githubAuthToken => _env['GITHUB_TOKEN']; | ||
|
|
||
| late final RepositorySlug? _resolvedSlug = _repoSlug ?? |
There was a problem hiding this comment.
This makes error cases a LOT cleaner to understand
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new comment executable to the firehose package, allowing for the discovery, creation, and updating of GitHub comments directly. It also refactors GithubApi to improve repository slug handling and adds methods for comment management. Critical feedback was provided regarding the incorrect use of the ArgResults API in the new CLI tool, which would cause runtime errors. Additionally, improvements were suggested for error handling in GithubApi by replacing null-assertion operators with a descriptive helper getter for the issue number.
|
@mosuem this is ready. I've ran a few loops through and the comments are still nicely updated |
|
|
||
| - name: Install firehose | ||
| - name: Install firehose (internal) | ||
| if: ${{ !inputs.local_debug && github.repository == 'dart-lang/ecosystem' }} |
| // 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'; |
Some Google repos don't like actions from "outside the enterprise"
Other fixes:
firehoseduring PRs to THIS repo, so they can be validated together.github.dartfilenullbits to give helpful errorsPartially addresses #395