feat(policy): use name as the sole policy identifier#292
Merged
Conversation
Folds in the substantive work from PR #284 (issue #250) onto current main, resolving the drift from the spike-sdk-go v0.19.9 migration. SPIKE policies are uniquely identified by their user-provided name, so the auto-generated UUID id added drift and a practically unused column. This removes it end to end: - Drop the id column from the policies table; name is now the PRIMARY KEY. Upsert, load, and delete queries all key on name. - Persist, state, memory backend, and CLI operate on name; delete and load-by-name replace the id-based paths. - google/uuid is no longer imported directly (demoted to indirect). Conflict resolutions preserve main's post-migration idioms: - persist StorePolicy/DeletePolicy keep the withSerializableTx helper while switching to name-based args - CLI keeps the context.Context threading; findPolicyByName uses the ctx-aware ListAllPolicies The SDK still exposes the identifier as PolicyReadRequest.ID and PolicyDeleteRequest.ID, so request.ID carries the policy name at the route boundary. This bridge is documented inline; issue #250 tracks the pending SDK field rename. (TODO markers from the original PR were converted to plain comments per the no-TODO-in-main rule.) make test and make audit both pass; govulncheck reports 0 affecting vulnerabilities. Spec: TBD Co-authored-by: Ali Mohammed <terminalexe1@gmail.com> Signed-off-by: Volkan Özçelik <volkan.ozcelik@broadcom.com>
Member
Author
|
Supersedes and closes: #284 |
Member
Author
|
reminder. Issue #250 is still open and it is related to this and possibly the next thing to be done. |
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.
Folds in the substantive work from PR #284 (issue #250) onto current main, resolving the drift from the spike-sdk-go v0.19.9 migration.
SPIKE policies are uniquely identified by their user-provided name, so the auto-generated UUID id added drift and a practically unused column. This removes it end to end:
Conflict resolutions preserve main's post-migration idioms:
The SDK still exposes the identifier as PolicyReadRequest.ID and PolicyDeleteRequest.ID, so request.ID carries the policy name at the route boundary. This bridge is documented inline; issue #250 tracks the pending SDK field rename. (TODO markers from the original PR were converted to plain comments per the no-TODO-in-main rule.)
make test and make audit both pass; govulncheck reports 0 affecting vulnerabilities.
cc: @Aliexe-code
Spec: TBD