Merge pull request #38 from LazyBachelor/Metrics-and-Logs

Metrics and logs - Submit based Validation
This commit is contained in:
Robin Olsen
2026-03-05 04:00:31 -08:00
committed by GitHub
18 changed files with 535 additions and 71 deletions

View File

@@ -1,6 +1,8 @@
package survey
import (
"time"
"github.com/LazyBachelor/LazyPM/internal/commands/issues"
"github.com/spf13/cobra"
)
@@ -15,11 +17,25 @@ var StatusCmd = &cobra.Command{
func runStatusCmd(cmd *cobra.Command, args []string) error {
app := issues.AppFromContext(cmd.Context())
if app == nil || app.CurrentFeedback == nil {
if app == nil {
cmd.Println("No validation status available.")
return nil
}
if app.SubmitChan != nil {
select {
case app.SubmitChan <- struct{}{}:
default:
}
}
time.Sleep(100 * time.Millisecond)
if app.CurrentFeedback == nil {
cmd.Println("No validation status available yet.")
return nil
}
if app.CurrentFeedback.Message == "" {
cmd.Println("No validation status available yet.")
return nil

View File

@@ -17,6 +17,8 @@ type App struct {
CurrentFeedback *ValidationFeedback
ActionLogger func(string)
SubmitChan chan<- struct{}
}
func (a *App) LogAction(action string) {

View File

@@ -28,6 +28,7 @@ type Check struct {
type ValidatedInterface interface {
Interface
SetChannels(feedbackChan chan ValidationFeedback, quitChan chan bool)
SetSubmitChan(submitChan chan<- struct{})
}
type TaskDetails struct {