feat(site): define domain models #131
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/thwap-pagesd!131
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/domain-models"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Define the core domain models in
internal/site:Site(site.go) —Name,Owner,RepoURL,Visibility,CustomDomain,PreviewEnabled,CreatedAtDeployment(deployment.go) —SiteName,Version,CommitSHA,Status,DeployedAtRepository(repository.go) —SiteName,CloneURL,WebhookID,LastSyncVisibilityenum —public,limited,private(own domain type, decoupled from the Forgejo SDK'sVisibleType)DeploymentStatusenum —pending,building,active,failedsite.goWhy
Phase 2 task #24 — the domain types that repository interfaces (#27) and services (#32) operate on.
Testing
go vet ./...go test -race ./internal/site/— 5 tests passgofmt -l ./cmd ./internalcleangolangci-lint run— 0 issuesBreaking Changes
None.
Notes
preview) and rollback states will be added in Phases 6/7.Closes #21
Closes #22
Closes #23
Closes #24
Review Summary
Verified locally on the PR head (
ac63480):go build,go vet,gofmt,golangci-lint runall clean; all 5 site tests pass with-race.The domain models are clean and well-documented. The
VisibilityandDeploymentStatusenums are properly decoupled from the Forgejo SDK as their own string types, with JSON tags ready for the Phase 5 API. Package comment correctly relocated tosite.go. Table-driven enum tests plus field-assignment coverage are appropriate for pure data models.No blocking issues.
Non-blocking observations:
Deploymenthas no identifier field —Sitekeys offName, but the upcomingDeploymentRepository(task #26) will likely need one. Worth considering an explicitIDwhen that lands.Deployment.Versionis a raw string;pkg/versionsemver parsing (Phase 3) will normalize it. Fine for now.Approving.