🗺️ Atlas: Extract GithubIssueError to github_issue module#600
Conversation
Extracted GithubIssueError from the centralized error.rs to its domain module at src/run/github_issue.rs. This improves module cohesion by locating error types closer to the code that throws them and reduces the bloat of the top-level error.rs file. Updated the top-level Error enum and exit_code.rs to correctly reference the new location. Verified that the project successfully compiles and passes tests with these changes. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## trunk #600 +/- ##
==========================================
- Coverage 85.19% 85.19% -0.01%
==========================================
Files 114 114
Lines 65408 65408
==========================================
- Hits 55725 55723 -2
- Misses 9683 9685 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request refactors the codebase by moving the GithubIssueError enum from src/error.rs to src/run/github_issue.rs and updating its references. The review feedback correctly notes that defining production code and imports below the tests module is non-idiomatic in Rust, and recommends moving the enum definition above the test module and placing the import at the top of the file.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| use thiserror::Error; | ||
|
|
||
| #[derive(Debug, Error)] | ||
| pub enum GithubIssueError { | ||
| #[error("missing GitHub token: set `{0}` to a PAT or GitHub App installation token")] | ||
| MissingToken(String), | ||
|
|
||
| #[error("GitHub issue or repo not found: {0}")] | ||
| NotFound(String), | ||
|
|
||
| #[error("GitHub API rate limited: {0}")] | ||
| RateLimited(String), | ||
|
|
||
| #[error("GitHub API request failed: {0}")] | ||
| RequestFailed(String), | ||
| } |
There was a problem hiding this comment.
In Rust, the tests module (typically marked with #[cfg(test)]) should be the last block in the file. Defining production code, such as the GithubIssueError enum and its imports, after the tests module is non-idiomatic and makes the code harder to maintain and navigate.
To improve maintainability and adhere to standard Rust conventions, please move the GithubIssueError definition and the use thiserror::Error; import above the mod tests block, and place the import at the top of the file with the other imports.
🕸️ Tangle: The
GithubIssueErrortype is defined in the top-levelerror.rsfile, which is a structural leak. The error type belongs with the specific GitHub issue handling logic.📐 Blueprint: Moved the
GithubIssueErrorenum fromsrc/error.rsto its domain modulesrc/run/github_issue.rsand updated the top-levelErrorenum to reference the new location.🧱 Stability: Improved module cohesion by keeping domain-specific error types close to the logic that generates them, reducing the bloat of the central
error.rsfile.🔬 Verification: Verified via
cargo check,cargo test, andcargo clippythat the extraction compiles cleanly and causes no regressions.PR created automatically by Jules for task 5475375121508458195 started by @madmax983