Skip to content
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

feat: Add retry logic for bulk imports based on work in the zed CLI #165

Merged
merged 4 commits into from
Feb 12, 2024

Conversation

chancesm
Copy link
Contributor

Tests can be added later. I just wanted an initial review of the code first.

@chancesm chancesm requested a review from a team as a code owner February 12, 2024 21:15
Copy link

github-actions bot commented Feb 12, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

v1/retryable_client.go Outdated Show resolved Hide resolved
}
)

type RetryableClient struct {
Copy link
Member

Choose a reason for hiding this comment

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

Add doc comments on all exported functions and types

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe I have done this now. If I missed one, let me know.

Copy link
Member

Choose a reason for hiding this comment

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

missed one:

// NewRetryableClient initializes a brand new client for interacting
// with Authzed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done ✅

v1/retryable_client.go Outdated Show resolved Hide resolved
@chancesm
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Signed-off-by: Chance Murray <[email protected]>
)

// ConflictStrategy is an enumeration type that represents the strategy to be used
// when a conflict occurs during a bulk import of relationships in Authzed.
Copy link
Member

Choose a reason for hiding this comment

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

into SpiceDB

type ConflictStrategy int

const (
Fail ConflictStrategy = iota
Copy link
Member

Choose a reason for hiding this comment

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

Move the comment for each to above each value

}
)

// RetryableClient represents an open connection to Authzed with
Copy link
Member

Choose a reason for hiding this comment

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

SpiceDB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll fix this, but I was following the pattern set on the doc comments for the other clients. They all say Authzed.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we're transitioning those to make it match the fact that this is open source

Signed-off-by: Chance Murray <[email protected]>
Copy link
Member

@josephschorr josephschorr left a comment

Choose a reason for hiding this comment

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

LGTM

@josephschorr josephschorr added this pull request to the merge queue Feb 12, 2024
Merged via the queue into authzed:main with commit 12fab70 Feb 12, 2024
9 checks passed
@chancesm chancesm deleted the retryable-import-client branch February 12, 2024 22:52
@github-actions github-actions bot locked and limited conversation to collaborators Feb 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants