Identity consistency: slug webhooks, pipeline refs by slug, dead-code cleanup#151
Merged
Conversation
… UUID code
Closes the remaining UUID inconsistencies an audit surfaced after the slug/number
redesign, so every workspace-owned config resource is addressed the same way.
Webhooks by slug
- Add an immutable per-workspace slug (migration + UNIQUE(workspace_id, slug) +
format/length checks), mirroring connections/pipelines/policies/contexts.
- Route is {webhookSlug}; create takes a required slug; a duplicate is a 409.
Response is slug-only (drops the webhook UUID). find_webhook resolves by slug.
Pipeline policy/context references by slug
- PipelineDefinition exposes policySlugs/contextSlugs instead of raw UUIDs.
- On write, the slugs are resolved to ids (scoped to the pipeline's workspace,
404 on any unknown reference) before the join tables are written; the join
tables keep UUID foreign keys. On read, the referenced slugs are listed back
via a join. The engine run path still resolves by id internally.
Dead code
- Remove the unused create_connection_with_unique_slug (connections require an
explicit slug; a duplicate is a 409) and the orphaned WorkspacePathParams /
FilePathParams / VersionPathParams path structs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the slug/number identity redesign. An audit of the handler layer found three remaining UUID inconsistencies; this closes them so every workspace-owned config resource is addressed the same way.
Webhooks by slug
Webhooks were the only workspace config resource still UUID-keyed. Now mirror connections/pipelines/policies/contexts:
slug(migration +UNIQUE(workspace_id, slug)+ format/length checks).{webhookSlug};CreateWebhooktakes a required slug; duplicate → 409.find_webhookresolves by slug.Pipeline policy/context references by slug
A pipeline referenced its policies/contexts by UUID while those resources are slug-addressed everywhere else.
PipelineDefinitionnow exposespolicySlugs/contextSlugsinstead ofpolicyIds/contextIds.Dead-code cleanup
create_connection_with_unique_slug(connections require an explicit slug; duplicate → 409).WorkspacePathParams/FilePathParams/VersionPathParamspath structs (superseded by the slug extractor).Also: dropped a few historic/changelog-style code comments in favor of current-state docs.
Verification
cargo check/clippy -D warnings/fmt/rustdoc -D warnings/ full test suite — clean.{webhookSlug}(no{webhookId});Webhookresponse has nowebhookId;PipelineDefinitionexposespolicySlugs/contextSlugs(nopolicyIds).pii-mask+ pipelinepolicySlugs:["pii-mask"]→ 201, reads back["pii-mask"]; unknown ref slug → 404.🤖 Generated with Claude Code