Skip to content

feat: extract tenancy into standalone module#91

Merged
ren0503 merged 1 commit intomasterfrom
feat/ren/90-split-tenancy-to-another-module
Jan 7, 2026
Merged

feat: extract tenancy into standalone module#91
ren0503 merged 1 commit intomasterfrom
feat/ren/90-split-tenancy-to-another-module

Conversation

@ren0503
Copy link
Contributor

@ren0503 ren0503 commented Jan 7, 2026

  • Create separate tenancy package with own go.mod (github.com/tinh-tinh/tenancy)
  • Move tenancy.go and tenancy_test.go to new package structure
  • Update import paths in test file
  • Improve modularity by decoupling tenancy from core ORM infrastructure

- Create separate tenancy package with own go.mod (github.com/tinh-tinh/tenancy)
- Move tenancy.go and tenancy_test.go to new package structure
- Update import paths in test file
- Improve modularity by decoupling tenancy from core ORM infrastructure
@ren0503 ren0503 added this to the SQL ORM Release v2.5.0 milestone Jan 7, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

Summary by CodeRabbit

  • Chores
    • Module infrastructure and dependency initialization updates.

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

Walkthrough

A new Go module is created for the tenancy package at github.com/tinh-tinh/tenancy with its own manifest file defining dependencies. The import path in the test file is updated to reference the new independent module location instead of the previous nested path within sqlorm.

Changes

Cohort / File(s) Summary
Module initialization
tenancy/go.mod
New module manifest establishing tenancy as an independent Go module with Go 1.24.0+ compatibility and dependencies including testify, sqlorm v2, gorm variants, and transitive libraries
Import path updates
tenancy/tenancy_test.go
Updated import path from github.com/tinh-tinh/sqlorm/v2/tenancy to github.com/tinh-tinh/tenancy to reflect new module location

Possibly related issues

Poem

🐰 A tenancy once nested deep,
Now hops free with bounds so steep,
Its own module, proud and bright,
Dependencies aligned just right! 🌱

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: extracting tenancy into a standalone module, which is directly reflected in the go.mod creation and import path updates in the changeset.
Description check ✅ Passed The description is directly related to the changeset, detailing the creation of a new go.mod file, package structure changes, import path updates, and modularity improvements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c754c01 and eba1d5c.

⛔ Files ignored due to path filters (1)
  • tenancy/go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • tenancy/go.mod
  • tenancy/tenancy_test.go
🔇 Additional comments (3)
tenancy/tenancy_test.go (1)

10-10: LGTM! Import path correctly updated for the new module.

The import path change from github.com/tinh-tinh/sqlorm/v2/tenancy to github.com/tinh-tinh/tenancy aligns with the module extraction objective and matches the module path defined in go.mod.

tenancy/go.mod (2)

3-5: Go versions 1.24.0 and 1.24.1 are valid releases and suitable for production.

Both versions are officially released: Go 1.24.0 (February 11, 2025) and Go 1.24.1 (March 4, 2025). The go.mod configuration specifying 1.24.0 as the minimum version and 1.24.1 as the recommended toolchain is appropriate. Note that 1.24.1 includes security fixes (including CVE-2025-22870) over 1.24.0.


7-13: Dependencies are secure and free from known vulnerabilities.

Verification across NVD, Snyk, and OSV databases confirms no CVEs affect any of the specified versions: testify v1.9.0, gorm.io/gorm v1.30.1, gorm.io/driver/postgres v1.5.9, or the other dependencies listed. The only historical GORM CVE (CVE-2019-15562) affects versions prior to 1.9.10 and does not impact v1.30.1.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ren0503 ren0503 linked an issue Jan 7, 2026 that may be closed by this pull request
@ren0503 ren0503 merged commit 0572f0f into master Jan 7, 2026
2 checks passed
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.

Split Tenancy Support into a Separate Module

2 participants