Skip to content

🗺️ Atlas: Extract GithubIssueError to github_issue module#600

Open
madmax983 wants to merge 1 commit into
trunkfrom
atlas-extract-github-issue-error-5475375121508458195
Open

🗺️ Atlas: Extract GithubIssueError to github_issue module#600
madmax983 wants to merge 1 commit into
trunkfrom
atlas-extract-github-issue-error-5475375121508458195

Conversation

@madmax983
Copy link
Copy Markdown
Owner

🕸️ Tangle: The GithubIssueError type is defined in the top-level error.rs file, which is a structural leak. The error type belongs with the specific GitHub issue handling logic.
📐 Blueprint: Moved the GithubIssueError enum from src/error.rs to its domain module src/run/github_issue.rs and updated the top-level Error enum 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.rs file.
🔬 Verification: Verified via cargo check, cargo test, and cargo clippy that the extraction compiles cleanly and causes no regressions.


PR created automatically by Jules for task 5475375121508458195 started by @madmax983

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>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

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
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.19%. Comparing base (9aa2ad9) to head (cbfdada).

Files with missing lines Patch % Lines
src/exit_code.rs 0.00% 4 Missing ⚠️

❌ 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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/run/github_issue.rs
Comment on lines +426 to +441
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),
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant