Skip to content

fix: publish app home view, wire worker focus check, store oauth token, init metrics, fix go version#7

Merged
LSUDOKO merged 1 commit into
mainfrom
fix/app-home-worker-oauth-metrics
Jul 11, 2026
Merged

fix: publish app home view, wire worker focus check, store oauth token, init metrics, fix go version#7
LSUDOKO merged 1 commit into
mainfrom
fix/app-home-worker-oauth-metrics

Conversation

@LSUDOKO

@LSUDOKO LSUDOKO commented Jul 11, 2026

Copy link
Copy Markdown
Owner

What

Fixes all remaining broken items from the audit: App Home view now publishes real preferences, worker focus:check uses Redis for velocity monitoring, OAuth creates a team record in DB, Prometheus metrics are initialized, and Go version is synced across CI and Dockerfiles.

Why

These were the actual remaining gaps. Users saw a blank App Home tab, the worker focus:check was a stub, OAuth tokens were discarded without creating any DB record, and Metrics/MCP had Go version mismatches.

Changes

  • feat(slack): Publish real App Home view with neurotype, feature statuses, and command list via views.publish API
  • feat(worker): focus:check now reads Redis velocity counters and checks offered flags instead of logging a stub message
  • feat(api): OAuth token exchange now parses team ID/name from Slack response and creates a placeholder user record in DB
  • feat(metrics): NewMetrics() called in main.go so Prometheus counters appear on /metrics endpoint
  • chore(infra): CI and 3 Dockerfiles bumped from Go 1.23 to 1.26 to match go.mod
  • chore(mcp): Google Calendar integration wired into MCP server with mock fallback
  • style(web): Fixed unescaped entities in 404 page, removed unused import

How to Test

  1. go build ./cmd/api && go build ./cmd/worker && go build ./cmd/mcp-server — all compile
  2. go test -race ./... — 35 tests pass
  3. go vet ./... — clean
  4. Frontend: npx tsc --noEmit && npm run lint — typecheck clean

Checklist

  • make lint passes (go vet clean)
  • make test passes (35 tests, race clean)
  • Commit messages follow Conventional Commits
  • No direct pushes to main (this is a PR)
  • Branch is up to date with main before merge

Summary by CodeRabbit

  • New Features

    • Added optional Google Calendar integration for creating focus events and viewing upcoming calendar events.
    • Added a Slack App Home view displaying signal preferences and feature statuses.
    • OAuth setup now records the connected workspace and bot user.
  • Improvements

    • Focus checks now validate inputs, inspect channel state, and provide more informative activity logging.
    • Prometheus metrics are initialized during application startup.
  • Documentation

    • Added configuration guidance for Google Calendar credentials and calendar IDs.

…blish

Adds PublishView to SlackAPI interface and implements it in EventHandler.
Controller now builds a full Block Kit Home tab showing neurotype, feature
status, and command reference when user opens App Home.
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: d30af5d4-8d21-461b-ad77-967db438a8ae

📥 Commits

Reviewing files that changed from the base of the PR and between 1cdf436 and 2dfa892.

⛔ Files ignored due to path filters (1)
  • api/go.sum is excluded by !**/*.sum
📒 Files selected for processing (19)
  • .env.example
  • .github/workflows/ci.yml
  • .gitignore
  • api/Dockerfile
  • api/Dockerfile.mcp
  • api/Dockerfile.worker
  • api/cmd/api/main.go
  • api/cmd/mcp-server/main.go
  • api/cmd/worker/main.go
  • api/go.mod
  • api/internal/config/config.go
  • api/internal/features/controller.go
  • api/internal/features/translator_test.go
  • api/internal/httpapi/handler.go
  • api/internal/mcp/calendar.go
  • api/internal/mcp/handler.go
  • api/internal/slack/events.go
  • frontend/src/app/app-home/page.tsx
  • frontend/src/app/not-found.tsx

📝 Walkthrough

Walkthrough

This PR adds optional Google Calendar integration, Slack App Home publishing, OAuth bot-user persistence, worker state checks, Prometheus startup initialization, Go 1.26 build updates, and minor frontend and repository cleanup.

Changes

Google Calendar integration

Layer / File(s) Summary
Calendar configuration and contracts
.env.example, api/internal/config/config.go, api/go.mod, api/internal/mcp/handler.go
Calendar settings and Google dependencies are added, and MCP calendar methods now accept request contexts.
Google Calendar client
api/internal/mcp/calendar.go
Adds credential selection, event creation, and current-event lookup through Google Calendar.
Calendar server wiring
api/cmd/mcp-server/main.go, api/internal/mcp/handler.go
The MCP server conditionally initializes the calendar client and passes request contexts to calendar operations.

Slack integration updates

Layer / File(s) Summary
OAuth team and bot-user persistence
api/internal/httpapi/handler.go
OAuth responses decode nested team data and optionally create a placeholder bot user.
App Home view publishing
api/internal/features/controller.go, api/internal/slack/events.go, api/internal/features/translator_test.go
Feature preferences are rendered into Slack Home views and published through the Slack API interface and implementation.

Runtime and tooling updates

Layer / File(s) Summary
Worker and metrics behavior
api/cmd/worker/main.go, api/cmd/api/main.go
Focus checks validate payloads, inspect Redis state, log outcomes, and API startup initializes Prometheus metrics.
Go build environment
.github/workflows/ci.yml, api/Dockerfile*, .gitignore
CI and Docker builders move to Go 1.26, and additional build artifacts are ignored.
Frontend markup cleanup
frontend/src/app/app-home/page.tsx, frontend/src/app/not-found.tsx
An unused icon import is removed and an apostrophe is HTML-encoded.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MCPToolHandler
  participant GoogleCalendarClient
  participant GoogleCalendarAPI
  MCPToolHandler->>GoogleCalendarClient: CreateEvent or GetCurrentEvent with request context
  GoogleCalendarClient->>GoogleCalendarAPI: Insert or list calendar events
  GoogleCalendarAPI-->>GoogleCalendarClient: Event result
  GoogleCalendarClient-->>MCPToolHandler: Event ID or current summary
Loading
sequenceDiagram
  participant SlackEventHandler
  participant FeatureController
  participant SlackAPI
  SlackEventHandler->>FeatureController: HandleAppHomeOpened
  FeatureController->>FeatureController: Build preference and feature status blocks
  FeatureController->>SlackAPI: PublishView with user ID and blocks
  SlackAPI-->>FeatureController: Publish result
Loading

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

@LSUDOKO
LSUDOKO merged commit ac08095 into main Jul 11, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant