Add proboctl merge-manual-into-scim command#1473
Closed
SachaProbo wants to merge 1 commit into
Closed
Conversation
Contributor
There was a problem hiding this comment.
2 issues found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="pkg/proboctl/membershipprofile/merge_manual_into_scim.go">
<violation number="1" location="pkg/proboctl/membershipprofile/merge_manual_into_scim.go:58">
P1: The merge can select the opposite profile pair from the documented rule: `m.created_at < s.created_at` requires the MANUAL profile to be older, not the SCIM profile. Consider reversing the predicate in both `previewSQL` and `mergeSQL` so dry-run and write use the same intended eligibility check.</violation>
<violation number="2" location="pkg/proboctl/membershipprofile/merge_manual_into_scim.go:96">
P1: This merge leaves several profile-backed foreign keys untouched, so it does not actually repoint every MANUAL membership profile reference. Rows in `documents`, `document_versions`, `meeting_attendees`, `nonconformities`, `states_of_applicability`, and `vendors` can still keep the old MANUAL profile IDs after the command completes.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
50f2371 to
9a7e92b
Compare
Add a proboctl membership-profile merge-manual-into-scim command that, for one organization, repoints every reference (ownership, task assignment, signatures, approvals, etc.) from each MANUAL membership profile onto the matching SCIM profile. A manual profile is merged only when its normalized full name maps to exactly one SCIM profile that is a real IAM member and predates it. The repoint runs as a single statement of data-modifying CTEs: no rows are deleted, and any constraint violation fails the whole statement. --dry-run prints the mapping and --yes gates the write. Signed-off-by: Sacha Al Himdani <[email protected]>
9a7e92b to
2c063a3
Compare
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.
Add a proboctl membership-profile merge-manual-into-scim command that, for one organization, repoints every reference (ownership, task assignment, signatures, approvals, etc.) from each MANUAL membership profile onto the matching SCIM profile.
A manual profile is merged only when its normalized full name maps to exactly one SCIM profile that is a real IAM member and predates it. The repoint runs as a single statement of data-modifying CTEs: no rows are deleted, and any constraint violation fails the whole statement. --dry-run prints the mapping and --yes gates the write.
Summary by cubic
Adds
proboctl membership-profile merge-manual-into-scimto repoint MANUAL profiles to their unique SCIM match for one org. Runs as a single-statement merge with a preflight that shows mappings, per-target move/skip counts, and collisions; supports--dry-runand--yes.proboctl
+725-0membership-profilegroup andmerge-manual-into-scim; registered inproboctlroot.--dry-runprints only;--yesapplies and prints per-target results; constraint failures surface the violated constraint name.Written for commit 2c063a3. Summary will update on new commits.