Commit Graph

24 Commits

Author SHA1 Message Date
argoyle 381816a66e fix: log startup errors to stderr and exit non-zero
schemas / vulnerabilities (pull_request) Successful in 1m49s
schemas / check (pull_request) Successful in 3m5s
schemas / check-release (pull_request) Successful in 3m45s
pre-commit / pre-commit (pull_request) Successful in 6m15s
schemas / build (pull_request) Successful in 5m51s
schemas / deploy-prod (pull_request) Has been skipped
When start() returns an error, main() logged it via the slog logger and
returned normally (exit 0), so a crash-looping pod showed as "Completed"
with no error in the logs: start() defers the OTel SDK shutdown, tearing
down the log exporter before main() logs, so with LOG_FORMAT=otel the
record never reaches Alloy.

Also write the error to stderr (always captured by `kubectl logs`) and
os.Exit(1) so the container is correctly reported as failed.
2026-05-25 22:34:57 +02:00
argoyle 5c77e0a455 fix(deps): bump eventsourced/pg to v2.0.2, eventsourced to v1.23.0
pg v1.19.0+ auto-runs an idempotency migration whose partial index used a
non-IMMUTABLE now() predicate, which Postgres rejects at creation. That
failed pg.New() at startup and crash-looped the service (silently, exit 0).
schemas was on the broken pg v1.20.0.

The fix is in pg's v2 line; v2.0.0/v2.0.1 were unconsumable (go.mod module
path lacked the required /v2 suffix), corrected in v2.0.2. Bump to:

  - gitlab.com/unboundsoftware/eventsourced/pg/v2 v2.0.2
  - gitlab.com/unboundsoftware/eventsourced/eventsourced v1.23.0 (required by pg/v2)

Only the import path changes (.../pg -> .../pg/v2); package stays `pg`, no
call sites change.
2026-05-25 22:34:20 +02:00
argoyle 4e50a051d0 perf(graph): warm schema cache on startup to kill cold-start spikes (#843)
Release / release (push) Failing after 59s
schemas / vulnerabilities (push) Successful in 2m34s
schemas / check (push) Successful in 2m59s
schemas / check-release (push) Successful in 3m18s
pre-commit / pre-commit (push) Successful in 6m28s
schemas / build (push) Successful in 6m20s
schemas / deploy-prod (push) Successful in 1m58s
2026-05-21 15:25:49 +00:00
argoyle 28aa32ad8c fix: prevent OOM on rapid schema publishing
schemas / vulnerabilities (pull_request) Successful in 6m43s
schemas / check-release (pull_request) Successful in 11m27s
schemas / check (pull_request) Successful in 14m51s
pre-commit / pre-commit (pull_request) Successful in 19m39s
schemas / build (pull_request) Successful in 8m26s
schemas / deploy-prod (pull_request) Has been skipped
Add concurrency-limited CosmoGenerator (semaphore limit=1, 60s timeout)
to prevent unbounded concurrent wgc process spawning. Add debouncer
(500ms) to coalesce rapid schema updates per org+ref. Fix double
subgraph fetch in Supergraph resolver and goroutine leak in
SchemaUpdates subscription.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 08:05:47 +01:00
argoyle 73eae98929 feat: migrate from GitLab CI to Gitea Actions
schemas / vulnerabilities (pull_request) Successful in 2m15s
schemas / check-release (pull_request) Successful in 2m17s
schemas / check (pull_request) Successful in 4m48s
pre-commit / pre-commit (pull_request) Successful in 5m58s
schemas / build (pull_request) Successful in 3m36s
schemas / deploy-prod (pull_request) Has been skipped
- Update git remote to git.unbound.se
- Add Gitea workflows: ci.yaml, pre-commit.yaml, release.yaml, goreleaser.yaml
- Delete .gitlab-ci.yml
- Update Go module path to gitea.unbound.se/unboundsoftware/schemas
- Update all imports to new module path
- Update Docker registry to oci.unbound.se
- Update .goreleaser.yml for Gitea releases with internal cluster URL
- Remove GitLab CI linter from pre-commit config
- Use shared release workflow with tag_only for versioning

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:53:46 +01:00
argoyle ffcf41b85a feat: add commands for managing organizations and users
Introduce `AddUserToOrganization`, `RemoveAPIKey`, and 
`RemoveOrganization` commands to enhance organization 
management. Implement validation for user addition and 
API key removal. Update GraphQL schema to support new 
mutations and add caching for the new events, ensuring 
that organizations and their relationships are accurately 
represented in the cache.
2025-11-22 18:37:07 +01:00
argoyle a9dea19531 feat(health): add health checking endpoints and logic
Introduce health checking functionality with liveness and readiness 
endpoints to monitor the application's status. Implement a health 
checker that verifies database connectivity and provides a simple 
liveness check. Update service routing to use the new health 
checker functionality. Add corresponding unit tests for validation.
2025-11-21 10:24:34 +01:00
argoyle 4468903535 feat(cache): implement hashed API key storage and retrieval
Adds a new hashed key storage mechanism for API keys in the cache. 
Replaces direct mapping to API keys with composite keys based on 
organizationId and name. Implements searching of API keys using 
hash comparisons for improved security. Updates related tests to 
ensure correct functionality and validate the hashing. Also, 
adds support for a new dependency `golang.org/x/crypto`.
2025-11-20 22:11:24 +01:00
argoyle 4d18cf4175 feat(tests): add unit tests for WebSocket initialization logic
Adds unit tests for the WebSocket initialization function to validate
behavior with valid, invalid, and absent API keys. Introduces a mock
cache implementation to simulate organization retrieval based on
hashed API keys. Ensures proper context value setting upon
initialization, enhancing test coverage and reliability for API key
handling in WebSocket connections.
2025-11-20 14:25:02 +01:00
argoyle bb0c08be06 fix: enhance API key handling and logging in middleware
Refactor API key processing to improve clarity and reduce code 
duplication. Introduce detailed logging for schema updates and 
initializations, capturing relevant context information. Use 
background context for async operations to avoid blocking. 
Implement organization lookup logic in the WebSocket init 
function for consistent API key handling across connections.
2025-11-20 12:58:15 +01:00
argoyle 80daed081d feat: add Cosmo Router config generation and PubSub support
Creates a new `GenerateCosmoRouterConfig` function to build and 
serialize a Cosmo Router configuration from subgraphs. Implements 
PubSub mechanism for managing schema updates, allowing 
subscription to updates. Adds Subscription resolver and updates 
existing structures to accommodate new functionalities. This 
enhances the system's capabilities for dynamic updates and 
configuration management.
2025-11-19 11:29:30 +01:00
argoyle e84df1db08 refactor: remove Sentry integration and replace with OpenTelemetry
Remove Sentry dependencies and configuration. Introduce monitoring 
setup for OpenTelemetry. Update logging to include log format 
options, and replace Sentry error handling middleware with 
monitoring handlers for GraphQL playground. Adjust environment 
variable handling to enhance configuration clarity and flexibility.
2025-06-13 11:00:52 +02:00
argoyle aaa111dd20 feat(service): implement graceful shutdown for HTTP server
Add a context with timeout to handle graceful shutdown of the HTTP 
server. Update error handling during the server's close to include 
context-aware shutdown. Ensure that the server properly logs only 
non-closed errors when listening.
2025-04-12 13:41:02 +02:00
Renovate b1c31afed3 fix(deps): update module github.com/99designs/gqlgen to v0.17.58 2024-12-10 11:03:52 +01:00
argoyle 9f388bddf4 chore: use OrbStack for local dev 2024-03-01 21:50:56 +00:00
argoyle 25abefe04f chore(deps): bump github.com/sparetimecoders/goamqp from 0.2.1 to 0.3.0
Bumps [github.com/sparetimecoders/goamqp](https://github.com/sparetimecoders/goamqp) from 0.2.1 to 0.3.0.
- [Release notes](https://github.com/sparetimecoders/goamqp/releases)
- [Commits](https://github.com/sparetimecoders/goamqp/compare/v0.2.1...v0.3.0)
2024-01-17 11:47:06 +01:00
argoyle 3fd15e414e chore(deps): bump github.com/sparetimecoders/goamqp from 0.1.5 to 0.2.0
Bumps [github.com/sparetimecoders/goamqp](https://github.com/sparetimecoders/goamqp) from 0.1.5 to 0.2.0.
- [Release notes](https://github.com/sparetimecoders/goamqp/releases)
- [Commits](https://github.com/sparetimecoders/goamqp/compare/v0.1.5...v0.2.0)
2023-10-05 09:10:37 +00:00
argoyle 554a6c252f feat: organizations and API keys 2023-04-27 07:46:52 +02:00
argoyle 38dd3fe879 chore: reduce sample rate 2023-03-30 14:32:59 +02:00
argoyle 9909aa726e chore: decrease trace sample rate 2023-01-09 07:28:22 +01:00
argoyle 98a679d2d3 chore: add context and error handling 2022-12-17 14:36:42 +01:00
argoyle b8a8783838 feat: add Sentry setup 2022-12-16 15:41:47 +00:00
argoyle 577ad601ca feat: add Sentry setup 2022-12-16 16:02:16 +01:00
argoyle a1b4d4fc27 feat: initial commit 2022-10-09 20:37:48 +02:00