Skip to content

feat(invitations): Expand invitation context to external metadata#2299

Merged
javirln merged 5 commits into
chainloop-dev:mainfrom
javirln:feat/pfm-3396-invitation-context
Jul 31, 2025
Merged

feat(invitations): Expand invitation context to external metadata#2299
javirln merged 5 commits into
chainloop-dev:mainfrom
javirln:feat/pfm-3396-invitation-context

Conversation

@javirln

@javirln javirln commented Jul 30, 2025

Copy link
Copy Markdown
Member

This pull request introduces changes to improve the handling of organization invitations, particularly in the context of joining groups and projects. The updates include modifying the OrgInvitationContext structure to use pointers for UUID fields, adding support for external metadata, and enhancing test coverage to handle edge cases like nil UUIDs.

Before, since the groupID and projectID were not pointers, they were being stored in the DB as their nil representation of UUUID the 0000-0000... by adding a pointer, the are not store at all. The UUID != uuid.Nil check is there for already stored data.

@javirln javirln requested a review from jiparis July 30, 2025 09:05
@javirln javirln self-assigned this Jul 30, 2025
@javirln javirln changed the title feat(invitations): Expand invitation context to support products feat(invitations): Expand invitation context to external metadata Jul 31, 2025
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
@javirln javirln force-pushed the feat/pfm-3396-invitation-context branch from b3cc86c to 6582f1b Compare July 31, 2025 08:40
javirln added 2 commits July 31, 2025 10:45
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
func (uc *OrgInvitationUseCase) processGroupMembership(ctx context.Context, invitation *OrgInvitation, orgUUID uuid.UUID, userUUID uuid.UUID) error {
// Skip if there's no group to join in the invitation context
if invitation.Context == nil || invitation.Context.GroupIDToJoin == uuid.Nil {
if invitation.Context == nil || invitation.Context.GroupIDToJoin == nil || *invitation.Context.GroupIDToJoin == uuid.Nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much better!

javirln added 2 commits July 31, 2025 13:11
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
@javirln javirln merged commit 484a8ce into chainloop-dev:main Jul 31, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants