feat: enhance S3 storage and improve Tailscale ACL sync#19
Merged
Conversation
There was a problem hiding this comment.
❌ Changes requested. Reviewed everything up to 98fea56 in 2 minutes and 0 seconds
More details
- Looked at
428lines of code in3files - Skipped
0files when reviewing. - Skipped posting
3drafted comments based on config settings.
1. pkg/common/state.go:255
- Draft comment:
return nil, "", "", fmt.Errorf("storage URL must begin with s3://, got %q", storageURL)
- Reason this comment was not posted:
Confidence changes required:0%
The error message in InitializeS3Client when the storage URL does not start with s3:// is clear and provides the expected format, which is good for debugging.
2. main.go:121
- Draft comment:
logger.Fatal("Invalid storage scheme. Must be file:// or s3://")
- Reason this comment was not posted:
Confidence changes required:0%
The code in main.go sets up the S3 client and checks for valid storage schemes. It correctly handles the initialization of the S3 client and logs errors if the initialization fails. The logic for checking the storage scheme is clear and ensures that only valid schemes are used.
3. pkg/sync/sync.go:99
- Draft comment:
delete(val, "id")
- Reason this comment was not posted:
Confidence changes required:0%
The function removeIDFields is designed to recursively remove "id" fields from a map. It correctly handles different types of data structures, such as arrays and maps, and returns the modified object. The logic is clear and concise.
Workflow ID: wflow_TbMn83mnzEBapbvU
Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.
| return nil, "", "", fmt.Errorf("storage URL must begin with s3://, got %q", storageURL) | ||
| } | ||
|
|
||
| logger.With(zap.String("region", s3Region), zap.String("s3Endpoint", s3Region)).Sugar().Info("Parsed S3 config") |
There was a problem hiding this comment.
Suggested change
| logger.With(zap.String("region", s3Region), zap.String("s3Endpoint", s3Region)).Sugar().Info("Parsed S3 config") | |
| logger.With(zap.String("region", s3Region), zap.String("s3Endpoint", s3Endpoint)).Sugar().Info("Parsed S3 config") |
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.
Important
Enhance S3 storage configuration, improve logging, and refine Tailscale ACL synchronization handling.
S3EndpointandS3Regionflags inCLIstruct inmain.gofor custom S3 configurations.InitializeS3Clientinstate.goto handle custom S3 endpoints and regions, and to log parsed S3 configurations.saveToStorageandloadFromS3instate.goto useObjectKeyfor S3 operations.state.gofor S3 operations, including warnings for unrecognized storage configurations.main.gofor state changes and Tailscale operations.StartandPushfunctions insync.goto ensure proper logging and error handling during ACL synchronization.idfields from ACL JSON insync.gousingremoveIDFieldsfunction.This description was created by
for 98fea56. It will automatically update as commits are pushed.