-
Work Estimates
Task Estimated Time Notes Review current model classes 15 min Quick scan of all domain objects to identify missing attributes Add new fields to all model classes 1–1.25 hours Includes new enums, annotations, and getters/setters Implement Commentvalue object10 min Lightweight POJO with text,author,createdAtAdd lifecycle hooks ( @PrePersist,@PreUpdate)20 min For createdAt/updatedAthandlingAdd Javadoc for new fields 30–40 min Focused only on new attributes Fix compilation + update failing tests 1 hour Adjust test data, assertions, etc. Git workflow (commit, push, PR) 10–15 min Clean, reviewable commit history Total Estimate: ~3.5 to 4 hours
-
Pull Request Domain Model — Concepts and Structure
This document outlines the core concepts and design of the Pull Request (PR) domain model for the Sztab project, with support for both simple and enterprise-grade workflows.
What Is a Pull Request?
A Pull Request (PR) is a proposal to merge changes from a source branch into a target branch. It typically includes:
- The code diffs
- Discussion threads (inline comments)
- Review decisions from peers or approvers
PullRequest Entity — Key Attributes
Field Description idUnique identifier titleConcise title of the PR descriptionOptional longer explanation sourceSource branch ( Branch)targetTarget branch ( Branch)authorThe user who opened the PR ( User)issueThe issue this PR addresses ( Issue)statusStatus of the PR (e.g., OPEN,MERGED,CLOSED)reviewersA set of users invited to review mandatoryReviewersSubset of reviewers required for merge approval reviewsCollection of Reviewentries (1 per reviewer)createdAt,updatedAtTimestamps comments(deprecated)Now modeled inside Review → Commenttrees
Review Model
Each invited reviewer may submit a Review object, which captures:
Field Description reviewerThe user submitting the review decisionThe review decision (see below) commentsA tree of threaded CommentsReviewDecision Enum
COMMENTED— Non-blocking commentsLGTM— "Looks Good To Me" (may not be sufficient to merge)APPROVED— Explicit approval to mergeCHANGES_REQUESTED— Blocking rejection
Comment Tree Structure
- Comments inside a
Reviewform a tree - A
Commentmay have:- A
parent(for replies) - A list of
children(nested responses)
- A
- This enables rich conversational flows like:
Comment 1: Rk: This might cause perf issues Author: Binary search may be overkill John: Spot on Rk, but let's defer post-MVP Rk: Agreed — created follow-up issue Comment 2: Mary: Does this scale on mobile? Author: UX review in progress UX Lead: Reviewing now
Mandatory Reviewers
- Not all reviewers may be mandatory
- PR merge logic can enforce:
- "Any one approval is enough"
- "All mandatory reviewers must approve"
- In some workflows, all reviewers are mandatory (e.g., leave
mandatoryReviewers = {}but interpret it as "ALL")
UI may highlight mandatory reviewers (e.g., boldface or badge)
Typical Merge Scenarios
Scenario reviewersmandatoryReviewersMerge Policy Solo developer PR [][]Auto-merge or self-merge Lightweight teams [rk][]Any reviewer may approve Required domain expert [rk, uma][uma]Only umamust approveMulti-domain approval (DB + UX) [rk, uma, john][uma, john]All must approve All reviewers must approve [rk, uma, john][rk, uma, john]Consensus required Interpretation when
mandatoryReviewers = {}:- May mean "ALL reviewers must approve"
- Should be configurable per project
LGTM vs Approval
- LGTM = Reviewer has scanned and has no objections. Does not imply permission to merge.
- Approval = Explicit sign-off to allow merge.
- Both can exist separately in the UI and model:
LGTM= "I'm okay with this"APPROVED= "I'm approving this for merge"
Summary
This model:
- Works for MVPs and small teams
- Scales to complex org workflows
- Encodes LGTM, Approval, Comment trees, and Merge Policy logic
- Leaves flexibility for UI and API enforcement
-
Work log — SZ-23: Flesh out domain objects and their attributes
Total time logged: 6 hours
(actual time spent ≈ 10.5h; capping to 6h due to missteps on 10/26 and cleanup overhead)Time Task Details 1.5h Domain model refactor – core entity fields - Added @Size,@NotBlank, and other validation annotations across all entities (Role,User,GitRepo,Project,Issue,Branch,PullRequest,Review,Comment)
- ExtractedReviewDecisionand other enums to separate files
- Used@Builder,@PrePersist,@PreUpdatehooks consistently
- IntroducedcreatedAtandupdatedAtto all major domain classes1.0h Lifecycle and timestamps - Added and tested @PrePersist/@PreUpdatelifecycle hooks
- Verified timestamp auto-population in unit tests1.0h Validation test suite - Added new validation test classes: RoleValidationTest,UserValidationTest,ProjectValidationTest,PullRequestValidationTest,ReviewValidationTest, etc.
- Added edge cases for@NotBlank,@Size,null, etc.
- Verified test coverage and constraint triggers0.5h Distinct branch validation - Added custom @DistinctBranchesannotation andDistinctBranchesValidatorto ensure base and compare branches differ in PRs
- Wrote unit testDistinctBranchesValidatorTest1.0h Swagger annotations & cleanup - Ensured @Schemaannotations present where needed (e.g.,@Schema(format = "date")onLocalDate)
- Verified Swagger UI loads cleanly
- Reorganized validation test filenames (PullRequestValidationTest.java, etc.)
- Applied consistent formatting1.0h Final polish + GitOps - Validated all tests pass ( mvn clean verify)
- Squashed and committed to branchbugfix/sz23-improve-domain-model-new
- Created PR, then merged intowolnoscvia fast-forward
- Tagged for future traceabilityNotes
- Although this ended up taking ~10.5h over 2.5 days due to test missteps on 10/26, I’m capping it at 6h in good faith.
- The extra effort led to long-term cleanup of technical debt and makes all domain models consistent and robust.
-
| Type |
Improvement
|
| Priority |
Normal
|
| Assignee | |
| Version |
1.0
|
| Sprints |
n/a
|
| Customer |
n/a
|
Issue Votes (0)
Summary
Flesh out all core domain model classes (
User,Role,Project,Issue,PullRequest,GitRepo) with the full set of attributes expected in a production-grade project management system.This step ensures each entity has all fields necessary for real-world use — including audit, visibility, and metadata fields — even if some attributes are not yet consumed by the UI or API.
Goals
Acceptance Criteria
User
Includes
displayName,avatarUrl,isActive,lastLoginAt,locale,timezone.Project
Includes
visibility(enum: PUBLIC, PRIVATE, INTERNAL),archived,createdBy,updatedBy.Issue
Includes
tags,dueDate,closedAt,duplicateOf.PullRequest
Includes
isDraft,reviewStatus,mergeStatus,reviewers.GitRepo
Includes
createdAt,updatedAt,createdBy,updatedBy,repoType.All entities
Include
createdAtandupdatedAtwith lifecycle hooks (@PrePersist,@PreUpdate).Comment value object
Created as a lightweight value object (not a JPA entity) with:
String textUser authorInstant createdAtJavadoc comments added for all new fields.
Enum classes created under
com.sztab.model.enumsfor any new enumerations.Notes
Commentis modeled as a value object, not a JPA entity.It can later be embedded inside an entity like
IssueCommentorPullRequestCommentif persistence is needed.Dependencies / Next Steps
Related Discussion
This work is part of a broader effort to make Sztab a professional-grade project management system — not just an internal prototype.
It ensures the domain model is expressive, maintainable, and ready for realistic use cases.