Skip to content

refactor: use proper module name#542

Merged
steveiliop56 merged 2 commits into
mainfrom
refactor/module
Dec 26, 2025
Merged

refactor: use proper module name#542
steveiliop56 merged 2 commits into
mainfrom
refactor/module

Conversation

@steveiliop56
Copy link
Copy Markdown
Member

@steveiliop56 steveiliop56 commented Dec 26, 2025

Summary by CodeRabbit

  • Chores
    • Updated internal module paths and dependencies for improved maintainability.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 26, 2025

📝 Walkthrough

Walkthrough

This pull request updates all internal import paths across the codebase from local module-style imports (tinyauth/internal/...) to fully qualified GitHub module paths (github.com/steveiliop56/tinyauth/internal/...). Additionally, go.mod is updated with new dependencies including OTP, LDAP, and Docker support. No functional logic, control flow, or API changes are introduced.

Changes

Cohort / File(s) Summary
Command files
cmd/tinyauth/generate.go, cmd/tinyauth/tinyauth.go, cmd/tinyauth/verify.go, cmd/tinyauth/version.go
Updated import paths to use fully qualified module paths; no logic changes
Bootstrap configuration
internal/bootstrap/app_bootstrap.go, internal/bootstrap/router_bootstrap.go, internal/bootstrap/service_bootstrap.go
All three files updated with new module-qualified import paths; initialization logic unchanged
Controller layer
internal/controller/context_controller.go, internal/controller/oauth_controller.go, internal/controller/proxy_controller.go, internal/controller/user_controller.go, internal/controller/*_test.go
All controllers and their tests updated with module-qualified imports; no behavioral changes
Middleware layer
internal/middleware/context_middleware.go, internal/middleware/ui_middleware.go
Import path updates for assets and config packages; no functional changes
Service layer
internal/service/access_controls_service.go, internal/service/auth_service.go, internal/service/database_service.go, internal/service/docker_service.go, internal/service/generic_oauth_service.go, internal/service/github_oauth_service.go, internal/service/google_oauth_service.go, internal/service/oauth_broker_service.go
All service files updated with fully qualified module import paths; no control flow or error handling changes
Utility layer & tests
internal/utils/app_utils.go, internal/utils/user_utils.go, internal/utils/loaders/loader_env.go, internal/utils/*/\*_test.go
Utility files and comprehensive test suite updated with new module paths; no logic changes
Dependency manifest
go.mod
Significant rebalancing: adds charmbracelet/huh, docker/docker, go-ldap/ldap/v3, pquerna/otp, oauth2, and related extensions; removes several indirect transitive dependencies; updates versions for otp, otel, sqlite, and other modules

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • Rycochet

Poem

🐰 Imports once local, now spread far and wide,
GitHub's full path becomes our guide.
Dependencies dance, old and new,
Module refactoring, hop-hop through!
No logic harmed, just routes refined,
A cleaner import structure in mind! 🌟

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: use proper module name' directly corresponds to the main change: updating all import paths from local module aliases (tinyauth/internal/...) to full module paths (github.com/steveiliop56/tinyauth/internal/...) across the entire codebase.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/module

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7269fa1 and b58275d.

📒 Files selected for processing (35)
  • cmd/tinyauth/generate.go
  • cmd/tinyauth/tinyauth.go
  • cmd/tinyauth/verify.go
  • cmd/tinyauth/version.go
  • go.mod
  • internal/bootstrap/app_bootstrap.go
  • internal/bootstrap/router_bootstrap.go
  • internal/bootstrap/service_bootstrap.go
  • internal/controller/context_controller.go
  • internal/controller/context_controller_test.go
  • internal/controller/oauth_controller.go
  • internal/controller/proxy_controller.go
  • internal/controller/proxy_controller_test.go
  • internal/controller/resources_controller_test.go
  • internal/controller/user_controller.go
  • internal/controller/user_controller_test.go
  • internal/middleware/context_middleware.go
  • internal/middleware/ui_middleware.go
  • internal/service/access_controls_service.go
  • internal/service/auth_service.go
  • internal/service/database_service.go
  • internal/service/docker_service.go
  • internal/service/generic_oauth_service.go
  • internal/service/github_oauth_service.go
  • internal/service/google_oauth_service.go
  • internal/service/oauth_broker_service.go
  • internal/utils/app_utils.go
  • internal/utils/app_utils_test.go
  • internal/utils/decoders/label_decoder_test.go
  • internal/utils/label_utils_test.go
  • internal/utils/loaders/loader_env.go
  • internal/utils/security_utils_test.go
  • internal/utils/string_utils_test.go
  • internal/utils/user_utils.go
  • internal/utils/user_utils_test.go
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-27T11:02:49.689Z
Learnt from: steveiliop56
Repo: steveiliop56/tinyauth PR: 326
File: internal/service/database_service.go:7-11
Timestamp: 2025-08-27T11:02:49.689Z
Learning: In internal/service/database_service.go, using glebarez/sqlite (modernc) for GORM with sqlite3 (mattn) driver for golang-migrate is a valid pattern that works correctly, despite appearing to be a driver mismatch. The golang-migrate sqlite driver causes panics when used with modernc.org/sqlite backend, so the mixed approach should be maintained.

Applied to files:

  • go.mod
  • internal/service/database_service.go
📚 Learning: 2025-06-25T14:57:03.955Z
Learnt from: steveiliop56
Repo: steveiliop56/tinyauth PR: 211
File: internal/utils/utils.go:373-407
Timestamp: 2025-06-25T14:57:03.955Z
Learning: In Go applications using the gin web framework, IP addresses extracted from gin.Context (like from request headers or remote address) are already validated by the framework and don't require additional validation in utility functions that process them.

Applied to files:

  • internal/controller/context_controller.go
  • internal/bootstrap/router_bootstrap.go
  • internal/utils/app_utils.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (go)
🔇 Additional comments (37)
cmd/tinyauth/verify.go (1)

8-9: LGTM!

The import path is correctly updated to use the fully qualified GitHub module path, which aligns with Go module conventions.

internal/middleware/ui_middleware.go (1)

10-11: LGTM!

The assets import path is correctly updated to the fully qualified module path.

internal/middleware/context_middleware.go (1)

6-9: LGTM!

All internal imports are correctly updated to use the fully qualified GitHub module paths.

internal/utils/label_utils_test.go (1)

5-6: LGTM!

The test import path is correctly updated to the fully qualified module path.

internal/utils/user_utils_test.go (1)

6-7: LGTM!

The test import path is correctly updated to the fully qualified module path.

cmd/tinyauth/tinyauth.go (1)

8-11: LGTM!

All internal imports for bootstrap, config, and loaders are correctly updated to the fully qualified GitHub module paths.

internal/utils/string_utils_test.go (1)

5-6: LGTM!

The test import path is correctly updated to the fully qualified module path.

internal/controller/proxy_controller.go (1)

8-11: LGTM!

All internal imports for config, service, and utils are correctly updated to the fully qualified GitHub module paths.

internal/bootstrap/app_bootstrap.go (1)

14-18: LGTM! Import paths correctly updated to use the full module path.

The import path updates from tinyauth/internal/... to github.com/steveiliop56/tinyauth/internal/... are correct and align with Go module best practices.

internal/controller/proxy_controller_test.go (1)

6-9: LGTM! Test imports correctly updated to module-qualified paths.

The import path updates are consistent with the PR objectives and maintain all test functionality unchanged.

internal/utils/loaders/loader_env.go (1)

7-7: LGTM! Import path correctly updated.

internal/utils/security_utils_test.go (1)

7-7: LGTM! Import path correctly updated.

internal/controller/resources_controller_test.go (1)

8-8: LGTM! Import path correctly updated.

internal/utils/decoders/label_decoder_test.go (1)

6-7: LGTM! Import paths correctly updated.

cmd/tinyauth/version.go (1)

6-6: LGTM! Import path correctly updated.

internal/utils/app_utils_test.go (2)

6-7: LGTM! Import paths correctly updated.


1-208: Import path refactoring is complete and correct.

The verification confirms:

  • go.mod has the correct module directive: module github.com/steveiliop56/tinyauth
  • All import paths throughout the codebase use the correct format with no old paths remaining
  • The tests shown in the snippet pass successfully (TestGetRootDomain, TestParseFileToLine, TestFilter, TestGetContext, TestIsRedirectSafe)

The build currently fails with internal/assets/assets.go:9:12: pattern dist: no matching files found, but this is due to a missing dist directory (a build artifact), not related to the import path refactoring. This is a separate infrastructure/build configuration issue that needs to be addressed independently (likely requires building frontend assets or adjusting the embed path).

internal/utils/app_utils.go (1)

8-9: LGTM! Import path correctly updated to use full module path.

The import path has been properly updated from the local-style reference to the full GitHub module path, aligning with the module declaration in go.mod. No functional changes.

cmd/tinyauth/generate.go (1)

9-10: LGTM! Import path correctly updated.

The import path update is correct and consistent with the module-wide refactoring.

go.mod (2)

1-1: LGTM! Module declaration is correct.

The module path github.com/steveiliop56/tinyauth is properly declared, enabling the use of full module paths for internal imports throughout the codebase.


9-24: Dependencies verified and properly aligned with features.

All newly added dependencies are intentionally included and actively used:

  • charmbracelet/huh for interactive CLI forms in create, generate, and verify commands
  • docker/docker for Docker service integration
  • go-ldap/ldap/v3 for LDAP authentication support
  • pquerna/otp for TOTP/OTP generation and verification
  • golang.org/x/oauth2 for OAuth2 provider integration (Google, GitHub, generic)
internal/bootstrap/router_bootstrap.go (1)

7-8: LGTM! Import paths correctly updated.

The import paths for internal controller and middleware packages have been properly updated to use the full module path.

internal/service/google_oauth_service.go (1)

14-14: LGTM! Import path correctly updated.

The import path update for the internal config package is correct and consistent with the module-wide refactoring.

internal/controller/user_controller.go (1)

7-9: LGTM! Import paths correctly updated.

All internal package imports have been properly updated to use the full module path, maintaining consistency across the codebase.

internal/service/access_controls_service.go (1)

4-4: LGTM! Import path correctly updated.

The import path for the internal config package has been properly updated to use the full module path.

internal/service/database_service.go (1)

9-9: LGTM! Import path correctly updated.

The import path for the internal assets package has been properly updated to use the full module path. The database driver setup remains unchanged and correct.

internal/service/github_oauth_service.go (1)

13-14: LGTM! Import path updated correctly.

The import path has been updated to use the full GitHub module path, aligning with Go module best practices.

internal/service/auth_service.go (1)

11-14: LGTM! Multiple import paths updated correctly.

All three internal package imports now use the full GitHub module path consistently.

internal/controller/oauth_controller.go (1)

8-11: LGTM! Import paths updated correctly.

All internal imports now reference the full module path, ensuring proper module resolution.

internal/controller/user_controller_test.go (1)

10-13: LGTM! Test imports updated correctly.

The test file imports now use the full module path, maintaining consistency with the production code refactoring.

internal/utils/user_utils.go (1)

6-7: LGTM! Import path updated correctly.

The config package import now uses the full GitHub module path.

internal/controller/context_controller.go (1)

6-7: LGTM! Import path updated correctly.

The utils package import now uses the full module path.

internal/service/docker_service.go (1)

6-8: LGTM! Import paths updated correctly.

Both internal imports now use the full GitHub module path, completing the refactoring for this file.

internal/bootstrap/service_bootstrap.go (1)

3-7: Import path correctly updated to use full module path.

Verification confirms no old-style imports remain and all internal imports consistently use the new format github.com/steveiliop56/tinyauth/internal/... across the codebase.

internal/service/oauth_broker_service.go (1)

5-6: LGTM: Import path updated correctly.

The import path has been properly updated to use the fully qualified GitHub module path.

internal/service/generic_oauth_service.go (1)

13-14: LGTM: Import path updated correctly.

The import path has been properly updated to use the fully qualified GitHub module path.

internal/controller/context_controller_test.go (1)

7-9: LGTM: Import paths updated correctly and consistently applied.

All imports have been properly updated to use fully qualified GitHub module paths (github.com/steveiliop56/tinyauth/internal/...). Verification confirms go.mod matches this strategy and no old-style import paths remain across the entire codebase.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 20.61%. Comparing base (7269fa1) to head (b58275d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #542   +/-   ##
=======================================
  Coverage   20.61%   20.61%           
=======================================
  Files          37       37           
  Lines        2130     2130           
=======================================
  Hits          439      439           
  Misses       1661     1661           
  Partials       30       30           

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@steveiliop56 steveiliop56 merged commit a1c3e41 into main Dec 26, 2025
8 checks passed
@Rycochet Rycochet deleted the refactor/module branch April 1, 2026 16:08
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