refine task questons

This commit is contained in:
Robin Olsen
2026-03-16 12:30:26 +01:00
parent b7e2cc2c63
commit 42f9469189
10 changed files with 160 additions and 68 deletions

View File

@@ -40,27 +40,29 @@ func (t *BacklogRefinementTask) Details(interfaceType InterfaceType) TaskDetails
return BaseDetails(interfaceType). return BaseDetails(interfaceType).
WithTitle("Backlog Refinement Task"). WithTitle("Backlog Refinement Task").
WithDescription(backlogRefinementDescription). WithDescription(backlogRefinementDescription).
WithTimeToComplete("12m"). WithTimeToComplete("2m").
WithDifficulty("Medium") WithDifficulty("Easy")
} }
func (t *BacklogRefinementTask) Questions(interfaceType InterfaceType) Questions { func (t *BacklogRefinementTask) Questions(interfaceType InterfaceType) Questions {
return BaseQuestions(interfaceType).With( return BaseQuestions(interfaceType).With(
huh.NewGroup( huh.NewGroup(
huh.NewSelect[int](). huh.NewSelect[int]().
Key("how-many-duplicate-issues"). Key("duplicate-issues-closed").
Title("How many duplicate issues did you close during refinement?"). Title("How many issues did you close during refinement?").
Description("There was only one issue required for the task, if you closed more why?").
Options( Options(
huh.NewOption("1", 1), huh.NewOption("1", 1),
huh.NewOption("2", 2), huh.NewOption("1+ I saw there where more to be closed", 2),
huh.NewOption("3+", 3), huh.NewOption("1+ I closed more by mistake", 3),
huh.NewOption("0 I didn't close any", 4),
), ),
), ),
) )
} }
func (t *BacklogRefinementTask) QuestionnaireKeys(_ InterfaceType) []string { func (t *BacklogRefinementTask) QuestionnaireKeys(_ InterfaceType) []string {
return []string{"task_completed", "task_difficulty", "how-many-duplicate-issues"} return BaseKeys().With("duplicate-issues-closed")
} }
func (t *BacklogRefinementTask) Setup(ctx context.Context) error { func (t *BacklogRefinementTask) Setup(ctx context.Context) error {

View File

@@ -94,27 +94,46 @@ func ClearIssues(app *App) error {
} }
func BaseQuestions(interfaceType InterfaceType) Questions { func BaseQuestions(interfaceType InterfaceType) Questions {
var taskRating int
return Questions{ return Questions{
huh.NewGroup( huh.NewGroup(
huh.NewConfirm(). huh.NewConfirm().Key("task_completed").
Key("task_completed"). Title("Where you able to complete the task?").
Title("Did you complete the task?"), Description("")),
),
huh.NewGroup( huh.NewGroup(
huh.NewSelect[int]().Value(&taskRating). huh.NewSelect[int]().Key("interface_difficulty").
Key("task_difficulty"). Title("How difficult was it to use the interface?").
Description("By interface we mean the method of interaction with the task.").
Options( Options(
huh.NewOption("Very easy", 1), huh.NewOption("Very easy", 1),
huh.NewOption("Easy", 2), huh.NewOption("Easy", 2),
huh.NewOption("Moderate", 3), huh.NewOption("Moderate", 3),
huh.NewOption("Hard", 4), huh.NewOption("Hard", 4),
). ),
Title("How difficult was the task?"), ),
huh.NewGroup(
huh.NewSelect[int]().Key("task_difficulty").
Title("How difficult did you find the task?").
Description("Only rate the difficulty of the task itself. Not the usability of the interface").
Options(
huh.NewOption("Very easy", 1),
huh.NewOption("Easy", 2),
huh.NewOption("Moderate", 3),
huh.NewOption("Hard", 4),
),
), ),
} }
} }
type Keys []string
func BaseKeys() Keys {
return []string{"task_completed", "interface_difficulty", "task_difficulty"}
}
func (k Keys) With(keys ...string) Keys {
return append(k, keys...)
}
func Question(fields ...huh.Field) *huh.Group { func Question(fields ...huh.Field) *huh.Group {
return huh.NewGroup(fields...) return huh.NewGroup(fields...)
} }

View File

@@ -7,6 +7,7 @@ import (
"github.com/LazyBachelor/LazyPM/internal/models" "github.com/LazyBachelor/LazyPM/internal/models"
"github.com/LazyBachelor/LazyPM/internal/utils/check" "github.com/LazyBachelor/LazyPM/internal/utils/check"
"github.com/charmbracelet/huh"
) )
const codingDescription = `You are tasked with doing a chore in the codebase. const codingDescription = `You are tasked with doing a chore in the codebase.
@@ -22,11 +23,15 @@ Your task:
- Description: "We need to upgrade the MongoDB Driver dependency to the latest version." - Description: "We need to upgrade the MongoDB Driver dependency to the latest version."
- Status: "In Progress" - Status: "In Progress"
- Issue Type: "Chore" - Issue Type: "Chore"
2. A file will appear in the current directory named "code.txt". 2. Assign the issue to yourself as "Me".
3. A file will appear in the current directory named "code.txt".
Open it and follow the instructions inside. And save the file after you are done. Open it and follow the instructions inside. And save the file after you are done.
3. When you are done, mark this and the issue you made as "Closed".` 4. When you are done, mark this and the issue you made as "Closed".`
var textFileDescription = ` var textFileDescription = `
# Instructions for the coding task
Please upgrade the MongoDB Driver dependency in the go.mod file to the latest version. Please upgrade the MongoDB Driver dependency in the go.mod file to the latest version.
It should be v1.17.9. After you are done, save the file and mark the task as completed. It should be v1.17.9. After you are done, save the file and mark the task as completed.
############################################################` ############################################################`
@@ -85,16 +90,33 @@ func (t *CodingTask) Config() Config {
} }
func (t *CodingTask) Details(interfaceType InterfaceType) TaskDetails { func (t *CodingTask) Details(interfaceType InterfaceType) TaskDetails {
return BaseDetails(interfaceType).WithTitle("Coding Task").WithDescription(codingDescription) return BaseDetails(interfaceType).
WithTitle("Coding Task").
WithDescription(codingDescription).
WithDifficulty("Hard").WithTimeToComplete("5m")
} }
func (t *CodingTask) Questions(interfaceType InterfaceType) (questions Questions) { func (t *CodingTask) Questions(interfaceType InterfaceType) (questions Questions) {
return BaseQuestions(interfaceType) return BaseQuestions(interfaceType).
With(
huh.NewGroup(
huh.NewSelect[int]().
Key("coding_interface_friction").
Title("How much friction did you feel switching between editing code and using the interface?").
Description("By friction we mean the difficulty or inconvenience of switching between these two activities.").
Options(
huh.NewOption("Very low", 1),
huh.NewOption("Low", 2),
huh.NewOption("Moderate", 3),
huh.NewOption("High", 4),
huh.NewOption("Very high", 5),
),
),
)
} }
func (t *CodingTask) QuestionnaireKeys(interfaceType InterfaceType) []string { func (t *CodingTask) QuestionnaireKeys(interfaceType InterfaceType) []string {
keys := []string{"task_completed", "task_difficulty"} return BaseKeys().With("coding_interface_friction")
return keys
} }
func (t *CodingTask) Setup(ctx context.Context) error { func (t *CodingTask) Setup(ctx context.Context) error {
@@ -144,7 +166,7 @@ func (t *CodingTask) Validate(ctx context.Context) ValidationFeedback {
expect.NotEmptyAndEqual(issue.Title, "Upgrade MongoDB Driver Dependency", "Issue title") expect.NotEmptyAndEqual(issue.Title, "Upgrade MongoDB Driver Dependency", "Issue title")
expect.NotEmptyAndEqual(issue.Description, expect.NotEmptyAndEqual(issue.Description,
"We need to upgrade the MongoDB Driver dependency to the latest version.", "Issue description") "Upgrade the MongoDB Driver dependency to the latest version.", "Issue description")
expect.NotEmptyAndEqual(issue.Assignee, "Me", "Issue Assignee") expect.NotEmptyAndEqual(issue.Assignee, "Me", "Issue Assignee")

View File

@@ -6,6 +6,7 @@ import (
"github.com/LazyBachelor/LazyPM/internal/models" "github.com/LazyBachelor/LazyPM/internal/models"
"github.com/LazyBachelor/LazyPM/internal/utils/check" "github.com/LazyBachelor/LazyPM/internal/utils/check"
"github.com/charmbracelet/huh"
) )
const description = `You are tasked with creating a new issue in the project management system. const description = `You are tasked with creating a new issue in the project management system.
@@ -35,15 +36,32 @@ func (t *CreateIssueTask) Config() Config {
} }
func (t *CreateIssueTask) Details(interfaceType InterfaceType) TaskDetails { func (t *CreateIssueTask) Details(interfaceType InterfaceType) TaskDetails {
return BaseDetails(interfaceType).WithTitle("Create Issue Task").WithDescription(description) return BaseDetails(interfaceType).
WithTitle("Create Issue Task").
WithDescription(description).
WithDifficulty("Medium").
WithTimeToComplete("3m")
} }
func (t *CreateIssueTask) Questions(interfaceType InterfaceType) Questions { func (t *CreateIssueTask) Questions(interfaceType InterfaceType) Questions {
return BaseQuestions(interfaceType) return BaseQuestions(interfaceType).With(
huh.NewGroup(
huh.NewSelect[int]().Key("context_difficulty").
Title("How difficult was it remembering what needed to be done for the task?").
Description("We are interested in how difficult it was keeping track of the task requirements. And if one interface helps you keep context").
Options(
huh.NewOption("Very Easy", 1),
huh.NewOption("Easy", 2),
huh.NewOption("Moderate", 3),
huh.NewOption("Difficult", 4),
huh.NewOption("Very Difficult", 5),
),
),
)
} }
func (t *CreateIssueTask) QuestionnaireKeys(_ InterfaceType) []string { func (t *CreateIssueTask) QuestionnaireKeys(_ InterfaceType) []string {
return []string{"task_completed", "task_difficulty"} return BaseKeys().With("context_difficulty")
} }
func (t *CreateIssueTask) Setup(ctx context.Context) error { func (t *CreateIssueTask) Setup(ctx context.Context) error {

View File

@@ -40,24 +40,31 @@ func (t *DependencyManagementTask) Details(interfaceType InterfaceType) TaskDeta
return BaseDetails(interfaceType). return BaseDetails(interfaceType).
WithTitle("Dependency Management Task"). WithTitle("Dependency Management Task").
WithDescription(dependencyManagementDescription). WithDescription(dependencyManagementDescription).
WithTimeToComplete("15m"). WithTimeToComplete("3m").
WithDifficulty("Hard") WithDifficulty("Medium")
} }
func (t *DependencyManagementTask) Questions(interfaceType InterfaceType) Questions { func (t *DependencyManagementTask) Questions(interfaceType InterfaceType) Questions {
return BaseQuestions(interfaceType).With( return BaseQuestions(interfaceType).With(
huh.NewGroup( huh.NewGroup(
huh.NewSelect[int](). huh.NewSelect[int]().Key("discovery_difficulty").
Title("How many foundational issues did you identify?"). Title("How difficult was it discovering the dependencies?").
Description("We are interested in how difficult it was to discover the issues that needed to be addressed.").
Options( Options(
huh.NewOption("1", 1), huh.NewOption("Very Easy", 1),
huh.NewOption("2", 2), huh.NewOption("Easy", 2),
huh.NewOption("3+", 3), huh.NewOption("Moderate", 3),
huh.NewOption("Difficult", 4),
huh.NewOption("Very Difficult", 5),
), ),
), ),
) )
} }
func (t *DependencyManagementTask) QuestionnaireKeys(_ InterfaceType) []string {
return BaseKeys().With("discovery_difficulty")
}
func (t *DependencyManagementTask) Setup(ctx context.Context) error { func (t *DependencyManagementTask) Setup(ctx context.Context) error {
if err := ClearIssues(t.app); err != nil { if err := ClearIssues(t.app); err != nil {
return err return err

View File

@@ -48,26 +48,40 @@ func (t *GitTask) Config() Config {
} }
func (t *GitTask) Details(interfaceType InterfaceType) TaskDetails { func (t *GitTask) Details(interfaceType InterfaceType) TaskDetails {
return BaseDetails(interfaceType).WithTitle("Git Task").WithDescription(gitTaskDescription) return BaseDetails(interfaceType).
WithTitle("Git Task").
WithDescription(gitTaskDescription).
WithDifficulty("Hard").WithTimeToComplete("5m")
} }
func (t *GitTask) Questions(interfaceType InterfaceType) Questions { func (t *GitTask) Questions(interfaceType InterfaceType) Questions {
return BaseQuestions(interfaceType).With( return BaseQuestions(interfaceType).
With(
huh.NewGroup(
huh.NewSelect[string]().Key("git_interface_used").
Title("What Git Interface did you use for the task?").
Description("If ").
Options(
huh.Option[string]{Value: "cli", Key: "Command Line Interface"},
huh.Option[string]{Value: "tui", Key: "Terminal User Interface"},
huh.Option[string]{Value: "gui", Key: "Graphical User Interface"},
),
),
).With(
huh.NewGroup( huh.NewGroup(
huh.NewSelect[string]().Title("What Git Interface did you use?"). huh.NewSelect[string]().Key("git_interface_normaly").
Key("git_interface_used"). Title("What Git Interface do you normally use?").
Description("If ").
Options( Options(
huh.Option[string]{Value: "cli", Key: "Command Line Interface"}, huh.Option[string]{Value: "cli", Key: "Command Line Interface"},
huh.Option[string]{Value: "tui", Key: "Terminal User Interface"}, huh.Option[string]{Value: "tui", Key: "Terminal User Interface"},
huh.Option[string]{Value: "gui", Key: "Graphical User Interface"}, huh.Option[string]{Value: "gui", Key: "Graphical User Interface"},
), ),
), ))
)
} }
func (t *GitTask) QuestionnaireKeys(interfaceType InterfaceType) []string { func (t *GitTask) QuestionnaireKeys(_ InterfaceType) []string {
_ = interfaceType return BaseKeys().With("git_interface_used", "git_interface_normaly")
return []string{"task_completed", "task_difficulty", "git_interface_used"}
} }
func (t *GitTask) Setup(ctx context.Context) error { func (t *GitTask) Setup(ctx context.Context) error {
@@ -108,12 +122,10 @@ func (t *GitTask) Validate(ctx context.Context) ValidationFeedback {
return expect.ValidationFeedback return expect.ValidationFeedback
} }
_ = issues _ = issues
issue := t.setupIssue issue := t.setupIssue
if issue.Status == models.StatusInProgress || gitTaskInProgress { if issue.Status == models.StatusInProgress || gitTaskInProgress {
gitTaskInProgress = true gitTaskInProgress = true
} else { } else {
@@ -130,7 +142,6 @@ func (t *GitTask) Validate(ctx context.Context) ValidationFeedback {
} }
} }
headRef, err := t.repo.Head() headRef, err := t.repo.Head()
if err != nil { if err != nil {
expect.Fail("No commits found in the Git repository. Please commit your changes.") expect.Fail("No commits found in the Git repository. Please commit your changes.")
@@ -145,7 +156,6 @@ func (t *GitTask) Validate(ctx context.Context) ValidationFeedback {
expect.NotEmptyAndEqual(strings.TrimSpace(commit.Message), "updated codebase", "Git commit message") expect.NotEmptyAndEqual(strings.TrimSpace(commit.Message), "updated codebase", "Git commit message")
tree, err := commit.Tree() tree, err := commit.Tree()
if err != nil { if err != nil {
expect.Fail("Failed to read commit tree: " + err.Error()) expect.Fail("Failed to read commit tree: " + err.Error())

View File

@@ -34,14 +34,18 @@ func (t *IssueReviewCleanupTask) Details(interfaceType InterfaceType) TaskDetail
return BaseDetails(interfaceType). return BaseDetails(interfaceType).
WithTitle("Issue Review and Cleanup Task"). WithTitle("Issue Review and Cleanup Task").
WithDescription(issueReviewCleanupDescription). WithDescription(issueReviewCleanupDescription).
WithTimeToComplete("8m"). WithTimeToComplete("3m").
WithDifficulty("Easy") WithDifficulty("Medium")
} }
func (t *IssueReviewCleanupTask) Questions(interfaceType InterfaceType) Questions { func (t *IssueReviewCleanupTask) Questions(interfaceType InterfaceType) Questions {
return BaseQuestions(interfaceType) return BaseQuestions(interfaceType)
} }
func (t *IssueReviewCleanupTask) QuestionnaireKeys(_ InterfaceType) []string {
return BaseKeys()
}
func (t *IssueReviewCleanupTask) Setup(ctx context.Context) error { func (t *IssueReviewCleanupTask) Setup(ctx context.Context) error {
if err := ClearIssues(t.app); err != nil { if err := ClearIssues(t.app); err != nil {
return err return err

View File

@@ -43,23 +43,29 @@ func (t *PriorityManagementTask) Details(interfaceType InterfaceType) TaskDetail
return BaseDetails(interfaceType). return BaseDetails(interfaceType).
WithTitle("Priority Management Task"). WithTitle("Priority Management Task").
WithDescription(priorityManagementDescription). WithDescription(priorityManagementDescription).
WithTimeToComplete("8m"). WithTimeToComplete("4m").
WithDifficulty("Easy") WithDifficulty("Medium")
} }
func (t *PriorityManagementTask) Questions(interfaceType InterfaceType) Questions { func (t *PriorityManagementTask) Questions(interfaceType InterfaceType) Questions {
return BaseQuestions(interfaceType). return BaseQuestions(interfaceType).With(
With( huh.NewGroup(
huh.NewGroup( huh.NewSelect[int]().Key("management_difficulty").
huh.NewSelect[int](). Title("How did it feel managing multiple issues?").
Title("How many issues did you reprioritize or comment on?"). Description("Managing multiple issues would require careful prioritization and coordination.").
Options( Options(
huh.NewOption("1-2", 1), huh.NewOption("Very Easy", 1),
huh.NewOption("3-4", 2), huh.NewOption("Easy", 2),
huh.NewOption("5+", 3), huh.NewOption("Moderate", 3),
), huh.NewOption("Difficult", 4),
), huh.NewOption("Very Difficult", 5),
) ),
),
)
}
func (t *PriorityManagementTask) QuestionnaireKeys(_ InterfaceType) []string {
return BaseKeys().With("management_difficulty")
} }
func (t *PriorityManagementTask) Setup(ctx context.Context) error { func (t *PriorityManagementTask) Setup(ctx context.Context) error {

View File

@@ -40,7 +40,7 @@ func (t *SprintPlanningTask) Details(interfaceType InterfaceType) TaskDetails {
return BaseDetails(interfaceType). return BaseDetails(interfaceType).
WithTitle("Sprint Planning Task"). WithTitle("Sprint Planning Task").
WithDescription(sprintPlanningDescription). WithDescription(sprintPlanningDescription).
WithTimeToComplete("15m"). WithTimeToComplete("3m").
WithDifficulty("Medium") WithDifficulty("Medium")
} }
@@ -49,18 +49,21 @@ func (t *SprintPlanningTask) Questions(interfaceType InterfaceType) Questions {
huh.NewGroup( huh.NewGroup(
huh.NewSelect[int](). huh.NewSelect[int]().
Key("sprint-planning-selected-issues"). Key("sprint-planning-selected-issues").
Title("How many issues did you select for the sprint?"). Title("How difficult was it selecting issues for the sprint?").
Description("We are interested in how intuitive and time-consuming the selection process was.").
Options( Options(
huh.NewOption("2-3 issues", 1), huh.NewOption("Very Easy", 1),
huh.NewOption("4-5 issues", 2), huh.NewOption("Easy", 2),
huh.NewOption("6+ issues", 3), huh.NewOption("Moderate", 3),
huh.NewOption("Difficult", 4),
huh.NewOption("Very Difficult", 5),
), ),
), ),
) )
} }
func (t *SprintPlanningTask) QuestionnaireKeys(_ InterfaceType) []string { func (t *SprintPlanningTask) QuestionnaireKeys(_ InterfaceType) []string {
return []string{"task_completed", "task_difficulty", "sprint-planning-selected-issues"} return BaseKeys().With("sprint-planning-selected-issues")
} }
func (t *SprintPlanningTask) Setup(ctx context.Context) error { func (t *SprintPlanningTask) Setup(ctx context.Context) error {

View File

@@ -11,6 +11,7 @@ type Tasker interface {
Details(InterfaceType) TaskDetails Details(InterfaceType) TaskDetails
Setup(context.Context) error Setup(context.Context) error
Questions(InterfaceType) Questions Questions(InterfaceType) Questions
QuestionnaireKeys(InterfaceType) []string
Validate(context.Context) ValidationFeedback Validate(context.Context) ValidationFeedback
} }