Improve promptTypes Documentation#29
Conversation
…bers, and Tutors fields
WalkthroughAdds extensive inline documentation across many promptTypes files, introduces a new gender constant, refactors Changes
Sequence Diagram(s)(The changes are documentation-focused and do not introduce new control-flow or runtime interactions; no sequence diagram provided.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Potential points needing attention:
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
…riptions for clarity in ApplicationAnswer, CoursePhaseParticipation, Gender, MetaData, Person, PhaseCopy, Student, StudyDegree, and Team types.
mathildeshagl
left a comment
There was a problem hiding this comment.
just a few small inline comments
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (3)
promptTypes/metaData.go (1)
3-12: Preferanyoverinterface{}for modern Go styleSince Go 1.18 the predeclared identifier
anyis the canonical alias forinterface{}. Migrating tomap[string]anykeeps the semantics identical while matching current language idioms.-type MetaData map[string]interface{} +type MetaData map[string]anypromptTypes/student.go (1)
30-33: Consider typed constants for genderHard-coding the allowed literals twice (code + tag) risks drift. Defining
const ( GenderMale Gender = "male" … )and re-using those values in both the tag and business logic improves maintainability.promptTypes/coursePhaseParticipation.go (1)
12-15: EnforcePassStatusvaluesSince the doc lists the allowed statuses, add
binding:"oneof=passed failed not_assessed"or makePassStatusa dedicated enum-type string to prevent invalid inputs slipping through.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
promptTypes/applicationAnswer.go(1 hunks)promptTypes/coursePhaseParticipation.go(1 hunks)promptTypes/gender.go(1 hunks)promptTypes/metaData.go(1 hunks)promptTypes/person.go(1 hunks)promptTypes/phaseCopy.go(1 hunks)promptTypes/student.go(1 hunks)promptTypes/studyDegree.go(1 hunks)promptTypes/team.go(1 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: mathildeshagl
PR: ls1intum/Prompt-SDK#24
File: promptTypes/copyRequest.go:5-8
Timestamp: 2025-07-06T12:18:51.959Z
Learning: The Prompt-SDK project does not follow the Go convention of adding GoDoc comments to exported types. Most exported types in the codebase (Student, MetaData, Gender, StudyDegree, Resolution, etc.) lack GoDoc comments, with only TokenUser being documented. The project maintains consistency by not requiring GoDoc comments for exported types.
Learnt from: mathildeshagl
PR: ls1intum/Prompt-SDK#22
File: resolution.go:26-29
Timestamp: 2025-06-21T11:14:56.130Z
Learning: In resolution.go, the struct rename from CoursePhaseParticipationWithResolution to CoursePhaseParticipationWithResolutions and field change from Resolution to Resolutions []Resolution was a consistency fix, not a breaking change. Everything using this endpoint already had the correct structure with multiple resolutions, but this particular struct definition was outdated and didn't match existing usage patterns.
promptTypes/studyDegree.go (2)
Learnt from: mathildeshagl
PR: #24
File: promptTypes/copyRequest.go:5-8
Timestamp: 2025-07-06T12:18:51.959Z
Learning: The Prompt-SDK project does not follow the Go convention of adding GoDoc comments to exported types. Most exported types in the codebase (Student, MetaData, Gender, StudyDegree, Resolution, etc.) lack GoDoc comments, with only TokenUser being documented. The project maintains consistency by not requiring GoDoc comments for exported types.
Learnt from: mathildeshagl
PR: #22
File: resolution.go:26-29
Timestamp: 2025-06-21T11:14:56.130Z
Learning: In resolution.go, the struct rename from CoursePhaseParticipationWithResolution to CoursePhaseParticipationWithResolutions and field change from Resolution to Resolutions []Resolution was a consistency fix, not a breaking change. Everything using this endpoint already had the correct structure with multiple resolutions, but this particular struct definition was outdated and didn't match existing usage patterns.
promptTypes/metaData.go (1)
Learnt from: mathildeshagl
PR: #24
File: promptTypes/copyRequest.go:5-8
Timestamp: 2025-07-06T12:18:51.959Z
Learning: The Prompt-SDK project does not follow the Go convention of adding GoDoc comments to exported types. Most exported types in the codebase (Student, MetaData, Gender, StudyDegree, Resolution, etc.) lack GoDoc comments, with only TokenUser being documented. The project maintains consistency by not requiring GoDoc comments for exported types.
promptTypes/applicationAnswer.go (2)
Learnt from: mathildeshagl
PR: #24
File: promptTypes/copyRequest.go:5-8
Timestamp: 2025-07-06T12:18:51.959Z
Learning: The Prompt-SDK project does not follow the Go convention of adding GoDoc comments to exported types. Most exported types in the codebase (Student, MetaData, Gender, StudyDegree, Resolution, etc.) lack GoDoc comments, with only TokenUser being documented. The project maintains consistency by not requiring GoDoc comments for exported types.
Learnt from: mathildeshagl
PR: #22
File: resolution.go:26-29
Timestamp: 2025-06-21T11:14:56.130Z
Learning: In resolution.go, the struct rename from CoursePhaseParticipationWithResolution to CoursePhaseParticipationWithResolutions and field change from Resolution to Resolutions []Resolution was a consistency fix, not a breaking change. Everything using this endpoint already had the correct structure with multiple resolutions, but this particular struct definition was outdated and didn't match existing usage patterns.
promptTypes/gender.go (1)
Learnt from: mathildeshagl
PR: #24
File: promptTypes/copyRequest.go:5-8
Timestamp: 2025-07-06T12:18:51.959Z
Learning: The Prompt-SDK project does not follow the Go convention of adding GoDoc comments to exported types. Most exported types in the codebase (Student, MetaData, Gender, StudyDegree, Resolution, etc.) lack GoDoc comments, with only TokenUser being documented. The project maintains consistency by not requiring GoDoc comments for exported types.
promptTypes/student.go (2)
Learnt from: mathildeshagl
PR: #24
File: promptTypes/copyRequest.go:5-8
Timestamp: 2025-07-06T12:18:51.959Z
Learning: The Prompt-SDK project does not follow the Go convention of adding GoDoc comments to exported types. Most exported types in the codebase (Student, MetaData, Gender, StudyDegree, Resolution, etc.) lack GoDoc comments, with only TokenUser being documented. The project maintains consistency by not requiring GoDoc comments for exported types.
Learnt from: mathildeshagl
PR: #22
File: resolution.go:26-29
Timestamp: 2025-06-21T11:14:56.130Z
Learning: In resolution.go, the struct rename from CoursePhaseParticipationWithResolution to CoursePhaseParticipationWithResolutions and field change from Resolution to Resolutions []Resolution was a consistency fix, not a breaking change. Everything using this endpoint already had the correct structure with multiple resolutions, but this particular struct definition was outdated and didn't match existing usage patterns.
promptTypes/coursePhaseParticipation.go (2)
Learnt from: mathildeshagl
PR: #22
File: resolution.go:26-29
Timestamp: 2025-06-21T11:14:56.130Z
Learning: In resolution.go, the struct rename from CoursePhaseParticipationWithResolution to CoursePhaseParticipationWithResolutions and field change from Resolution to Resolutions []Resolution was a consistency fix, not a breaking change. Everything using this endpoint already had the correct structure with multiple resolutions, but this particular struct definition was outdated and didn't match existing usage patterns.
Learnt from: mathildeshagl
PR: #24
File: promptTypes/copyRequest.go:5-8
Timestamp: 2025-07-06T12:18:51.959Z
Learning: The Prompt-SDK project does not follow the Go convention of adding GoDoc comments to exported types. Most exported types in the codebase (Student, MetaData, Gender, StudyDegree, Resolution, etc.) lack GoDoc comments, with only TokenUser being documented. The project maintains consistency by not requiring GoDoc comments for exported types.
promptTypes/team.go (2)
Learnt from: mathildeshagl
PR: #24
File: promptTypes/copyRequest.go:5-8
Timestamp: 2025-07-06T12:18:51.959Z
Learning: The Prompt-SDK project does not follow the Go convention of adding GoDoc comments to exported types. Most exported types in the codebase (Student, MetaData, Gender, StudyDegree, Resolution, etc.) lack GoDoc comments, with only TokenUser being documented. The project maintains consistency by not requiring GoDoc comments for exported types.
Learnt from: mathildeshagl
PR: #22
File: resolution.go:26-29
Timestamp: 2025-06-21T11:14:56.130Z
Learning: In resolution.go, the struct rename from CoursePhaseParticipationWithResolution to CoursePhaseParticipationWithResolutions and field change from Resolution to Resolutions []Resolution was a consistency fix, not a breaking change. Everything using this endpoint already had the correct structure with multiple resolutions, but this particular struct definition was outdated and didn't match existing usage patterns.
promptTypes/person.go (1)
Learnt from: mathildeshagl
PR: #24
File: promptTypes/copyRequest.go:5-8
Timestamp: 2025-07-06T12:18:51.959Z
Learning: The Prompt-SDK project does not follow the Go convention of adding GoDoc comments to exported types. Most exported types in the codebase (Student, MetaData, Gender, StudyDegree, Resolution, etc.) lack GoDoc comments, with only TokenUser being documented. The project maintains consistency by not requiring GoDoc comments for exported types.
promptTypes/phaseCopy.go (2)
Learnt from: mathildeshagl
PR: #22
File: resolution.go:26-29
Timestamp: 2025-06-21T11:14:56.130Z
Learning: In resolution.go, the struct rename from CoursePhaseParticipationWithResolution to CoursePhaseParticipationWithResolutions and field change from Resolution to Resolutions []Resolution was a consistency fix, not a breaking change. Everything using this endpoint already had the correct structure with multiple resolutions, but this particular struct definition was outdated and didn't match existing usage patterns.
Learnt from: mathildeshagl
PR: #24
File: promptTypes/copyRequest.go:5-8
Timestamp: 2025-07-06T12:18:51.959Z
Learning: The Prompt-SDK project does not follow the Go convention of adding GoDoc comments to exported types. Most exported types in the codebase (Student, MetaData, Gender, StudyDegree, Resolution, etc.) lack GoDoc comments, with only TokenUser being documented. The project maintains consistency by not requiring GoDoc comments for exported types.
🧬 Code Graph Analysis (3)
promptTypes/student.go (3)
promptTypes/person.go (1)
Person(8-18)promptTypes/gender.go (1)
Gender(6-6)promptTypes/studyDegree.go (1)
StudyDegree(6-6)
promptTypes/coursePhaseParticipation.go (2)
promptTypes/metaData.go (1)
MetaData(13-13)promptTypes/student.go (1)
Student(10-49)
promptTypes/team.go (1)
promptTypes/person.go (1)
Person(8-18)
🔇 Additional comments (6)
promptTypes/studyDegree.go (1)
3-16: Documentation addition is consistent and helpful – no issues found
The new comments follow GoDoc conventions and improve discoverability without altering behaviour.promptTypes/gender.go (1)
3-22: LGTM – new constant and explanatory comments improve clarity
No functional changes, the additionalGenderPreferNotToSayoption strengthens inclusivity.promptTypes/student.go (2)
11-13: Embedding looks goodSwitching to an embedded
Personcleanly flattens the identity fields in JSON and avoids duplicate tags. Nice improvement.
18-21: Confirm custom validation tag is registered
binding:"matriculationNumber"is not one of the built-in Gin/validator tags. Make sure a custom rule with this name is registered, otherwise the field will silently skip validation.promptTypes/coursePhaseParticipation.go (1)
30-31: Payload size warningEmbedding the full
Studentobject may be overkill if the endpoint only needs a subset (e.g., ID + name). Consider a lean view model to keep responses small and avoid leaking data inadvertently.promptTypes/applicationAnswer.go (1)
8-14: Docs-only change – LGTMThe new comments greatly clarify answer types without touching logic.
|
We have some conflicts after the last merge |
Mtze
left a comment
There was a problem hiding this comment.
Please fix/close the Rabbit comments
|
Done - pls review agin |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
resolution.go (1)
18-18: UUID binding removed—required validation retained. Consider standardizing binding patterns across similar uuid.UUID fields.This change correctly removes the non-functional
uuidbinding constraint while preservingbinding:"required". Theuuidvalidator only works on string types, notuuid.UUIDtypes.However,
promptTypes/person.goline 11 uses a different approach—no binding tag at all on itsIDfield. If both fields serve similar request validation purposes, standardizing the binding approach across the codebase would improve consistency. If person.go is intentionally a domain model without Gin validation, the difference is justified.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
promptTypes/person.go(1 hunks)promptTypes/team.go(1 hunks)resolution.go(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- promptTypes/team.go
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: mathildeshagl
Repo: ls1intum/Prompt-SDK PR: 24
File: promptTypes/copyRequest.go:5-8
Timestamp: 2025-07-06T12:18:51.959Z
Learning: The Prompt-SDK project does not follow the Go convention of adding GoDoc comments to exported types. Most exported types in the codebase (Student, MetaData, Gender, StudyDegree, Resolution, etc.) lack GoDoc comments, with only TokenUser being documented. The project maintains consistency by not requiring GoDoc comments for exported types.
📚 Learning: 2025-06-21T11:14:56.130Z
Learnt from: mathildeshagl
Repo: ls1intum/Prompt-SDK PR: 22
File: resolution.go:26-29
Timestamp: 2025-06-21T11:14:56.130Z
Learning: In resolution.go, the struct rename from CoursePhaseParticipationWithResolution to CoursePhaseParticipationWithResolutions and field change from Resolution to Resolutions []Resolution was a consistency fix, not a breaking change. Everything using this endpoint already had the correct structure with multiple resolutions, but this particular struct definition was outdated and didn't match existing usage patterns.
Applied to files:
resolution.go
📚 Learning: 2025-07-06T12:18:51.959Z
Learnt from: mathildeshagl
Repo: ls1intum/Prompt-SDK PR: 24
File: promptTypes/copyRequest.go:5-8
Timestamp: 2025-07-06T12:18:51.959Z
Learning: The Prompt-SDK project does not follow the Go convention of adding GoDoc comments to exported types. Most exported types in the codebase (Student, MetaData, Gender, StudyDegree, Resolution, etc.) lack GoDoc comments, with only TokenUser being documented. The project maintains consistency by not requiring GoDoc comments for exported types.
Applied to files:
promptTypes/person.go
🔇 Additional comments (2)
promptTypes/person.go (2)
5-17: Comprehensive documentation added to Person type.The documentation is clear, well-structured, and follows Go conventions. This represents a deliberate shift from the project's previous practice of not documenting exported types.
Based on learnings: The project historically did not add GoDoc comments to exported types, but this PR explicitly aims to improve documentation across promptTypes, marking a positive change in practice.
11-11: UUID binding tag correctly removed.This change properly addresses the past review comment by removing the non-functional
binding:"uuid"tag. SincePersonis a data model rather than a request body, removing all binding validation is appropriate—theuuid.UUIDtype itself provides type safety.This differs from
resolution.goline 18, which retainsbinding:"required"becauseResolutionis used in request validation contexts.
|
Looking good now :) |
|
👍🏻 |
Improve the prompt types documentation.
First draft, open for suggestions. Closes #30, Closes #27
Summary by CodeRabbit
New Features
Refactor
Chores
Documentation