Skip to content

Conversation

@mortenoh
Copy link
Contributor

@mortenoh mortenoh commented Jan 26, 2026

Summary

  • Add required id field to ServiceInfo with slug format validation
  • Service ID is now sent to orchestrator during registration, making registration idempotent
  • Update all examples and documentation to include the new id field

Changes

ServiceInfo

  • New required id field with slug format validation (^[a-z][a-z0-9]*(-[a-z0-9]+)*$)
  • Valid formats: my-service, chap-ewars, prediction-service
  • Invalid formats: My-Service (uppercase), my_service (underscore), 1-service (starts with number)

Registration

  • Registration payload now includes id field from ServiceInfo
  • Service ID is used for keepalive/deregister URLs instead of orchestrator-assigned ULID
  • Makes registration idempotent - re-registering updates existing entry

Version

  • Bump version to 0.8.0

BREAKING CHANGE

All existing ServiceInfo usages must add the id field:

# Before
ServiceInfo(display_name="My Service")

# After
ServiceInfo(id="my-service", display_name="My Service")

Test plan

  • All existing tests pass (make test)
  • All linting passes (make lint)
  • New validation tests for id format
  • Examples updated and verified

Add a required `id` field to ServiceInfo using slug format (lowercase
alphanumeric with hyphens). This ID is sent to the orchestrator during
registration, making registration idempotent and providing a predictable
identifier for use in chap-core.

Changes:
- Add `id` field to ServiceInfo with slug format validation
- Update registration.py to use info.id instead of orchestrator-assigned ID
- Include id in registration payload sent to orchestrator
- Update all examples to include id field
- Add validation tests for id format
- Update documentation with id field examples

BREAKING CHANGE: ServiceInfo now requires an `id` field
@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mortenoh mortenoh merged commit 43e9f08 into main Jan 26, 2026
2 checks passed
@mortenoh mortenoh deleted the feat/service-id-field branch January 26, 2026 13:40
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