Repository navigation
CXP-1395 Make the event feed examples runnable and keep revokes consistent - #159
Merged
Merged
Conversation
Add cursor and soft-delete columns to the test databases, exclude soft-deleted rows from full-sync grants, soft-delete on revoke and revive on grant, and add an event feed smoke test to CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pinned standalone baton release cannot read current c1z files and replaced the CLI the sync-test action installs. The script now fails loudly when baton grants errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
johnallers
approved these changes
Nov 23, 2026
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.
Summary
The shipped event feed examples read columns (
updated_at,deleted_at,id) that none of the test databases create, so the first feed poll failed. Their grant handling was also inconsistent with soft deletes: full syncs restored grants the feed had revoked, and revokes made through ConductorOne hard-deleted rows, so the feed could never report them.This PR targets
feat/CXH-1390and should be merged before that branch merges tomain, because that is when the example starts advertising the event feed capability.No Go code changes.
Changes
Test databases (
test/*.sql)updated_atto users and roles tables, andid,updated_at,deleted_atto role assignment tables (UserRoleID,UpdatedAt,IsDeleted,DeletedAton SQL Server). Existing columns, keys and seed rows are unchanged;(user_id, role_id)stays unique.updated_atcurrent on every update:BEFORE UPDATEtrigger.ON UPDATE CURRENT_TIMESTAMP(6).AFTER UPDATEtriggers withSET NOCOUNT ON, so the trigger's update doesn't count toward the provisioning rows-affected check.disabled.user/reader, revoked 1h before load) in each engine with a grants feed, so the feed has a revoke to report. Live grant counts are unchanged.Examples
example.yml, andpostgres-test-exclusion-group.yml, which shares the Postgres database).DELETE(Postgres, SQL Server,example.yml). Revoking an already-revoked grant still reports "already revoked".ON CONFLICT ... DO UPDATE, SQL ServerUPDATE+INSERT ... WHERE NOT EXISTS,example.yml). Granting an already-live grant still reports "already exists".mysql-test.yml:skip_ifnow usesstring(.role_name). MySQL returns text columns as bytes, and the bytes-vs-string comparison skipped every row, so full syncs returned zero role grants even before this change.example.ymlcomments onrevokes_querynow state the soft-delete rules.Docs
CI
test/event_feed_smoke.sh <engine>. It runs the feed and checks:batonCLI that thesync-testaction installs.baton_capabilities.jsonregenerated; the diff comes from the event feed work already on the base branch.Testing
go build ./...andgo test ./...pass. All changed example configs load.Smoke script results against freshly loaded fixtures (docker):
vertica/vertica-ceis no longer publicly pullableThe Postgres CI job passes with the smoke test.
Known issues not addressed here
example.ymlprovisioning writes alevelcolumn while its grants queries readaccess_level.sqlserver-test.ymlfull-sync grants query orders byRoleIDbut paginates onrole_name.test/oracle-init.sql:GRANT DBA TO baton; -- ...fails withORA-00933because of the trailing comment. Also, the XE 21 image ships a prebuilt database, so the setup script doesn't run automatically throughdocker-compose-oracle-test.yml.🤖 Generated with Claude Code