-
Notifications
You must be signed in to change notification settings - Fork 3
feat: emit PENDING status on invitation resources #184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,19 +64,17 @@ func invitationToUserResource(invitation *github.Invitation, status string) (*v2 | |
| invitation.GetID(), | ||
| []resourceSdk.UserTraitOption{ | ||
| resourceSdk.WithEmail(invitation.GetEmail(), true), | ||
| // An invitation is a pending/expired user that must not be | ||
| // reported as enabled. WithResourceStatus cannot express this: | ||
| // NewUserTrait force-defaults an unset trait status to ENABLED, so | ||
| // migrating this line would flip the emitted status from | ||
| // UNSPECIFIED to ENABLED. Keep the deprecated trait option (which | ||
| // also mirrors UNSPECIFIED to the resource level) to preserve the | ||
| // exact status semantics. | ||
| //nolint:staticcheck // deliberate: WithResourceStatus would force the trait status to ENABLED; UNSPECIFIED must be preserved for invitations. | ||
| resourceSdk.WithStatus(v2.UserTrait_Status_STATUS_UNSPECIFIED), | ||
| // Set explicitly: NewUserTrait defaults an unset trait status to | ||
| // ENABLED, which an unaccepted invitation is not. | ||
| //nolint:staticcheck // trait status is deprecated but must be set to override the ENABLED default. | ||
| resourceSdk.WithDetailedStatus(v2.UserTrait_Status_STATUS_PENDING, status), | ||
| resourceSdk.WithUserLogin(login), | ||
| }, | ||
| // profile has moved from UserTrait to a Resource-level attribute. | ||
| // profile and status have moved from UserTrait to Resource-level | ||
| // attributes. Expired invitations stay PENDING - they are still not a | ||
| // usable account - and carry the distinction in the status details. | ||
| resourceSdk.WithResourceProfile(profile), | ||
| resourceSdk.WithResourceStatus(v2.Status_RESOURCE_STATUS_PENDING, status), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: Separately, both status fields carry |
||
| ) | ||
| if err != nil { | ||
| return nil, err | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Suggestion: two things on this bump.
v0.25.1-0.20260825204020-991ca45253a7). The PR already commits to swapping to the tagged release before undrafting — flagging so it isn't lost.pkg/dotc1z/engine_registry.go,pkg/field/defaults.go), and the--diff-syncs/--base-sync-id/--applied-sync-idflags are removed along with diff-sync support. Nothing in this repo references those flags, so there is no build or CI break, but the storage-engine default change affects the artifact this connector produces and is worth calling out in the PR description and release notes rather than shipping silently.