发布

  • [OPIK-4984] [FE][BE] Project Home Page (#7051)

    frostbyte_neo 发布于 2026-06-12 15:19:47 +00:00

    • [OPIK-6261] [BE] [FE] feat: Ollie daily briefing reports (#6640)

    • [OPIK-6261] [BE] [FE] feat: Ollie daily briefing reports

    BE:

    • DB migration: ollie_reports and report_preferences tables
    • REST endpoints: generate, complete callback, list reports, preferences CRUD
    • ReportService: report lifecycle, orchestrator trigger, preference management
    • OrchestratorClient: fire-and-forget HTTP call to report generation URL
    • DailyReportJob: scheduled at 05:00 UTC with distributed lock
    • StaleReportCleanupJob: marks stale PENDING reports as FAILED every 15min

    FE:

    • DailyBriefingSection: all UI states (inactive, active empty, running,
      scheduled, failed, paused, report list, settings/turn-on dialogs)
    • ReportPanel: side panel with markdown rendering for report content
    • API hooks: useReports, useReportPreference, generate/update mutations
    • Ollie feature gate on DailyBriefingSection
    • formatUtcTimeAsLocal and formatRelativeDateTime date utilities
    • Inline code styling for comet-markdown
    • Revision: Add internal token auth for report generation

    Send X-Report-Generation-Token header when calling the Comet API
    for report generation. Token is configured via REPORT_GENERATION_INTERNAL_TOKEN
    env var (set in AWS Secrets Manager).

    • Revision 2: Address baz PR review comments
    • Add workspace_id scoping to all report and preference DAO queries
    • Add project_id + status=pending guard to report update (prevents replay attacks)
    • Add @JsonCreator to ReportStatus.fromString for correct deserialization
    • Replace Lombok @NonNull with Jakarta @NotNull on ReportCompleteRequest.status
    • Return 202 Accepted for async report generation endpoint
    • Rename ReportResource → ReportsResource (convention)
    • Fix scheduleTimeLocalLocal typo in FE
    • Update migration index to (workspace_id, project_id, created_at)
    • Add config.yml documentation for reportGeneration section
    • Thread projectId through markReportFailed callback
    • Revision 3: Quick actions in report panel, bridge cleanup, token removal
    • Move recommended actions from separate dialog into report panel (side by side cards)
    • Add startConversation() to AssistantSidebarBridge, remove window.__opikStartConversation
    • Remove service token auth (endpoint secured via VPC instead)
    • Rename migration to 000077 (conflict with newer migrations on main)
    • Report row shows action count as text, not button
    • Remove systemContext from bridge API
    • Revision 4: Custom prompt and editable schedule time (OPIK-6665)
    • Add custom_prompt column to report_preferences
    • Rename schedule_time_utc to schedule_time across BE/FE
    • Scheduler runs every 10 min, checks previous window for due reports
    • Pass custom_prompt to orchestrator for Ollie to use as additive context
    • Settings dialog with time picker and custom instructions textarea
    • Turn-on dialog also includes schedule time and custom prompt
    • Extract shared ReportSettingsFields component and useReportSettings hook
    • Smart today/tomorrow label based on whether schedule time has passed
    • COALESCE in upsert preserves schedule_time and custom_prompt on partial updates
    • Add DailyReportJobTest for window calculation including midnight edge case
    • Add date utility tests for formatLocalTimeAsUtc roundtrip
    • Revision 5: Address PR review comments
    • Use MarkdownPreview (with rehype-sanitize) instead of raw ReactMarkdown in ReportPanel
    • Validate project exists in workspace before creating report
    • Skip report creation when reportGeneration.url is not configured
    • Mark createdAt/lastUpdatedAt as @Schema(READ_ONLY) in ReportPreference
    • Update OpenAPI description for getPreference (returns null, not defaults)
    • Drop unnecessary useMemo in ReportSettingsFields
    • Revision 6: PR review fixes, integration tests, dialog extraction, billing link
    • Add ReportsResourceTest with 6 integration tests (preferences CRUD, reports lifecycle)
    • Extract TurnOnDialog and SettingsDialog into DailyBriefing/ folder
    • Simplify TurnOnDialog (removed schedule time + custom prompt, uses defaults)
    • Add BillingLink plugin component for Comet billing URL
    • Register BillingLink in PluginsStore, render in SettingsDialog when available
    • Skip report creation when reportGeneration.url is not configured
    • Validate project exists in workspace before creating report
    • Mark createdAt/lastUpdatedAt as @Schema(READ_ONLY) in ReportPreference
    • Use MarkdownPreview (with rehype-sanitize) in ReportPanel
    • Update OpenAPI description for getPreference endpoint
    • Revision 7: Address PR review comments
    • Assert empty response body in getPreference test
    • Reset SettingsDialog local state when dialog opens (fixes stale edits after cancel/reopen)
    • Revision 8: Address thiagohora PR review comments
    • Rename DailyReportJob to OllieDailyReportJob
    • Add 5s acquire-wait on distributed lock to prevent missed ticks (C2)
    • Add @Pattern validation on scheduleTime and @Size on customPrompt (C3)
    • Fix inconsistent status dot size in DailyBriefingSection (C8)
    • Add pending report dedup check to prevent duplicate reports on double-click (C11)
    • Add index on report_preferences(enabled, schedule_time) for scheduler query (C13)
    • Use try-with-resources for Response in OrchestratorClient callback
    • Add happy path integration tests: generate returns 202, complete transitions to COMPLETED (C14)
    • Revision 9: Address PR review comments (baz, ldaugusto, andriidudar)
    • Add maxLength={5000} to custom prompt textarea matching BE @Size validation (B2)
    • Return existing pending report ID instead of 503 on dedup (L1)
    • Change 503 to 501 Not Implemented when orchestrator not configured (L2)
    • Atomic INSERT ... WHERE NOT EXISTS to prevent race condition on pending check (L3)
    • Fix paused state flashing empty state by including isReportsPending in isLoading (A1)
    • Rename migration 078 to 080 to avoid conflict
    • [OPIK-6726] [FE][BE] Home page final tweaks, activity improvements, feature flag (#6922)

    • [OPIK-6726] [FE][BE] Home page final tweaks

    Homepage UI:

    • Reduce general spacing to 12px, within-section spacing to 6px
    • Activity items: add visible border, show arrow on hover replacing date
    • Brief items: foreground color for date/buttons, remove lightbulb icon,
      move action count left, add settings tooltip
    • Settings dialog: add separator, rename to Delivery time, simplify layout,
      disable fields when briefing off
    • Report panel: colored action cards with icon backgrounds, section headers,
      separator between actions and content

    Recent activity:

    • Replace AGENT_CONFIG_VERSION with PROMPT_VERSION activity type
    • Query prompt_versions joined with prompts for name + version
    • Use FileTerminal icon, show "prompt_name v3" format
    • Refetch activity on page mount with stale data shown meanwhile
    • Update BE integration test
    • [OPIK-6711] [FE][BE] Add daily trace counts to recent activity
    • Add TRACE_DAILY activity type with daily trace counts from metrics API
    • Use ListTree icon with teal color, dataset color changed to purple
    • Label: "Traces logged today/yesterday/on D MMM" with count
    • Link navigates to logs page filtered by date with traces tab
    • Use noon UTC for past-day timestamps to avoid timezone day-crossing
    • Refactor formatRelativeDateTime to accept includeTime param
    • Update BE test to handle TRACE_DAILY items without createdBy
    • Revision: Action cards hover state and Tailwind class cleanup

    • Revision 2: Add PROJECT_HOMEPAGE_ENABLED feature flag

    Gate the project homepage behind TOGGLE_PROJECT_HOMEPAGE_ENABLED.
    When off, sidebar hides Home, project landing goes to /logs,
    and direct /home access redirects to /logs.

    • Revision 3: Fix unit test - add ProjectMetricsService mock

    • Revision 4: New TimeInput component, Home icon to House

    • Revision 5: Address PR review comments

    • Use action.name as key instead of index in ReportPanel
    • Use cn() for conditional class merging in ReportPanel
    • Dynamic placeholder in TimeInput using dayjs
    • ORDER BY pv.id DESC instead of pv.created_at DESC in PromptDAO
    • Refactor fetchTraceDailyCounts into helper methods
    • Remove date filter from trace daily links
    • Revision: Address PR review comments
    • Convert DAO SQL to text blocks (OllieReportDAO, ReportPreferenceDAO)
    • Default reportGeneration.url to blank (opt-in, not opt-out)
    • Remove redundant pre-check in createAndTriggerReport, rely on atomic INSERT
    • Remove unused findPendingByProjectId from OllieReportDAO
    下载附件