Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
07cb19a
docs: add PRD for unified output system with logs and shell access
stmh Sep 17, 2025
c4f4005
feat: add bollard technical spike and findings documentation
stmh Sep 17, 2025
311f569
feat: add unified output system and configuration
stmh Sep 17, 2025
2dc35a7
feat!: refactor TaskDetails and TaskManager to use unified output
stmh Sep 17, 2025
39c852a
fix: show container status messages to clients via task output
stmh Sep 17, 2025
b704b83
docs: add code quality reminder to CLAUDE.md
stmh Sep 17, 2025
91c7d7b
feat: add WebSocket message types for logs and shell sessions
stmh Sep 17, 2025
bef20ac
docs: document Phase 1 completion and next steps
stmh Sep 17, 2025
b33a52f
feat: implement bollard log streaming and shell services
stmh Sep 17, 2025
15a0eea
feat(core): add helper methods for container lookup in AppData
stmh Sep 18, 2025
4cf96a6
refactor(services): improve error handling and add helper methods
stmh Sep 18, 2025
bbc83e7
feat(api): integrate service errors with AppError
stmh Sep 18, 2025
922bef8
feat(api): implement logs and shell API endpoints
stmh Sep 18, 2025
5ec778e
feat(router): integrate logs and shell endpoints into API router
stmh Sep 18, 2025
ad5fac9
test: add comprehensive tests for logs and shell services
stmh Sep 18, 2025
3355b45
fix(test): update secure_response_test for removed TaskDetails fields
stmh Sep 18, 2025
5312162
docs: update CLAUDE.md with Phase 2 completion status
stmh Sep 18, 2025
ec78fc8
chore: Fix clippy suggestions
stmh Sep 18, 2025
5c84d67
refactor(cli): reorganize app commands into modular structure and add…
stmh Sep 21, 2025
7d8b6a0
feat(logs): implement authenticated WebSocket log streaming with impr…
stmh Sep 21, 2025
f88647c
feat(cli): simplify --timestamps flag to boolean behavior
stmh Sep 21, 2025
9d1a125
feat(cli): improve log command options for better UX
stmh Sep 21, 2025
8137915
docs: update PRD and CLAUDE.md to reflect Phase 3 completion
stmh Sep 21, 2025
b4be84c
feat(cli): improve log command UX and add terminal detection
stmh Sep 21, 2025
afad796
feat(websocket): implement unified task output streaming system
stmh Sep 22, 2025
4606adc
refactor(api): restructure handlers into REST and WebSocket modules
stmh Sep 22, 2025
ee1875d
refactor(websocket): consolidate message types in scotty-core
stmh Sep 22, 2025
b220730
docs: update PRD and CLAUDE.md for Phase 3.5 completion
stmh Sep 22, 2025
71d155e
feat(websocket): implement real-time task output streaming for Phase 3.6
stmh Sep 22, 2025
92660bb
docs: update CLAUDE.md and PRD with Phase 3.6 completion details
stmh Sep 22, 2025
56a1d03
feat(dev): add Zed debug configuration for scotty server
stmh Sep 22, 2025
740eda5
chore: Apply clippy fixes
stmh Sep 22, 2025
3e789b6
chore: Apply cargo fmt fixes
stmh Sep 22, 2025
8d36f23
refactor(websocket): improve messaging consistency and error handling
stmh Sep 22, 2025
82db01d
feat(core): add TypeScript bindings generation for WebSocket messages
stmh Sep 28, 2025
1cba507
feat(websocket): enhance message types for frontend integration
stmh Sep 28, 2025
fef2f3b
feat(frontend): implement real-time task output and WebSocket integra…
stmh Sep 28, 2025
cd8b245
chore: update documentation and configuration for frontend integration
stmh Sep 28, 2025
feb5d6a
fix(auth): resolve wildcard scope expansion bug in authorization system
stmh Sep 28, 2025
319f021
refactor(frontend): centralize session management and eliminate token…
stmh Sep 28, 2025
5c58511
docs(config): improve OAuth assignments documentation
stmh Sep 28, 2025
b8e50a6
fix(frontend): resolve WebSocket integration and task output issues
stmh Sep 28, 2025
7dfe6f1
chore: update dependencies and configuration files
stmh Sep 28, 2025
24d2250
refactor: optimize build system and eliminate type duplication
stmh Sep 28, 2025
bcc4990
docs: update documentation for Phase 3.7 infrastructure optimization
stmh Sep 28, 2025
eeecd48
docs: clarify TaskDetails breaking change implementation
stmh Sep 28, 2025
3eb7fc1
fix(ts-generator): prevent unwanted bindings directory creation
stmh Sep 28, 2025
1f4f0a3
feat(output): add dedicated OutputStreamType variants for status mess…
stmh Sep 28, 2025
6e64fa5
perf(auth): implement token caching to reduce filesystem access
stmh Sep 28, 2025
55d2703
refactor(test): reduce app state creation duplication in bearer_auth_…
stmh Sep 28, 2025
41b65f6
refactor(core): embed TaskOutput directly in TaskDetails for tight co…
stmh Sep 29, 2025
8ce9a6a
Merge branch 'main' into feat/better-logs-and-shell
stmh Oct 16, 2025
d4f3ffb
fix: resolve merge conflicts from main branch
stmh Oct 16, 2025
90fb25a
chore: add allow(dead_code) attributes to suppress clippy warnings
stmh Oct 16, 2025
040ec7d
Merge branch 'main' into feat/better-logs-and-shell
stmh Oct 23, 2025
7a507d4
Merge branch 'main' into feat/better-logs-and-shell
stmh Oct 23, 2025
1570232
Merge branch 'main' into feat/better-logs-and-shell
stmh Oct 23, 2025
160375a
fix(backend): resolve deadlock and lock contention in task management
stmh Oct 23, 2025
5518021
chore(frontend): improve UI components and development tooling
stmh Oct 23, 2025
20b3da2
fix(frontend): resolve custom actions dropdown reactivity issues
stmh Oct 23, 2025
b198374
chore: Code style fixes
stmh Oct 23, 2025
d3bd5ae
refactor(frontend): fix ESLint errors and improve code quality
stmh Oct 24, 2025
1346102
chore(deps): update npm dependencies auto-merge (patch) (#511)
renovate[bot] Oct 24, 2025
287dff8
docs: correct unified output system implementation status
stmh Oct 24, 2025
bd8ad97
fix(auth): resolve WebSocket dev mode authentication and security issues
stmh Oct 24, 2025
3b8c03a
refactor(tasks): unify task completion handlers and fix state management
stmh Oct 24, 2025
c2528c1
fix: cleanup frontend task output
stmh Oct 24, 2025
7e8b156
feat(frontend): implement container log viewer with navigation improv…
stmh Oct 24, 2025
72efe2f
refactor: improve log output styling, performance, and controls
stmh Oct 24, 2025
f962e82
refactor(frontend): restructure task detail page for consistency
stmh Oct 24, 2025
9e11bd9
ci: add TypeScript generation step to frontend build
stmh Oct 24, 2025
82eb890
fix(ci): run TypeScript generator from correct working directory
stmh Oct 24, 2025
d5dcf49
Merge pull request #513 from factorial-io/feat/logview-in-frontend
stmh Oct 24, 2025
6842cdb
chore: Use AGENTS.md
stmh Oct 24, 2025
c440587
chore: initialize beads issue tracking for unified output system
stmh Oct 24, 2025
5f93545
docs: move progress tracking from docs to beads issues
stmh Oct 24, 2025
7711819
docs: research OpenTelemetry metrics with OTel Collector + VictoriaMe…
stmh Oct 24, 2025
d7971ed
feat: add OpenTelemetry metrics infrastructure with OTel Collector + …
stmh Oct 24, 2025
524fbbe
refactor: consolidate observability stack into main docker-compose.yml
stmh Oct 24, 2025
bcd0dfa
feat(metrics): add OpenTelemetry metrics module with ScottyMetrics st…
stmh Oct 24, 2025
2a69d85
feat(metrics): instrument log streaming service with OpenTelemetry me…
stmh Oct 24, 2025
2022a4f
feat(metrics): make OTLP endpoint configurable via environment variable
stmh Oct 24, 2025
f3de56c
fix(observability): remove resourcedetection processor from otel-coll…
stmh Oct 25, 2025
a43d743
feat(observability): add Grafana dashboard for scotty metrics
stmh Oct 25, 2025
012fc27
fix(observability): correct OpenTelemetry metric names in Grafana das…
stmh Oct 25, 2025
cab98b6
feat: add memory usage metrics (scotty-17)
stmh Oct 25, 2025
72207b6
refactor: reorganize observability stack into dedicated directory
stmh Oct 25, 2025
29d47c0
feat(metrics): add task metrics and refactor to use dedicated helper …
stmh Oct 25, 2025
f5a842a
feat(metrics): add stable Tokio task metrics tracking
stmh Oct 25, 2025
42d296a
feat(observability): add Tokio runtime metrics to Grafana dashboard
stmh Oct 25, 2025
bb28b5c
feat(observability): enhance metrics collection and add HTTP metrics …
stmh Oct 25, 2025
991755e
refactor: use spawn_instrumented for consistent Tokio metrics tracking
stmh Oct 25, 2025
075c755
feat(observability): upgrade to OpenTelemetry 0.31 and implement cust…
stmh Oct 25, 2025
8e29753
fix(observability): enable HTTP metrics middleware when metrics telem…
stmh Oct 25, 2025
aaa4946
chore: close OpenTelemetry upgrade task (scotty-15)
stmh Oct 25, 2025
28783bc
feat(observability): add AppList metrics for application monitoring (…
stmh Oct 26, 2025
a612480
feat(observability): add WebSocket metrics instrumentation (scotty-11)
stmh Oct 26, 2025
184fa98
feat(observability): add task output streaming metrics (scotty-16)
stmh Oct 26, 2025
162326f
feat(observability): instrument shell service with metrics (scotty-10)
stmh Oct 26, 2025
6e14d8f
refactor(observability): move app metrics into dedicated dashboard row
stmh Oct 26, 2025
17e9387
docs(observability): add comprehensive observability documentation (s…
stmh Oct 26, 2025
fe60b3b
chore: update beads issue tracking with completed metrics work
stmh Oct 26, 2025
6854663
docs(observability): add Prometheus compatibility and stack flexibili…
stmh Oct 26, 2025
5fc9fa3
docs(observability): condense Prometheus compatibility section
stmh Oct 26, 2025
d2e0bbc
docs: add observability to documentation navigation menu
stmh Oct 26, 2025
d4eb5ee
chore: update beads tracking with completed documentation task
stmh Oct 26, 2025
1a3019a
fix: resolve clippy linting errors in metrics modules
stmh Oct 26, 2025
307230f
style: apply cargo fmt formatting fixes
stmh Oct 26, 2025
40e96fb
Merge pull request #514 from factorial-io/feat/otel-metrics-observabi…
stmh Oct 26, 2025
be8baa6
"Update Claude PR Assistant workflow"
stmh Oct 26, 2025
9de343a
"Update Claude Code Review workflow"
stmh Oct 26, 2025
aab2390
Merge pull request #515 from factorial-io/add-claude-github-actions-1…
stmh Oct 26, 2025
4afb059
Merge branch main into feat/better-logs-and-shell
stmh Oct 26, 2025
87adaab
Merge branch 'next' into feat/better-logs-and-shell
stmh Oct 26, 2025
be32979
Add Rust code quality improvement tasks to backlog
stmh Oct 26, 2025
256c844
fix(scotty-types): prevent panic on UTF-8 character truncation
stmh Oct 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .beads/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SQLite databases
*.db
*.db-journal
*.db-wal
*.db-shm

# Daemon runtime files
daemon.log
daemon.pid
bd.sock

# Legacy database files
db.sqlite
bd.db

# Keep JSONL exports (source of truth for git)
!*.jsonl
31 changes: 31 additions & 0 deletions .beads/issues.jsonl

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .env.1password
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SCOTTY__DOCKER__REGISTRIES__FACTORIAL__PASSWORD=op://Kubernetes/Deploybot Kubernetes token/password
SCOTTY__API__OAUTH__CLIENT_ID=op://Scotty/scotty local oauth gitlab/application_id
SCOTTY__API__OAUTH__CLIENT_SECRET=op://Scotty/scotty local oauth gitlab/Secret
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ jobs:

steps:
- uses: actions/checkout@v4

# Setup Rust toolchain for TypeScript generation
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

# Generate TypeScript types from Rust code
- name: Generate TypeScript types
run: cargo run
working-directory: ts-generator

- uses: oven-sh/setup-bun@v2

# run any `bun` or `bunx` command
Expand Down
49 changes: 13 additions & 36 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ jobs:
# github.event.pull_request.user.login == 'external-contributor' ||
# github.event.pull_request.user.login == 'new-developer' ||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'

if: github.event.pull_request.user.type != 'Bot'

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -35,46 +33,25 @@ jobs:

- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@beta
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4.1)
# model: "claude-opus-4-1-20250805"
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}

# Direct prompt for automated review (no @claude mention needed)
direct_prompt: |
Please review this pull request and provide feedback on:
- Code quality and best practices
- Potential bugs or issues
- Performance considerations
- Security concerns
- Test coverage

Be constructive and helpful in your feedback.

# Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
# use_sticky_comment: true

# Optional: Customize review based on file types
# direct_prompt: |
# Review this PR focusing on:
# - For TypeScript files: Type safety and proper interface usage
# - For API endpoints: Security, input validation, and error handling
# - For React components: Performance, accessibility, and best practices
# - For tests: Coverage, edge cases, and test quality

# Optional: Different prompts for different authors
# direct_prompt: |
# ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
# 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
# 'Please provide a thorough code review focusing on our coding standards and best practices.' }}

# Optional: Add specific tools for running tests or linting
# allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"

# Optional: Skip review for certain conditions
# if: |
# !contains(github.event.pull_request.title, '[skip-review]') &&
# !contains(github.event.pull_request.title, '[WIP]')
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.

Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.

# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'

34 changes: 10 additions & 24 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,19 @@ jobs:

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@beta
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read

# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4.1)
# model: "claude-opus-4-1-20250805"

# Optional: Customize the trigger phrase (default: @claude)
# trigger_phrase: "/claude"

# Optional: Trigger when specific user is assigned to an issue
# assignee_trigger: "claude-bot"

# Optional: Allow Claude to run specific commands
# allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"

# Optional: Add custom instructions for Claude to customize its behavior for your project
# custom_instructions: |
# Follow our coding standards
# Ensure all new code has tests
# Use TypeScript for new files

# Optional: Custom environment variables for Claude
# claude_env: |
# NODE_ENV: test

# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'

# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr:*)'

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/target
/ts-generator/target
frontend/node_modules
frontend/src/generated/
scotty-types/bindings/
docs/node_modules
docs/_site
apps/test-nginx-creation
Expand Down
18 changes: 18 additions & 0 deletions .zed/debug.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Project-local debug tasks
//
// For more documentation on how to configure debug tasks,
// see: https://zed.dev/docs/debugger
[
{
"label": "Build & Debug scotty server",
"build": {
"command": "cargo",
"args": ["build", "--bin", "scotty"]
},
"program": "$ZED_WORKTREE_ROOT/target/debug/scotty",
// sourceLanguages is required for CodeLLDB (not GDB) when using Rust
"sourceLanguages": ["rust"],
"request": "launch",
"adapter": "CodeLLDB"
}
]
46 changes: 37 additions & 9 deletions CLAUDE.md → AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# CLAUDE.md
# AGENTS.md

BEFORE ANYTHING ELSE: run 'bd onboard' and follow the instructions

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Expand All @@ -7,7 +9,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
Scotty is a Rust-based Micro-PaaS (Platform as a Service) that provides an API to manage Docker Compose-based applications. It consists of three main components:

- **scotty**: HTTP server providing REST API and web UI for managing applications
- **scottyctl**: CLI application for interacting with the Scotty server
- **scottyctl**: CLI application for interacting with the Scotty server
- **scotty-core**: Core library containing shared data structures and settings

## Architecture
Expand All @@ -23,7 +25,7 @@ Scotty manages applications by:

Scotty supports three authentication modes (configured via `auth_mode`):
- **Development**: No authentication required, uses fixed dev user
- **OAuth**: Authentication via oauth2-proxy with GitLab OIDC integration
- **OAuth**: Authentication via oauth2-proxy with GitLab OIDC integration
- **Bearer**: Traditional token-based authentication

Authentication is handled by the `basic_auth.rs` middleware which extracts user information based on the configured mode.
Expand Down Expand Up @@ -56,7 +58,7 @@ cd frontend
# Install dependencies (use bun instead of npm)
bun install

# Run development server
# Run development server
bun run dev

# Build for production
Expand Down Expand Up @@ -109,7 +111,7 @@ cd examples/oauth2-proxy
# Start in development mode (no auth)
./start-dev.sh dev

# Start with OAuth (requires GitLab app configuration)
# Start with OAuth (requires GitLab app configuration)
op run --env-file="./.env.1password" -- ./start-dev.sh oauth --build

# Start in bearer token mode
Expand Down Expand Up @@ -137,7 +139,7 @@ op run --env-file="./.env.1password" -- ./start-dev.sh oauth --build
apps/
├── my-app/
│ ├── docker-compose.yml # Required
│ ├── .scotty.yml # Optional app settings
│ ├── .scotty.yml # Optional app settings
│ ├── docker-compose.override.yml # Generated by Scotty
│ └── ... (other app files)
```
Expand All @@ -162,15 +164,41 @@ Scotty generates appropriate configurations for:
- Supports custom middlewares, basic auth, robots.txt prevention
- Automatic SSL via Let's Encrypt integration

### HAProxy-Config (Legacy)
### HAProxy-Config (Legacy)
- Uses environment variables for configuration
- Limited feature set compared to Traefik

## Development Notes

- Use workspace-level Cargo.toml for shared dependencies
- Frontend uses Bun instead of npm for package management
- Frontend uses Bun instead of npm for package management (62% faster builds)
- TypeScript generation optimized with standalone `ts-generator` crate (6s vs 27s)
- All shared types consolidated in `scotty-types` crate (single source of truth)
- Docker builds support multiple platforms (ARM64, x86_64, glibc, musl)
- Conventional commits are enforced via git-cliff
- Pre-push hooks via cargo-husky perform quality checks
- Container apps directory must have identical paths on host and container for bind mounts
- Use conventional commit messages
- Use conventional commit messages
- **IMPORTANT**: Always run quality checks before committing:
- Rust code: `cargo fmt` and `cargo clippy`
- Frontend code: `cd frontend && bun run lint` (runs Prettier and ESLint)
- If linting fails, run `bun run format` to auto-fix formatting issues

## Current Work in Progress

### Unified Output System Implementation

**Branch:** `feat/better-logs-and-shell`

See beads issues (scotty-1 and children) for current implementation status and remaining work.

**Reference Documents:**
- `docs/prds/unified-output-system.md` - Complete PRD and technical specifications
- `docs/technical-spike-bollard-findings.md` - Bollard API validation results

**Key Notes:**
- The build files of scotty_frontend will be embedded into scotty, so restart scotty after the frontend files got rebuilt
- Backend log streaming and shell services are fully implemented and tested
- CLI `app:logs` command is fully functional with real-time streaming
- Frontend task output viewer uses WebSocket integration
- Breaking change: TaskDetails no longer contains stdout/stderr fields (uses WebSocket streaming instead)
Loading
Loading