Skip to content

refactor: rename API server to controller#287

Open
retr0h wants to merge 12 commits intomainfrom
refactor/rename-api-to-controller
Open

refactor: rename API server to controller#287
retr0h wants to merge 12 commits intomainfrom
refactor/rename-api-to-controller

Conversation

@retr0h
Copy link
Collaborator

@retr0h retr0h commented Mar 20, 2026

Summary

Rename the "API server" to "controller" to reflect its role as the control
plane process that owns the REST API, heartbeat, and notification watcher.

  • Config: api.*controller.* (YAML and env vars)
  • CLI: osapi api server startosapi controller start
  • Code: internal/api/internal/controller/api/,
    internal/notify/internal/controller/notify/
  • Heartbeat: moved to internal/controller/ as a controller concern
  • Tests: all config literals and env vars updated
  • Docs: CLAUDE.md, configuration.md, architecture docs, feature docs

Breaking changes

  • Config: api.*controller.*
  • Env vars: OSAPI_API_*OSAPI_CONTROLLER_*
  • CLI: osapi api server startosapi controller start

🤖 Generated with Claude Code

retr0h and others added 8 commits March 19, 2026 21:35
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace API struct with Controller containing APIServer,
Client, and NATSConnection. Update osapi.yaml config files.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move heartbeat to internal/controller/ as a controller concern.
Update all import paths project-wide.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove cmd/api.go parent, add cmd/controller.go
- Rename apiServerCmd → controllerCmd, apiServerStartCmd →
  controllerStartCmd
- Rename client api → client controller commands
- Update all appConfig.API references to appConfig.Controller
- Fix all test config literals (config.API → config.Controller)
- Update setupAPIServer → setupController and related functions

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Update CLAUDE.md, configuration.md, architecture.md,
system-architecture.md, development.md, health-checks.md,
notifications.md, and intro.md.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Thank you for contributing to this project! 😊🕹️

retr0h and others added 4 commits March 19, 2026 22:32
- Fix import paths in *.gen.go and cfg.yaml files
- Fix SDK client gen/generate.go path
- Fix justfile redocly join path
- Change heartbeat component type from "api" to "controller"
- Update client controller status filter
- Update architecture docs to describe controller sub-components
- Fix health status handler to recognize "controller" type

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fix import ordering, indentation, and line wrapping applied
by linter. Complete remaining API → Controller renames in
docs and config types.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add package-comments for controller and cmd packages.
Remove gomock_reflect temp directory that was accidentally
committed.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #287   +/-   ##
=======================================
  Coverage   99.84%   99.84%           
=======================================
  Files         227      227           
  Lines        9925     9925           
=======================================
  Hits         9910     9910           
  Misses         11       11           
  Partials        4        4           
Files with missing lines Coverage Δ
internal/controller/api/agent/agent.go 100.00% <ø> (ø)
internal/controller/api/agent/agent_drain.go 100.00% <ø> (ø)
internal/controller/api/agent/agent_get.go 100.00% <ø> (ø)
internal/controller/api/agent/agent_list.go 100.00% <ø> (ø)
internal/controller/api/agent/agent_undrain.go 100.00% <ø> (ø)
internal/controller/api/agent/validate.go 100.00% <ø> (ø)
internal/controller/api/audit/audit.go 100.00% <ø> (ø)
internal/controller/api/audit/audit_export.go 100.00% <ø> (ø)
internal/controller/api/audit/audit_get.go 100.00% <ø> (ø)
internal/controller/api/audit/audit_list.go 100.00% <ø> (ø)
... and 63 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0d1bbf...1392684. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant