Recommend reporting runs without error messages

Merged
YO
3d ago
+1589-2054

Summary

The reporting levels stay split: runs sends run status, and errors also sends failed steps' error messages. Error messages can hold hosts, paths, or data a step printed, so sending them should be a deliberate choice. The default and recommended level becomes runs; until now it was errors.

Changes

  • Monitoring dialog and connect offer: Health and run status (recommended) starts selected. Health, run status, and error messages loses "(recommended)".
  • dagu license activate question: 1) Health and run status (recommended), 2) Health, run status, and error messages, 3) Health only, 4) Nothing. Enter chooses runs. The --report help and error list runs first too.
  • A job run with cloud.run_key and no cloud.report reports at runs; cloud.report: errors adds error messages.
  • RFC 022 and the cloud.run_key schema description name runs as the job run default.
  • Removed the one-time "Show why runs fail in Dagu Console" notice, which pushed servers at runs toward errors. It took with it LicenseMonitoring.errorsOffered and POST /license/monitoring/dismiss-errors-notice.
  • Unchanged: the levels off, health, runs, errors; cloud.report unset means off.

Core change

The level a server or job run starts at when nobody chose one:

// internal/cmd/license.go:231
var reportChoices = []struct {
	level config.ReportLevel
	label string
}{
	{config.ReportRuns, "Health and run status (recommended)"},
	{config.ReportErrors, "Health, run status, and error messages"},
	{config.ReportHealth, "Health only"},
	{config.ReportOff, "Nothing"},
}

// internal/cmd/job_reports.go:51
	if level == "" {
		level = config.ReportRuns
	}

The UI starts its choice at LicenseMonitoringLevel.runs in ui/src/components/MonitoringDialog.tsx and ui/src/pages/license/ConnectSection.tsx.

Testing

  • TestChooseReportLevel: Enter gives runs, and 2 gives errors.
  • TestJobReportsForALocalRun: with a run key and no cloud.report, the level is runs.
  • License page and monitoring notice tests: the default connect and turn-on send runs, and a level chosen before (errors) stays selected. A server at runs shows no notice.
  • e2e/license-experience.spec.ts: the free offer starts at Health and run status (recommended) and connects at runs.
  • Locally:
    • go test ./internal/cmd/ (license and job report tests).
    • golangci-lint on internal/cmd.
    • pnpm exec tsc --noEmit, and the full vitest run: 627 files, 9574 tests.

Performance

No performance risk: only which level is selected first changes.

Compatibility

  • Existing choices and configuration keep their level.
  • A job run with a run key and no cloud.report stops sending error messages. Set cloud.report: errors to keep them.
  • API: GET /license/monitoring no longer returns errorsOffered, and POST /license/monitoring/dismiss-errors-notice is gone. Only Dagu's own UI used them.
  • Stored data: a saved errors_offered key in cloud/report-settings.json is ignored. A downgrade reads the file as before and may show the offer once more.

Agent

Claude Code, claude-opus-5-5, xhigh