Skip to content

Refactor internal packages and fix git add for staged deletions - #116

Merged
thomas-vilte merged 2 commits into
masterfrom
dev
Jul 30, 2026
Merged

thomas-vilte merged 2 commits into
masterfrom
dev

Conversation

@thomas-vilte

@thomas-vilte thomas-vilte commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Description

I have reorganized several internal packages to improve the project's structure and simplify import paths. Specifically, the cost and routing related services have been moved from internal/services/cost and internal/services/routing to internal/cost and internal/routing respectively. Additionally, the CleanLabels helper function has been moved from internal/ai/gemini/helpers.go to internal/ai/gemini/helper.go.

I also addressed a bug in the git_service where calling AddFileToStaging on a file that was already staged for deletion would result in an error ("pathspec did not match any files"). The service now correctly handles this scenario as a no-op, preventing unnecessary failures.

Fixes #

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual test: The fix for handling already staged deleted files includes a dedicated unit test case (TestAddFileToStaging/Already_fully_staged_deleted_file_is_a_no-op) that reproduces the original failure and verifies the corrected behavior. Existing unit tests for the refactored packages were updated to reflect the new import paths and continue to pass.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Test Plan & Evidence

Suggested Manual Verification

  • API/Backend: Attach JSON response or logs as evidence of correct behavior
  • Performance: Ensure no significant latency increase
  • Unit Tests: Run go test ./... and ensure all tests pass
  • No Regressions: Verify that related features still work as expected

@thomas-vilte thomas-vilte changed the title placeholder Refactor internal packages and fix git add for staged deletions Jul 30, 2026
@thomas-vilte thomas-vilte added fix Bug fixes refactor Code restructuring or cleaning without functional changes test Testing, trials, and coverage labels Jul 30, 2026
@thomas-vilte
thomas-vilte merged commit af6c51c into master Jul 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fixes refactor Code restructuring or cleaning without functional changes test Testing, trials, and coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant